From ba02eefa9a608ecbd560427b91f45265c81bf994 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Mon, 29 Jul 2019 12:06:40 -0400 Subject: [PATCH 01/38] react folder --- .vscode/settings.json | 3 + client/.gitignore | 23 + client/README.md | 68 + client/package.json | 31 + client/public/favicon.ico | Bin 0 -> 3870 bytes client/public/index.html | 38 + client/public/manifest.json | 15 + client/src/App.css | 33 + client/src/App.js | 26 + client/src/App.test.js | 9 + client/src/index.css | 13 + client/src/index.js | 12 + client/src/logo.svg | 7 + client/src/serviceWorker.js | 135 + client/yarn.lock | 10011 ++++++++++++++++++++++++++++++++++ 15 files changed, 10424 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 client/.gitignore create mode 100644 client/README.md create mode 100644 client/package.json create mode 100644 client/public/favicon.ico create mode 100644 client/public/index.html create mode 100644 client/public/manifest.json create mode 100644 client/src/App.css create mode 100644 client/src/App.js create mode 100644 client/src/App.test.js create mode 100644 client/src/index.css create mode 100644 client/src/index.js create mode 100644 client/src/logo.svg create mode 100644 client/src/serviceWorker.js create mode 100644 client/yarn.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..3b6641073 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 000000000..4d29575de --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/client/README.md b/client/README.md new file mode 100644 index 000000000..9d9614c4f --- /dev/null +++ b/client/README.md @@ -0,0 +1,68 @@ +This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). + +## Available Scripts + +In the project directory, you can run: + +### `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+You will also see any lint errors in the console. + +### `npm test` + +Launches the test runner in the interactive watch mode.
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. + +### `npm run build` + +Builds the app for production to the `build` folder.
+It correctly bundles React in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. + +### `npm run eject` + +**Note: this is a one-way operation. Once you `eject`, you can’t go back!** + +If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. + +Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. + +You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. + +## Learn More + +You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). + +To learn React, check out the [React documentation](https://reactjs.org/). + +### Code Splitting + +This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting + +### Analyzing the Bundle Size + +This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size + +### Making a Progressive Web App + +This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app + +### Advanced Configuration + +This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration + +### Deployment + +This section has moved here: https://facebook.github.io/create-react-app/docs/deployment + +### `npm run build` fails to minify + +This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify diff --git a/client/package.json b/client/package.json new file mode 100644 index 000000000..d2e475a57 --- /dev/null +++ b/client/package.json @@ -0,0 +1,31 @@ +{ + "name": "client", + "version": "0.1.0", + "private": true, + "dependencies": { + "react": "^16.8.6", + "react-dom": "^16.8.6", + "react-scripts": "3.0.1" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/client/public/favicon.ico b/client/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..a11777cc471a4344702741ab1c8a588998b1311a GIT binary patch literal 3870 zcma);c{J4h9>;%nil|2-o+rCuEF-(I%-F}ijC~o(k~HKAkr0)!FCj~d>`RtpD?8b; zXOC1OD!V*IsqUwzbMF1)-gEDD=A573Z-&G7^LoAC9|WO7Xc0Cx1g^Zu0u_SjAPB3vGa^W|sj)80f#V0@M_CAZTIO(t--xg= z!sii`1giyH7EKL_+Wi0ab<)&E_0KD!3Rp2^HNB*K2@PHCs4PWSA32*-^7d{9nH2_E zmC{C*N*)(vEF1_aMamw2A{ZH5aIDqiabnFdJ|y0%aS|64E$`s2ccV~3lR!u<){eS` z#^Mx6o(iP1Ix%4dv`t@!&Za-K@mTm#vadc{0aWDV*_%EiGK7qMC_(`exc>-$Gb9~W!w_^{*pYRm~G zBN{nA;cm^w$VWg1O^^<6vY`1XCD|s_zv*g*5&V#wv&s#h$xlUilPe4U@I&UXZbL z0)%9Uj&@yd03n;!7do+bfixH^FeZ-Ema}s;DQX2gY+7g0s(9;`8GyvPY1*vxiF&|w z>!vA~GA<~JUqH}d;DfBSi^IT*#lrzXl$fNpq0_T1tA+`A$1?(gLb?e#0>UELvljtQ zK+*74m0jn&)5yk8mLBv;=@}c{t0ztT<v;Avck$S6D`Z)^c0(jiwKhQsn|LDRY&w(Fmi91I7H6S;b0XM{e zXp0~(T@k_r-!jkLwd1_Vre^v$G4|kh4}=Gi?$AaJ)3I+^m|Zyj#*?Kp@w(lQdJZf4 z#|IJW5z+S^e9@(6h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RaDZ!+%`wYOI<23q|&js`&o4xvjP7D_xv@ z5hEwpsp{HezI9!~6O{~)lLR@oF7?J7i>1|5a~UuoN=q&6N}EJPV_GD`&M*v8Y`^2j zKII*d_@Fi$+i*YEW+Hbzn{iQk~yP z>7N{S4)r*!NwQ`(qcN#8SRQsNK6>{)X12nbF`*7#ecO7I)Q$uZsV+xS4E7aUn+U(K baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ literal 0 HcmV?d00001 diff --git a/client/public/index.html b/client/public/index.html new file mode 100644 index 000000000..dd1ccfd4c --- /dev/null +++ b/client/public/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + React App + + + +
+ + + diff --git a/client/public/manifest.json b/client/public/manifest.json new file mode 100644 index 000000000..1f2f141fa --- /dev/null +++ b/client/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/client/src/App.css b/client/src/App.css new file mode 100644 index 000000000..b41d297ca --- /dev/null +++ b/client/src/App.css @@ -0,0 +1,33 @@ +.App { + text-align: center; +} + +.App-logo { + animation: App-logo-spin infinite 20s linear; + height: 40vmin; + pointer-events: none; +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/client/src/App.js b/client/src/App.js new file mode 100644 index 000000000..ce9cbd294 --- /dev/null +++ b/client/src/App.js @@ -0,0 +1,26 @@ +import React from 'react'; +import logo from './logo.svg'; +import './App.css'; + +function App() { + return ( +
+
+ logo +

+ Edit src/App.js and save to reload. +

+
+ Learn React + +
+
+ ); +} + +export default App; diff --git a/client/src/App.test.js b/client/src/App.test.js new file mode 100644 index 000000000..a754b201b --- /dev/null +++ b/client/src/App.test.js @@ -0,0 +1,9 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; + +it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + ReactDOM.unmountComponentAtNode(div); +}); diff --git a/client/src/index.css b/client/src/index.css new file mode 100644 index 000000000..4a1df4db7 --- /dev/null +++ b/client/src/index.css @@ -0,0 +1,13 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", + monospace; +} diff --git a/client/src/index.js b/client/src/index.js new file mode 100644 index 000000000..87d1be551 --- /dev/null +++ b/client/src/index.js @@ -0,0 +1,12 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import './index.css'; +import App from './App'; +import * as serviceWorker from './serviceWorker'; + +ReactDOM.render(, document.getElementById('root')); + +// If you want your app to work offline and load faster, you can change +// unregister() to register() below. Note this comes with some pitfalls. +// Learn more about service workers: https://bit.ly/CRA-PWA +serviceWorker.unregister(); diff --git a/client/src/logo.svg b/client/src/logo.svg new file mode 100644 index 000000000..6b60c1042 --- /dev/null +++ b/client/src/logo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/client/src/serviceWorker.js b/client/src/serviceWorker.js new file mode 100644 index 000000000..f8c7e50c2 --- /dev/null +++ b/client/src/serviceWorker.js @@ -0,0 +1,135 @@ +// This optional code is used to register a service worker. +// register() is not called by default. + +// This lets the app load faster on subsequent visits in production, and gives +// it offline capabilities. However, it also means that developers (and users) +// will only see deployed updates on subsequent visits to a page, after all the +// existing tabs open on the page have been closed, since previously cached +// resources are updated in the background. + +// To learn more about the benefits of this model and instructions on how to +// opt-in, read https://bit.ly/CRA-PWA + +const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) +); + +export function register(config) { + if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { + // The URL constructor is available in all browsers that support SW. + const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); + if (publicUrl.origin !== window.location.origin) { + // Our service worker won't work if PUBLIC_URL is on a different origin + // from what our page is served on. This might happen if a CDN is used to + // serve assets; see https://github.com/facebook/create-react-app/issues/2374 + return; + } + + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); + + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit https://bit.ly/CRA-PWA' + ); + }); + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } + }); + } +} + +function registerValidSW(swUrl, config) { + navigator.serviceWorker + .register(swUrl) + .then(registration => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + 'New content is available and will be used when all ' + + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + ); + + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.'); + + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch(error => { + console.error('Error during service worker registration:', error); + }); +} + +function checkValidServiceWorker(swUrl, config) { + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then(response => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get('content-type'); + if ( + response.status === 404 || + (contentType != null && contentType.indexOf('javascript') === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then(registration => { + registration.unregister().then(() => { + window.location.reload(); + }); + }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + 'No internet connection found. App is running in offline mode.' + ); + }); +} + +export function unregister() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then(registration => { + registration.unregister(); + }); + } +} diff --git a/client/yarn.lock b/client/yarn.lock new file mode 100644 index 000000000..25b6936b7 --- /dev/null +++ b/client/yarn.lock @@ -0,0 +1,10011 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.3.tgz#198d6d3af4567be3989550d97e068de94503074f" + integrity sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.0" + "@babel/helpers" "^7.4.3" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/core@^7.1.0", "@babel/core@^7.1.6", "@babel/core@^7.4.3": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.4.tgz#84055750b05fcd50f9915a826b44fa347a825250" + integrity sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helpers" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" + integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-builder-react-jsx@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" + integrity sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw== + dependencies: + "@babel/types" "^7.3.0" + esutils "^2.0.0" + +"@babel/helper-call-delegate@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" + integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== + dependencies: + "@babel/helper-hoist-variables" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/helper-create-class-features-plugin@^7.4.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.4.tgz#fc3d690af6554cc9efc607364a82d48f58736dba" + integrity sha512-UbBHIa2qeAGgyiNR9RszVF7bUHEdgS4JAUNT8SiqrAN6YJVxlOxeLr5pBzb5kan302dejJ9nla4RyKcR1XT6XA== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-split-export-declaration" "^7.4.4" + +"@babel/helper-define-map@^7.4.0", "@babel/helper-define-map@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" + integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/types" "^7.4.4" + lodash "^4.17.11" + +"@babel/helper-explode-assignable-expression@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" + integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== + dependencies: + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-hoist-variables@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" + integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-member-expression-to-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" + integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-imports@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" + integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/template" "^7.4.4" + "@babel/types" "^7.4.4" + lodash "^4.17.11" + +"@babel/helper-optimise-call-expression@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" + integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" + integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== + dependencies: + lodash "^4.17.11" + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.0", "@babel/helper-replace-supers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" + integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/helper-simple-access@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" + integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== + dependencies: + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.0", "@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-wrap-function@^7.1.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.2.0" + +"@babel/helpers@^7.4.3", "@babel/helpers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" + integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" + integrity sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w== + +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + +"@babel/plugin-proposal-class-properties@7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz#d70db61a2f1fd79de927eea91f6411c964e084b8" + integrity sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-proposal-decorators@7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz#8e1bfd83efa54a5f662033afcc2b8e701f4bb3a9" + integrity sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-decorators" "^7.2.0" + +"@babel/plugin-proposal-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" + integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" + +"@babel/plugin-proposal-object-rest-spread@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.3.tgz#be27cd416eceeba84141305b93c282f5de23bbb4" + integrity sha512-xC//6DNSSHVjq8O2ge0dyYlhshsH4T7XdCVoxbi5HzLYWfsC5ooFlJjrXk8RcAT+hjHAK9UjBXdylzSoDK3t4g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + +"@babel/plugin-proposal-object-rest-spread@^7.4.3", "@babel/plugin-proposal-object-rest-spread@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz#1ef173fcf24b3e2df92a678f027673b55e7e3005" + integrity sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + +"@babel/plugin-proposal-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" + integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + +"@babel/plugin-proposal-unicode-property-regex@^7.4.0", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" + integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-decorators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" + integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-dynamic-import@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" + integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-flow@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" + integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" + integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-jsx@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" + integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" + integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-typescript@^7.2.0": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" + integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-arrow-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" + integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-async-to-generator@^7.4.0", "@babel/plugin-transform-async-to-generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz#a3f1d01f2f21cadab20b33a82133116f14fb5894" + integrity sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + +"@babel/plugin-transform-block-scoped-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" + integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-block-scoping@^7.4.0", "@babel/plugin-transform-block-scoping@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" + integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + lodash "^4.17.11" + +"@babel/plugin-transform-classes@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.3.tgz#adc7a1137ab4287a555d429cc56ecde8f40c062c" + integrity sha512-PUaIKyFUDtG6jF5DUJOfkBdwAS/kFFV3XFk7Nn0a6vR7ZT8jYw5cGtIlat77wcnd0C6ViGqo/wyNf4ZHytF/nQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-define-map" "^7.4.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.0" + "@babel/helper-split-export-declaration" "^7.4.0" + globals "^11.1.0" + +"@babel/plugin-transform-classes@^7.4.3", "@babel/plugin-transform-classes@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" + integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-define-map" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-split-export-declaration" "^7.4.4" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" + integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-destructuring@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.3.tgz#1a95f5ca2bf2f91ef0648d5de38a8d472da4350f" + integrity sha512-rVTLLZpydDFDyN4qnXdzwoVpk1oaXHIvPEOkOLyr88o7oHxVc/LyrnDx+amuBWGOwUb7D1s/uLsKBNTx08htZg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-destructuring@^7.4.3", "@babel/plugin-transform-destructuring@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz#9d964717829cc9e4b601fc82a26a71a4d8faf20f" + integrity sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-dotall-regex@^7.4.3", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" + integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/plugin-transform-duplicate-keys@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" + integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-exponentiation-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" + integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-flow-strip-types@7.4.0": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.0.tgz#f3c59eecff68c99b9c96eaafe4fe9d1fa8947138" + integrity sha512-C4ZVNejHnfB22vI2TYN4RUp2oCmq6cSEAg4RygSvYZUECRqUu9O4PMEMNJ4wsemaRGg27BbgYctG4BZh+AgIHw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.2.0" + +"@babel/plugin-transform-for-of@^7.4.3", "@babel/plugin-transform-for-of@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" + integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-function-name@^7.4.3", "@babel/plugin-transform-function-name@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" + integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" + integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-member-expression-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" + integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-amd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" + integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-commonjs@^7.4.3", "@babel/plugin-transform-modules-commonjs@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz#0bef4713d30f1d78c2e59b3d6db40e60192cac1e" + integrity sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw== + dependencies: + "@babel/helper-module-transforms" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + +"@babel/plugin-transform-modules-systemjs@^7.4.0", "@babel/plugin-transform-modules-systemjs@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz#dc83c5665b07d6c2a7b224c00ac63659ea36a405" + integrity sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ== + dependencies: + "@babel/helper-hoist-variables" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-umd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" + integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.4.2", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.4.tgz#5611d96d987dfc4a3a81c4383bb173361037d68d" + integrity sha512-Ki+Y9nXBlKfhD+LXaRS7v95TtTGYRAf9Y1rTDiE75zf8YQz4GDaWRXosMfJBXxnk88mGFjWdCRIeqDbon7spYA== + dependencies: + regexp-tree "^0.1.0" + +"@babel/plugin-transform-new-target@^7.4.0", "@babel/plugin-transform-new-target@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" + integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-object-super@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" + integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + +"@babel/plugin-transform-parameters@^7.4.3", "@babel/plugin-transform-parameters@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" + integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== + dependencies: + "@babel/helper-call-delegate" "^7.4.4" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-property-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" + integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-constant-elements@7.2.0", "@babel/plugin-transform-react-constant-elements@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.2.0.tgz#ed602dc2d8bff2f0cb1a5ce29263dbdec40779f7" + integrity sha512-YYQFg6giRFMsZPKUM9v+VcHOdfSQdz9jHCx3akAi3UYgyjndmdYGSXylQ/V+HswQt4fL8IklchD9HTsaOCrWQQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-display-name@7.2.0", "@babel/plugin-transform-react-display-name@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" + integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-jsx-self@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" + integrity sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-react-jsx-source@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz#20c8c60f0140f5dd3cd63418d452801cf3f7180f" + integrity sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-react-jsx@^7.0.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" + integrity sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg== + dependencies: + "@babel/helper-builder-react-jsx" "^7.3.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" + +"@babel/plugin-transform-regenerator@^7.4.3", "@babel/plugin-transform-regenerator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.4.tgz#5b4da4df79391895fca9e28f99e87e22cfc02072" + integrity sha512-Zz3w+pX1SI0KMIiqshFZkwnVGUhDZzpX2vtPzfJBKQQq8WsP/Xy9DNdELWivxcKOCX/Pywge4SiEaPaLtoDT4g== + dependencies: + regenerator-transform "^0.13.4" + +"@babel/plugin-transform-reserved-words@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" + integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-runtime@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.3.tgz#4d6691690ecdc9f5cb8c3ab170a1576c1f556371" + integrity sha512-7Q61bU+uEI7bCUFReT1NKn7/X6sDQsZ7wL1sJ9IYMAO7cI+eg6x9re1cEw2fCRMbbTVyoeUKWSV1M6azEfKCfg== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + resolve "^1.8.1" + semver "^5.5.1" + +"@babel/plugin-transform-shorthand-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" + integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-spread@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" + integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-sticky-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" + integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + +"@babel/plugin-transform-template-literals@^7.2.0", "@babel/plugin-transform-template-literals@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" + integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-typeof-symbol@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" + integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-typescript@^7.3.2": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.4.tgz#93e9c3f2a546e6d3da1e9cc990e30791b807aa9f" + integrity sha512-rwDvjaMTx09WC0rXGBRlYSSkEHOKRrecY6hEr3SVIPKII8DVWXtapNAfAyMC0dovuO+zYArcAuKeu3q9DNRfzA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-typescript" "^7.2.0" + +"@babel/plugin-transform-unicode-regex@^7.4.3", "@babel/plugin-transform-unicode-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" + integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" + +"@babel/preset-env@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880" + integrity sha512-FYbZdV12yHdJU5Z70cEg0f6lvtpZ8jFSDakTm7WXeJbLXh4R0ztGEu/SW7G1nJ2ZvKwDhz8YrbA84eYyprmGqw== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-async-generator-functions" "^7.2.0" + "@babel/plugin-proposal-json-strings" "^7.2.0" + "@babel/plugin-proposal-object-rest-spread" "^7.4.3" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-transform-arrow-functions" "^7.2.0" + "@babel/plugin-transform-async-to-generator" "^7.4.0" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.4.0" + "@babel/plugin-transform-classes" "^7.4.3" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.4.3" + "@babel/plugin-transform-dotall-regex" "^7.4.3" + "@babel/plugin-transform-duplicate-keys" "^7.2.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.4.3" + "@babel/plugin-transform-function-name" "^7.4.3" + "@babel/plugin-transform-literals" "^7.2.0" + "@babel/plugin-transform-member-expression-literals" "^7.2.0" + "@babel/plugin-transform-modules-amd" "^7.2.0" + "@babel/plugin-transform-modules-commonjs" "^7.4.3" + "@babel/plugin-transform-modules-systemjs" "^7.4.0" + "@babel/plugin-transform-modules-umd" "^7.2.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.2" + "@babel/plugin-transform-new-target" "^7.4.0" + "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-parameters" "^7.4.3" + "@babel/plugin-transform-property-literals" "^7.2.0" + "@babel/plugin-transform-regenerator" "^7.4.3" + "@babel/plugin-transform-reserved-words" "^7.2.0" + "@babel/plugin-transform-shorthand-properties" "^7.2.0" + "@babel/plugin-transform-spread" "^7.2.0" + "@babel/plugin-transform-sticky-regex" "^7.2.0" + "@babel/plugin-transform-template-literals" "^7.2.0" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.4.3" + "@babel/types" "^7.4.0" + browserslist "^4.5.2" + core-js-compat "^3.0.0" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.5.0" + +"@babel/preset-env@^7.1.6": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.4.tgz#b6f6825bfb27b3e1394ca3de4f926482722c1d6f" + integrity sha512-FU1H+ACWqZZqfw1x2G1tgtSSYSfxJLkpaUQL37CenULFARDo+h4xJoVHzRoHbK+85ViLciuI7ME4WTIhFRBBlw== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-async-generator-functions" "^7.2.0" + "@babel/plugin-proposal-json-strings" "^7.2.0" + "@babel/plugin-proposal-object-rest-spread" "^7.4.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-transform-arrow-functions" "^7.2.0" + "@babel/plugin-transform-async-to-generator" "^7.4.4" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.4.4" + "@babel/plugin-transform-classes" "^7.4.4" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/plugin-transform-duplicate-keys" "^7.2.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.4.4" + "@babel/plugin-transform-function-name" "^7.4.4" + "@babel/plugin-transform-literals" "^7.2.0" + "@babel/plugin-transform-member-expression-literals" "^7.2.0" + "@babel/plugin-transform-modules-amd" "^7.2.0" + "@babel/plugin-transform-modules-commonjs" "^7.4.4" + "@babel/plugin-transform-modules-systemjs" "^7.4.4" + "@babel/plugin-transform-modules-umd" "^7.2.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.4" + "@babel/plugin-transform-new-target" "^7.4.4" + "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-parameters" "^7.4.4" + "@babel/plugin-transform-property-literals" "^7.2.0" + "@babel/plugin-transform-regenerator" "^7.4.4" + "@babel/plugin-transform-reserved-words" "^7.2.0" + "@babel/plugin-transform-shorthand-properties" "^7.2.0" + "@babel/plugin-transform-spread" "^7.2.0" + "@babel/plugin-transform-sticky-regex" "^7.2.0" + "@babel/plugin-transform-template-literals" "^7.4.4" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.4.4" + "@babel/types" "^7.4.4" + browserslist "^4.5.2" + core-js-compat "^3.0.0" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.5.0" + +"@babel/preset-react@7.0.0", "@babel/preset-react@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" + integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" + +"@babel/preset-typescript@7.3.3": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a" + integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-typescript" "^7.3.2" + +"@babel/runtime@7.4.3": + version "7.4.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.3.tgz#79888e452034223ad9609187a0ad1fe0d2ad4bdc" + integrity sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA== + dependencies: + regenerator-runtime "^0.13.2" + +"@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.2": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d" + integrity sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg== + dependencies: + regenerator-runtime "^0.13.2" + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" + integrity sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@csstools/convert-colors@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" + integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw== + +"@csstools/normalize.css@^9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-9.0.1.tgz#c27b391d8457d1e893f1eddeaf5e5412d12ffbb5" + integrity sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA== + +"@hapi/address@2.x.x": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.0.0.tgz#9f05469c88cb2fd3dcd624776b54ee95c312126a" + integrity sha512-mV6T0IYqb0xL1UALPFplXYQmR0twnXG0M6jUswpquqT2sD12BOiCiLy3EvMp/Fy7s3DZElC4/aPjEjo2jeZpvw== + +"@hapi/hoek@6.x.x": + version "6.2.1" + resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-6.2.1.tgz#d3a66329159af879bfdf0b0cff2229c43c5a3451" + integrity sha512-+ryw4GU9pjr1uT6lBuErHJg3NYqzwJTvZ75nKuJijEzpd00Uqi6oiawTGDDf5Hl0zWmI7qHfOtaqB0kpQZJQzA== + +"@hapi/joi@^15.0.0": + version "15.0.2" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.0.2.tgz#2989041a06ee2941cf6dd247ffff8032640d16bb" + integrity sha512-c3NwWBHzUnEavcaCpGaepOcygS17pSnOh5ZYUBz+sfqCP7kC9haLcRnd3U8KFC4TbLFmRwKnmYglsc47m9yapg== + dependencies: + "@hapi/address" "2.x.x" + "@hapi/hoek" "6.x.x" + "@hapi/topo" "3.x.x" + +"@hapi/topo@3.x.x": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.0.tgz#5c47cd9637c2953db185aa957a27bcb2a8b7a6f8" + integrity sha512-gZDI/eXOIk8kP2PkUKjWu9RW8GGVd2Hkgjxyr/S7Z+JF+0mr7bAlbw+DkTRxnD580o8Kqxlnba9wvqp5aOHBww== + dependencies: + "@hapi/hoek" "6.x.x" + +"@jest/console@^24.7.1": + version "24.7.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" + integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== + dependencies: + "@jest/source-map" "^24.3.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== + dependencies: + "@jest/console" "^24.7.1" + "@jest/types" "^24.8.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== + dependencies: + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.8.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.8.0" + jest-regex-util "^24.3.0" + jest-util "^24.8.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.7.0", "@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^12.0.9" + +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== + +"@svgr/babel-plugin-add-jsx-attribute@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz#dadcb6218503532d6884b210e7f3c502caaa44b1" + integrity sha512-j7KnilGyZzYr/jhcrSYS3FGWMZVaqyCG0vzMCwzvei0coIkczuYMcniK07nI0aHJINciujjH11T72ICW5eL5Ig== + +"@svgr/babel-plugin-remove-jsx-attribute@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-4.2.0.tgz#297550b9a8c0c7337bea12bdfc8a80bb66f85abc" + integrity sha512-3XHLtJ+HbRCH4n28S7y/yZoEQnRpl0tvTZQsHqvaeNXPra+6vE5tbRliH3ox1yZYPCxrlqaJT/Mg+75GpDKlvQ== + +"@svgr/babel-plugin-remove-jsx-empty-expression@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-4.2.0.tgz#c196302f3e68eab6a05e98af9ca8570bc13131c7" + integrity sha512-yTr2iLdf6oEuUE9MsRdvt0NmdpMBAkgK8Bjhl6epb+eQWk6abBaX3d65UZ3E3FWaOwePyUgNyNCMVG61gGCQ7w== + +"@svgr/babel-plugin-replace-jsx-attribute-value@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-4.2.0.tgz#310ec0775de808a6a2e4fd4268c245fd734c1165" + integrity sha512-U9m870Kqm0ko8beHawRXLGLvSi/ZMrl89gJ5BNcT452fAjtF2p4uRzXkdzvGJJJYBgx7BmqlDjBN/eCp5AAX2w== + +"@svgr/babel-plugin-svg-dynamic-title@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-4.2.0.tgz#43f0f689a5347a894160eb51b39a109889a4df20" + integrity sha512-gH2qItapwCUp6CCqbxvzBbc4dh4OyxdYKsW3EOkYexr0XUmQL0ScbdNh6DexkZ01T+sdClniIbnCObsXcnx3sQ== + +"@svgr/babel-plugin-svg-em-dimensions@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-4.2.0.tgz#9a94791c9a288108d20a9d2cc64cac820f141391" + integrity sha512-C0Uy+BHolCHGOZ8Dnr1zXy/KgpBOkEUYY9kI/HseHVPeMbluaX3CijJr7D4C5uR8zrc1T64nnq/k63ydQuGt4w== + +"@svgr/babel-plugin-transform-react-native-svg@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-4.2.0.tgz#151487322843359a1ca86b21a3815fd21a88b717" + integrity sha512-7YvynOpZDpCOUoIVlaaOUU87J4Z6RdD6spYN4eUb5tfPoKGSF9OG2NuhgYnq4jSkAxcpMaXWPf1cePkzmqTPNw== + +"@svgr/babel-plugin-transform-svg-component@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-4.2.0.tgz#5f1e2f886b2c85c67e76da42f0f6be1b1767b697" + integrity sha512-hYfYuZhQPCBVotABsXKSCfel2slf/yvJY8heTVX1PCTaq/IgASq1IyxPPKJ0chWREEKewIU/JMSsIGBtK1KKxw== + +"@svgr/babel-preset@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-4.2.0.tgz#c9fc236445a02a8cd4e750085e51c181de00d6c5" + integrity sha512-iLetHpRCQXfK47voAs5/uxd736cCyocEdorisjAveZo8ShxJ/ivSZgstBmucI1c8HyMF5tOrilJLoFbhpkPiKw== + dependencies: + "@svgr/babel-plugin-add-jsx-attribute" "^4.2.0" + "@svgr/babel-plugin-remove-jsx-attribute" "^4.2.0" + "@svgr/babel-plugin-remove-jsx-empty-expression" "^4.2.0" + "@svgr/babel-plugin-replace-jsx-attribute-value" "^4.2.0" + "@svgr/babel-plugin-svg-dynamic-title" "^4.2.0" + "@svgr/babel-plugin-svg-em-dimensions" "^4.2.0" + "@svgr/babel-plugin-transform-react-native-svg" "^4.2.0" + "@svgr/babel-plugin-transform-svg-component" "^4.2.0" + +"@svgr/core@^4.1.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/core/-/core-4.2.0.tgz#f32ef8b9d05312aaa775896ec30ae46a6521e248" + integrity sha512-nvzXaf2VavqjMCTTfsZfjL4o9035KedALkMzk82qOlHOwBb8JT+9+zYDgBl0oOunbVF94WTLnvGunEg0csNP3Q== + dependencies: + "@svgr/plugin-jsx" "^4.2.0" + camelcase "^5.3.1" + cosmiconfig "^5.2.0" + +"@svgr/hast-util-to-babel-ast@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.2.0.tgz#dd743435a5f3a8e84a1da067f27b5fae3d7b6b63" + integrity sha512-IvAeb7gqrGB5TH9EGyBsPrMRH/QCzIuAkLySKvH2TLfLb2uqk98qtJamordRQTpHH3e6TORfBXoTo7L7Opo/Ow== + dependencies: + "@babel/types" "^7.4.0" + +"@svgr/plugin-jsx@^4.1.0", "@svgr/plugin-jsx@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-4.2.0.tgz#15a91562c9b5f90640ea0bdcb2ad59d692ee7ae9" + integrity sha512-AM1YokmZITgveY9bulLVquqNmwiFo2Px2HL+IlnTCR01YvWDfRL5QKdnF7VjRaS5MNP938mmqvL0/8oz3zQMkg== + dependencies: + "@babel/core" "^7.4.3" + "@svgr/babel-preset" "^4.2.0" + "@svgr/hast-util-to-babel-ast" "^4.2.0" + rehype-parse "^6.0.0" + unified "^7.1.0" + vfile "^4.0.0" + +"@svgr/plugin-svgo@^4.0.3": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@svgr/plugin-svgo/-/plugin-svgo-4.2.0.tgz#2a594a2d3312955e75fd87dc77ae51f377c809f3" + integrity sha512-zUEKgkT172YzHh3mb2B2q92xCnOAMVjRx+o0waZ1U50XqKLrVQ/8dDqTAtnmapdLsGurv8PSwenjLCUpj6hcvw== + dependencies: + cosmiconfig "^5.2.0" + merge-deep "^3.0.2" + svgo "^1.2.1" + +"@svgr/webpack@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-4.1.0.tgz#20c88f32f731c7b1d4711045b2b993887d731c28" + integrity sha512-d09ehQWqLMywP/PT/5JvXwPskPK9QCXUjiSkAHehreB381qExXf5JFCBWhfEyNonRbkIneCeYM99w+Ud48YIQQ== + dependencies: + "@babel/core" "^7.1.6" + "@babel/plugin-transform-react-constant-elements" "^7.0.0" + "@babel/preset-env" "^7.1.6" + "@babel/preset-react" "^7.0.0" + "@svgr/core" "^4.1.0" + "@svgr/plugin-jsx" "^4.1.0" + "@svgr/plugin-svgo" "^4.0.3" + loader-utils "^1.1.0" + +"@types/babel__core@^7.1.0": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" + integrity sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "12.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.0.tgz#d11813b9c0ff8aaca29f04cbc12817f4c7d656e5" + integrity sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg== + +"@types/q@^1.5.1": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8" + integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + +"@types/vfile-message@*": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a" + integrity sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA== + dependencies: + "@types/node" "*" + "@types/unist" "*" + +"@types/vfile@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/vfile/-/vfile-3.0.2.tgz#19c18cd232df11ce6fa6ad80259bc86c366b09b9" + integrity sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw== + dependencies: + "@types/node" "*" + "@types/unist" "*" + "@types/vfile-message" "*" + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== + +"@typescript-eslint/eslint-plugin@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz#a5ff3128c692393fb16efa403ec7c8a5593dab0f" + integrity sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ== + dependencies: + "@typescript-eslint/parser" "1.6.0" + "@typescript-eslint/typescript-estree" "1.6.0" + requireindex "^1.2.0" + tsutils "^3.7.0" + +"@typescript-eslint/parser@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804" + integrity sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw== + dependencies: + "@typescript-eslint/typescript-estree" "1.6.0" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0" + integrity sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + +"@webassemblyjs/ast@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" + integrity sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ== + dependencies: + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + +"@webassemblyjs/floating-point-hex-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" + integrity sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ== + +"@webassemblyjs/helper-api-error@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" + integrity sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA== + +"@webassemblyjs/helper-buffer@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" + integrity sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q== + +"@webassemblyjs/helper-code-frame@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" + integrity sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ== + dependencies: + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/helper-fsm@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" + integrity sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow== + +"@webassemblyjs/helper-module-context@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" + integrity sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g== + dependencies: + "@webassemblyjs/ast" "1.8.5" + mamacro "^0.0.3" + +"@webassemblyjs/helper-wasm-bytecode@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" + integrity sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ== + +"@webassemblyjs/helper-wasm-section@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" + integrity sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + +"@webassemblyjs/ieee754@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" + integrity sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" + integrity sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" + integrity sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw== + +"@webassemblyjs/wasm-edit@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" + integrity sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/helper-wasm-section" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-opt" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/wasm-gen@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" + integrity sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wasm-opt@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" + integrity sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + +"@webassemblyjs/wasm-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" + integrity sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wast-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" + integrity sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/floating-point-hex-parser" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-code-frame" "1.8.5" + "@webassemblyjs/helper-fsm" "1.8.5" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/wast-printer@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" + integrity sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +accepts@~1.3.4, accepts@~1.3.5: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +acorn-dynamic-import@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== + +acorn-globals@^4.1.0, acorn-globals@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" + integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1, acorn@^6.0.4, acorn@^6.0.5, acorn@^6.0.7: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +address@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" + integrity sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg== + +address@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/address/-/address-1.1.0.tgz#ef8e047847fcd2c5b6f50c16965f924fd99fe709" + integrity sha512-4diPfzWbLEIElVG4AnqP+00SULlPzNuyJFNnmMrLgyaxG6tZXJ1sn7mjBu4fHrJE+Yp/jgylOweJn2xsLMFggQ== + +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== + +ajv-keywords@^3.1.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" + integrity sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw== + +ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +alphanum-sort@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" + integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= + +ansi-colors@^3.0.0: + version "3.2.4" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" + integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== + +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-html@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3, aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +aria-query@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" + integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= + dependencies: + ast-types-flow "0.0.7" + commander "^2.11.0" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + +array-flatten@^2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" + integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== + +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +asap@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assert@^1.1.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +ast-types-flow@0.0.7, ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +autoprefixer@^9.4.9: + version "9.5.1" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.5.1.tgz#243b1267b67e7e947f28919d786b50d3bb0fb357" + integrity sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ== + dependencies: + browserslist "^4.5.4" + caniuse-lite "^1.0.30000957" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^7.0.14" + postcss-value-parser "^3.3.1" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +axobject-query@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" + integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== + dependencies: + ast-types-flow "0.0.7" + +babel-code-frame@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-eslint@10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" + +babel-extract-comments@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21" + integrity sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ== + dependencies: + babylon "^6.18.0" + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== + dependencies: + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.6.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-loader@8.0.5: + version "8.0.5" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" + integrity sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw== + dependencies: + find-cache-dir "^2.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + util.promisify "^1.0.0" + +babel-plugin-dynamic-import-node@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz#c0adfb07d95f4a4495e9aaac6ec386c4d7c2524e" + integrity sha512-fP899ELUnTaBcIzmrW7nniyqqdYWrWuJUyPWHxFa/c7r7hS6KC8FscNfLlBNIoPSc55kYMGEEKjPjJGCLbE1qA== + dependencies: + object.assign "^4.1.0" + +babel-plugin-istanbul@^5.1.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" + integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-plugin-macros@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.5.1.tgz#4a119ac2c2e19b458c259b9accd7ee34fd57ec6f" + integrity sha512-xN3KhAxPzsJ6OQTktCanNpIFnnMsCV+t8OloKxIL72D6+SUZYFn9qfklPgef5HyyDtzYZqqb+fs1S12+gQY82Q== + dependencies: + "@babel/runtime" "^7.4.2" + cosmiconfig "^5.2.0" + resolve "^1.10.0" + +babel-plugin-named-asset-import@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.2.tgz#20978ed446b8e1bf4a2f42d0a94c0ece85f75f4f" + integrity sha512-CxwvxrZ9OirpXQ201Ec57OmGhmI8/ui/GwTDy0hSp6CmRvgRC0pSair6Z04Ck+JStA0sMPZzSJ3uE4n17EXpPQ== + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= + +babel-plugin-transform-object-rest-spread@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + +babel-plugin-transform-react-remove-prop-types@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" + integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== + +babel-preset-jest@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" + integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.6.0" + +babel-preset-react-app@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-9.0.0.tgz#703108142bc9dd7173bde6a1a0138a762abc76f9" + integrity sha512-YVsDA8HpAKklhFLJtl9+AgaxrDaor8gGvDFlsg1ByOS0IPGUovumdv4/gJiAnLcDmZmKlH6+9sVOz4NVW7emAg== + dependencies: + "@babel/core" "7.4.3" + "@babel/plugin-proposal-class-properties" "7.4.0" + "@babel/plugin-proposal-decorators" "7.4.0" + "@babel/plugin-proposal-object-rest-spread" "7.4.3" + "@babel/plugin-syntax-dynamic-import" "7.2.0" + "@babel/plugin-transform-classes" "7.4.3" + "@babel/plugin-transform-destructuring" "7.4.3" + "@babel/plugin-transform-flow-strip-types" "7.4.0" + "@babel/plugin-transform-react-constant-elements" "7.2.0" + "@babel/plugin-transform-react-display-name" "7.2.0" + "@babel/plugin-transform-runtime" "7.4.3" + "@babel/preset-env" "7.4.3" + "@babel/preset-react" "7.0.0" + "@babel/preset-typescript" "7.3.3" + "@babel/runtime" "7.4.3" + babel-plugin-dynamic-import-node "2.2.0" + babel-plugin-macros "2.5.1" + babel-plugin-transform-react-remove-prop-types "0.4.24" + +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +bail@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b" + integrity sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +batch@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" + integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +bluebird@^3.5.3: + version "3.5.4" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" + integrity sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + +body-parser@1.18.3: + version "1.18.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "~1.6.3" + iconv-lite "0.4.23" + on-finished "~2.3.0" + qs "6.5.2" + raw-body "2.3.3" + type-is "~1.6.16" + +bonjour@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" + integrity sha1-jokKGD2O6aI5OzhExpGkK897yfU= + dependencies: + array-flatten "^2.1.0" + deep-equal "^1.0.1" + dns-equal "^1.0.0" + dns-txt "^2.0.2" + multicast-dns "^6.0.1" + multicast-dns-service-types "^1.1.0" + +boolbase@^1.0.0, boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + +browserslist@4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7" + integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag== + dependencies: + caniuse-lite "^1.0.30000955" + electron-to-chromium "^1.3.122" + node-releases "^1.1.13" + +browserslist@^4.0.0, browserslist@^4.1.1, browserslist@^4.4.2, browserslist@^4.5.2, browserslist@^4.5.4: + version "4.5.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.6.tgz#ea42e8581ca2513fa7f371d4dd66da763938163d" + integrity sha512-o/hPOtbU9oX507lIqon+UvPYqpx3mHc8cV3QemSBTXwkG8gSQSK6UKvXcE/DcleU3+A59XTUHyCvZ5qGy8xVAg== + dependencies: + caniuse-lite "^1.0.30000963" + electron-to-chromium "^1.3.127" + node-releases "^1.1.17" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-indexof@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" + integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= + +cacache@^11.0.2: + version "11.3.2" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" + integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== + dependencies: + bluebird "^3.5.3" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.3" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camel-case@3.0.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +camelcase@^5.0.0, camelcase@^5.2.0, camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-api@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" + integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== + dependencies: + browserslist "^4.0.0" + caniuse-lite "^1.0.0" + lodash.memoize "^4.1.2" + lodash.uniq "^4.5.0" + +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000939, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000957, caniuse-lite@^1.0.30000963: + version "1.0.30000967" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz#a5039577806fccee80a04aaafb2c0890b1ee2f73" + integrity sha512-rUBIbap+VJfxTzrM4akJ00lkvVb5/n5v3EGXfWzSH5zT8aJmGzjA8HWhJ4U6kCpzxozUSnB+yvAYDRPY6mRpgQ== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +case-sensitive-paths-webpack-plugin@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz#3371ef6365ef9c25fa4b81c16ace0e9c7dc58c3e" + integrity sha512-u5ElzokS8A1pm9vM3/iDgTcI3xqHxuCao94Oz8etI3cf0Tio0p8izkDYbTIn09uP3yUUr6+veaE6IkjnTYS46g== + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +ccount@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386" + integrity sha512-fpZ81yYfzentuieinmGnphk0pLkOTMm6MZdVqwd77ROvhko6iujLNGrHH5E7utq3ygWklwfmwuG+A7P+NpqT6w== + +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d" + integrity sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +chrome-trace-event@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48" + integrity sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A== + dependencies: + tslib "^1.9.0" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +clean-css@4.2.x: + version "4.2.1" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" + integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== + dependencies: + source-map "~0.6.0" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +clone-deep@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-0.2.4.tgz#4e73dd09e9fb971cc38670c5dced9c1896481cc6" + integrity sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY= + dependencies: + for-own "^0.1.3" + is-plain-object "^2.0.1" + kind-of "^3.0.2" + lazy-cache "^1.0.3" + shallow-clone "^0.1.2" + +clone-deep@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" + integrity sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ== + dependencies: + for-own "^1.0.0" + is-plain-object "^2.0.4" + kind-of "^6.0.0" + shallow-clone "^1.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +coa@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/coa/-/coa-2.0.2.tgz#43f6c21151b4ef2bf57187db0d73de229e3e7ec3" + integrity sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA== + dependencies: + "@types/q" "^1.5.1" + chalk "^2.4.1" + q "^1.1.2" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0, color-convert@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-string@^1.5.2: + version "1.5.3" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.3.tgz#c9bbc5f01b58b5492f3d6857459cb6590ce204cc" + integrity sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw== + dependencies: + color-name "^1.0.0" + simple-swizzle "^0.2.2" + +color@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/color/-/color-3.1.1.tgz#7abf5c0d38e89378284e873c207ae2172dcc8a61" + integrity sha512-PvUltIXRjehRKPSy89VnDWFKY58xyhTLyxIg21vwQBI6qLwZNPmC8k3C1uytIgFKEpOIzN4y32iPm8231zFHIg== + dependencies: + color-convert "^1.9.1" + color-string "^1.5.2" + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +comma-separated-tokens@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.6.tgz#3cd3d8adc725ab473843db338bcdfd4a7bb087bf" + integrity sha512-f20oA7jsrrmERTS70r3tmRSxR8IJV2MTN7qe6hzgX+3ARfXrdMJFvGWvWQK0xpcBurg9j9eO2MiqzZ8Y+/UPCA== + +commander@2.17.x: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== + +commander@^2.11.0, commander@^2.19.0, commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commander@~2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +common-tags@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" + integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +compressible@~2.0.16: + version "2.0.17" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.17.tgz#6e8c108a16ad58384a977f3a482ca20bff2f38c1" + integrity sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw== + dependencies: + mime-db ">= 1.40.0 < 2" + +compression@^1.5.2: + version "1.7.4" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== + dependencies: + accepts "~1.3.5" + bytes "3.0.0" + compressible "~2.0.16" + debug "2.6.9" + on-headers "~1.0.2" + safe-buffer "5.1.2" + vary "~1.1.2" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.5.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +confusing-browser-globals@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.7.tgz#5ae852bd541a910e7ffb2dbb864a2d21a36ad29b" + integrity sha512-cgHI1azax5ATrZ8rJ+ODDML9Fvu67PimB6aNxBrc/QwSaDaM9eTfIEUHx3bBLJJ82ioSb+/5zfsMCCEJax3ByQ== + +connect-history-api-fallback@^1.3.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + +content-disposition@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +convert-source-map@^1.1.0, convert-source-map@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js-compat@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0" + integrity sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g== + dependencies: + browserslist "^4.5.4" + core-js "3.0.1" + core-js-pure "3.0.1" + semver "^6.0.0" + +core-js-pure@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.0.1.tgz#37358fb0d024e6b86d443d794f4e37e949098cbe" + integrity sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g== + +core-js@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738" + integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew== + +core-js@^2.4.0: + version "2.6.5" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" + integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cosmiconfig@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" + integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + require-from-string "^2.0.1" + +cosmiconfig@^5.0.0, cosmiconfig@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.0.tgz#45038e4d28a7fe787203aede9c25bca4a08b12c8" + integrity sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.0" + parse-json "^4.0.0" + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +css-blank-pseudo@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" + integrity sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w== + dependencies: + postcss "^7.0.5" + +css-color-names@0.0.4, css-color-names@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" + integrity sha1-gIrcLnnPhHOAabZGyyDsJ762KeA= + +css-declaration-sorter@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz#c198940f63a76d7e36c1e71018b001721054cb22" + integrity sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA== + dependencies: + postcss "^7.0.1" + timsort "^0.3.0" + +css-has-pseudo@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz#3c642ab34ca242c59c41a125df9105841f6966ee" + integrity sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ== + dependencies: + postcss "^7.0.6" + postcss-selector-parser "^5.0.0-rc.4" + +css-loader@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-2.1.1.tgz#d8254f72e412bb2238bb44dd674ffbef497333ea" + integrity sha512-OcKJU/lt232vl1P9EEDamhoO9iKY3tIjY5GU+XDLblAykTdgs6Ux9P1hTHve8nFKy5KPpOXOsVI/hIwi3841+w== + dependencies: + camelcase "^5.2.0" + icss-utils "^4.1.0" + loader-utils "^1.2.3" + normalize-path "^3.0.0" + postcss "^7.0.14" + postcss-modules-extract-imports "^2.0.0" + postcss-modules-local-by-default "^2.0.6" + postcss-modules-scope "^2.1.0" + postcss-modules-values "^2.0.0" + postcss-value-parser "^3.3.0" + schema-utils "^1.0.0" + +css-prefers-color-scheme@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" + integrity sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg== + dependencies: + postcss "^7.0.5" + +css-select-base-adapter@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7" + integrity sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w== + +css-select@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-select@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.0.2.tgz#ab4386cec9e1f668855564b17c3733b43b2a5ede" + integrity sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ== + dependencies: + boolbase "^1.0.0" + css-what "^2.1.2" + domutils "^1.7.0" + nth-check "^1.0.2" + +css-tree@1.0.0-alpha.28: + version "1.0.0-alpha.28" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.28.tgz#8e8968190d886c9477bc8d61e96f61af3f7ffa7f" + integrity sha512-joNNW1gCp3qFFzj4St6zk+Wh/NBv0vM5YbEreZk0SD4S23S+1xBKb6cLDg2uj4P4k/GUMlIm6cKIDqIG+vdt0w== + dependencies: + mdn-data "~1.1.0" + source-map "^0.5.3" + +css-tree@1.0.0-alpha.29: + version "1.0.0-alpha.29" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39" + integrity sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg== + dependencies: + mdn-data "~1.1.0" + source-map "^0.5.3" + +css-unit-converter@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996" + integrity sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY= + +css-url-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/css-url-regex/-/css-url-regex-1.1.0.tgz#83834230cc9f74c457de59eebd1543feeb83b7ec" + integrity sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w= + +css-what@2.1, css-what@^2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" + integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== + +cssdb@^4.3.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-4.4.0.tgz#3bf2f2a68c10f5c6a08abd92378331ee803cddb0" + integrity sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ== + +cssesc@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" + integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + +cssnano-preset-default@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz#51ec662ccfca0f88b396dcd9679cdb931be17f76" + integrity sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA== + dependencies: + css-declaration-sorter "^4.0.1" + cssnano-util-raw-cache "^4.0.1" + postcss "^7.0.0" + postcss-calc "^7.0.1" + postcss-colormin "^4.0.3" + postcss-convert-values "^4.0.1" + postcss-discard-comments "^4.0.2" + postcss-discard-duplicates "^4.0.2" + postcss-discard-empty "^4.0.1" + postcss-discard-overridden "^4.0.1" + postcss-merge-longhand "^4.0.11" + postcss-merge-rules "^4.0.3" + postcss-minify-font-values "^4.0.2" + postcss-minify-gradients "^4.0.2" + postcss-minify-params "^4.0.2" + postcss-minify-selectors "^4.0.2" + postcss-normalize-charset "^4.0.1" + postcss-normalize-display-values "^4.0.2" + postcss-normalize-positions "^4.0.2" + postcss-normalize-repeat-style "^4.0.2" + postcss-normalize-string "^4.0.2" + postcss-normalize-timing-functions "^4.0.2" + postcss-normalize-unicode "^4.0.1" + postcss-normalize-url "^4.0.1" + postcss-normalize-whitespace "^4.0.2" + postcss-ordered-values "^4.1.2" + postcss-reduce-initial "^4.0.3" + postcss-reduce-transforms "^4.0.2" + postcss-svgo "^4.0.2" + postcss-unique-selectors "^4.0.1" + +cssnano-util-get-arguments@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" + integrity sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8= + +cssnano-util-get-match@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz#c0e4ca07f5386bb17ec5e52250b4f5961365156d" + integrity sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0= + +cssnano-util-raw-cache@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz#b26d5fd5f72a11dfe7a7846fb4c67260f96bf282" + integrity sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA== + dependencies: + postcss "^7.0.0" + +cssnano-util-same-parent@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3" + integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q== + +cssnano@^4.1.0: + version "4.1.10" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2" + integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ== + dependencies: + cosmiconfig "^5.0.0" + cssnano-preset-default "^4.0.7" + is-resolvable "^1.0.0" + postcss "^7.0.0" + +csso@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/csso/-/csso-3.5.1.tgz#7b9eb8be61628973c1b261e169d2f024008e758b" + integrity sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg== + dependencies: + css-tree "1.0.0-alpha.29" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0", cssom@^0.3.4: + version "0.3.6" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== + +cssstyle@^1.0.0, cssstyle@^1.1.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" + integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== + dependencies: + cssom "0.3.x" + +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= + +damerau-levenshtein@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" + integrity sha1-AxkcQyy27qFou3fzpV/9zLiXhRQ= + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0, data-urls@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.5, debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decamelize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" + integrity sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg== + dependencies: + xregexp "4.0.0" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +default-gateway@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b" + integrity sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA== + dependencies: + execa "^1.0.0" + ip-regex "^2.1.0" + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +del@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" + integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU= + dependencies: + globby "^6.1.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + p-map "^1.1.1" + pify "^3.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +detect-node@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" + integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== + +detect-port-alt@1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" + integrity sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q== + dependencies: + address "^1.0.1" + debug "^2.6.0" + +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dir-glob@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== + dependencies: + arrify "^1.0.1" + path-type "^3.0.0" + +dns-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" + integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= + +dns-packet@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" + integrity sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg== + dependencies: + ip "^1.1.0" + safe-buffer "^5.0.1" + +dns-txt@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" + integrity sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY= + dependencies: + buffer-indexof "^1.0.0" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dom-converter@^0.2: + version "0.2.0" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" + integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== + dependencies: + utila "~0.4" + +dom-serializer@0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1, domutils@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + +dot-prop@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== + dependencies: + is-obj "^1.0.0" + +dotenv-expand@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-4.2.0.tgz#def1f1ca5d6059d24a766e587942c21106ce1275" + integrity sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU= + +dotenv@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" + integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== + +duplexer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +electron-to-chromium@^1.3.122, electron-to-chromium@^1.3.127: + version "1.3.133" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.133.tgz#c47639c19b91feee3e22fad69f5556142007008c" + integrity sha512-lyoC8aoqbbDqsprb6aPdt9n3DpOZZzdz/T4IZKsR0/dkZIxnJVUjjcpOSwA66jPRIOyDAamCTAUqweU05kKNSg== + +elliptic@^6.0.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +entities@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escodegen@^1.11.0, escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-config-react-app@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-4.0.1.tgz#23fd0fd7ea89442ef1e733f66a7207674b23c8db" + integrity sha512-ZsaoXUIGsK8FCi/x4lT2bZR5mMkL/Kgj+Lnw690rbvvUr/uiwgFiD8FcfAhkCycm7Xte6O5lYz4EqMx2vX7jgw== + dependencies: + confusing-browser-globals "^1.0.7" + +eslint-import-resolver-node@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-loader@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-2.1.2.tgz#453542a1230d6ffac90e4e7cb9cadba9d851be68" + integrity sha512-rA9XiXEOilLYPOIInvVH5S/hYfyTPyxag6DZhoQOduM+3TkghAEQ3VcFO8VnX4J4qg/UIBzp72aOf/xvYmpmsg== + dependencies: + loader-fs-cache "^1.0.0" + loader-utils "^1.0.2" + object-assign "^4.0.1" + object-hash "^1.1.4" + rimraf "^2.6.1" + +eslint-module-utils@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" + integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== + dependencies: + debug "^2.6.8" + pkg-dir "^2.0.0" + +eslint-plugin-flowtype@2.50.1: + version "2.50.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.1.tgz#36d4c961ac8b9e9e1dc091d3fba0537dad34ae8a" + integrity sha512-9kRxF9hfM/O6WGZcZPszOVPd2W0TLHBtceulLTsGfwMPtiCCLnCW0ssRiOOiXyqrCA20pm1iXdXm7gQeN306zQ== + dependencies: + lodash "^4.17.10" + +eslint-plugin-import@2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" + integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== + dependencies: + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.3.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" + read-pkg-up "^2.0.0" + resolve "^1.9.0" + +eslint-plugin-jsx-a11y@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" + integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== + dependencies: + aria-query "^3.0.0" + array-includes "^3.0.3" + ast-types-flow "^0.0.7" + axobject-query "^2.0.2" + damerau-levenshtein "^1.0.4" + emoji-regex "^7.0.2" + has "^1.0.3" + jsx-ast-utils "^2.0.1" + +eslint-plugin-react-hooks@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f" + integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag== + +eslint-plugin-react@7.12.4: + version "7.12.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" + integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== + dependencies: + array-includes "^3.0.3" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.0.1" + object.fromentries "^2.0.0" + prop-types "^15.6.2" + resolve "^1.9.0" + +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-scope@^4.0.0, eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.0, esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +eventemitter3@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + +events@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== + +eventsource@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" + integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== + dependencies: + original "^1.0.0" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== + dependencies: + "@jest/types" "^24.8.0" + ansi-styles "^3.2.0" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + +express@^4.16.2: + version "4.16.4" + resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" + integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== + dependencies: + accepts "~1.3.5" + array-flatten "1.1.1" + body-parser "1.18.3" + content-disposition "0.5.2" + content-type "~1.0.4" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.1.1" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.2" + path-to-regexp "0.1.7" + proxy-addr "~2.0.4" + qs "6.5.2" + range-parser "~1.2.0" + safe-buffer "5.1.2" + send "0.16.2" + serve-static "1.13.2" + setprototypeof "1.1.0" + statuses "~1.4.0" + type-is "~1.6.16" + utils-merge "1.0.1" + vary "~1.1.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0, extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-glob@^2.0.2: + version "2.2.6" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.6.tgz#a5d5b697ec8deda468d85a74035290a025a95295" + integrity sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w== + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.1.2" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.3" + micromatch "^3.1.10" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +faye-websocket@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + integrity sha1-TkkvjQTftviQA1B/btvy1QHnxvQ= + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.1.tgz#f0efe18c4f56e4f40afc7e06c719fd5ee6188f38" + integrity sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg= + dependencies: + websocket-driver ">=0.5.1" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + +figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +file-loader@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-3.0.1.tgz#f8e0ba0b599918b51adfe45d66d1e771ad560faa" + integrity sha512-4sNIOXgtH/9WZq4NvlfU3Opn5ynUsqBwSLyM+I7UOwdGigTBYfVVQEwe/msZNX/j4pCJTIM14Fsw66Svo1oVrw== + dependencies: + loader-utils "^1.0.2" + schema-utils "^1.0.0" + +filesize@3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" + integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" + integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.2" + statuses "~1.4.0" + unpipe "~1.0.0" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + integrity sha1-yN765XyKUqinhPnjHFfHQumToLk= + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-cache-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== + dependencies: + commondir "^1.0.1" + make-dir "^2.0.0" + pkg-dir "^3.0.0" + +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" + integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + +flatten@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" + integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= + +flush-write-stream@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +follow-redirects@^1.0.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76" + integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ== + dependencies: + debug "^3.2.6" + +for-in@^0.1.3: + version "0.1.8" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" + integrity sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE= + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +fork-ts-checker-webpack-plugin@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.1.1.tgz#caf2a210778fb1e171b6993ca0a40f9b6589e3b7" + integrity sha512-gqWAEMLlae/oeVnN6RWCAhesOJMswAN1MaKNqhhjXHV5O0/rTUjWI4UbgQHdlrVbCnb+xLotXmJbBlC66QmpFw== + dependencies: + babel-code-frame "^6.22.0" + chalk "^2.4.1" + chokidar "^2.0.4" + micromatch "^3.1.10" + minimatch "^3.0.4" + semver "^5.6.0" + tapable "^1.0.0" + worker-rpc "^0.1.0" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-extra@7.0.1, fs-extra@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.6.tgz#87b19df0bfb4a1a51d7ddb51b01b5f3bedb40c33" + integrity sha512-vfmKZp3XPM36DNF0qhW+Cdxk7xm7gTEHY1clv1Xq1arwRQuKZgAhw+NZNWbJBtuaNxzNXwhfdPYRrvIbjfS33A== + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= + +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + +globals@^11.1.0, globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globby@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" + integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== + dependencies: + array-union "^1.0.1" + dir-glob "2.0.0" + fast-glob "^2.0.2" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +gzip-size@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.0.0.tgz#a55ecd99222f4c48fd8c01c625ce3b349d0a0e80" + integrity sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA== + dependencies: + duplexer "^0.1.1" + pify "^3.0.0" + +handle-thing@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" + integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ== + +handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +harmony-reflect@^1.4.6: + version "1.6.1" + resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9" + integrity sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.0, has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hast-util-from-parse5@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-5.0.0.tgz#a505a05766e0f96e389bfb0b1dd809eeefcef47b" + integrity sha512-A7ev5OseS/J15214cvDdcI62uwovJO2PB60Xhnq7kaxvvQRFDEccuqbkrFXU03GPBGopdPqlpQBRqIcDS/Fjbg== + dependencies: + ccount "^1.0.3" + hastscript "^5.0.0" + property-information "^5.0.0" + web-namespaces "^1.1.2" + xtend "^4.0.1" + +hast-util-parse-selector@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.1.tgz#4ddbae1ae12c124e3eb91b581d2556441766f0ab" + integrity sha512-Xyh0v+nHmQvrOqop2Jqd8gOdyQtE8sIP9IQf7mlVDqp924W4w/8Liuguk2L2qei9hARnQSG2m+wAOCxM7npJVw== + +hastscript@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.0.0.tgz#fee10382c1bc4ba3f1be311521d368c047d2c43a" + integrity sha512-xJtuJ8D42Xtq5yJrnDg/KAIxl2cXBXKoiIJwmWX9XMf8113qHTGl/Bf7jEsxmENJ4w6q4Tfl8s/Y6mEZo8x8qw== + dependencies: + comma-separated-tokens "^1.0.0" + hast-util-parse-selector "^2.2.0" + property-information "^5.0.1" + space-separated-tokens "^1.0.0" + +he@1.2.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hex-color-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" + integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +hsl-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" + integrity sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4= + +hsla-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" + integrity sha1-wc56MWjIxmFAM6S194d/OyJfnDg= + +html-comment-regex@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" + integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +html-entities@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" + integrity sha1-DfKTUfByEWNRXfueVUPl9u7VFi8= + +html-minifier@^3.5.20: + version "3.5.21" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" + integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== + dependencies: + camel-case "3.0.x" + clean-css "4.2.x" + commander "2.17.x" + he "1.2.x" + param-case "2.1.x" + relateurl "0.2.x" + uglify-js "3.4.x" + +html-webpack-plugin@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513" + integrity sha512-y5l4lGxOW3pz3xBTFdfB9rnnrWRPVxlAhX6nrBYIcW+2k2zC3mSp/3DxlWVCMBfnO6UAnoF8OcFn0IMy6kaKAQ== + dependencies: + html-minifier "^3.5.20" + loader-utils "^1.1.0" + lodash "^4.17.11" + pretty-error "^2.1.1" + tapable "^1.1.0" + util.promisify "1.0.0" + +htmlparser2@^3.3.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + +http-deceiver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= + +http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-parser-js@>=0.4.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.0.tgz#d65edbede84349d0dc30320815a15d39cc3cbbd8" + integrity sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w== + +http-proxy-middleware@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a" + integrity sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q== + dependencies: + http-proxy "^1.17.0" + is-glob "^4.0.0" + lodash "^4.17.11" + micromatch "^3.1.10" + +http-proxy@^1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + +iconv-lite@0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +icss-replace-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" + integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= + +icss-utils@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.0.tgz#339dbbffb9f8729a243b701e1c29d4cc58c52f0e" + integrity sha512-3DEun4VOeMvSczifM3F2cKQrDQ5Pj6WKhkOq6HD4QTnDUAq8MQRxy5TX6Sy1iY6WPBe4gQ3p5vTECjbIkglkkQ== + dependencies: + postcss "^7.0.14" + +identity-obj-proxy@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" + integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ= + dependencies: + harmony-reflect "^1.4.6" + +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +ignore@^3.3.5: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +immer@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" + integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg== + +import-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" + integrity sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk= + dependencies: + import-from "^2.1.0" + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-from@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" + integrity sha1-M1238qev/VOqpHHUuAId7ja387E= + dependencies: + resolve-from "^3.0.0" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +ini@^1.3.5, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +inquirer@6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + +inquirer@^6.2.2: + version "6.3.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" + integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +internal-ip@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" + integrity sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg== + dependencies: + default-gateway "^4.2.0" + ipaddr.js "^1.9.0" + +invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= + +ip@^1.1.0, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= + +ipaddr.js@1.9.0, ipaddr.js@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" + integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== + +is-absolute-url@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" + integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-arrayish@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.0.2, is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-buffer@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== + +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-color-stop@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" + integrity sha1-z/9HGu5N1cnhWFmPvhKWe1za00U= + dependencies: + css-color-names "^0.0.4" + hex-color-regex "^1.1.0" + hsl-regex "^1.0.0" + hsla-regex "^1.0.0" + rgb-regex "^1.0.1" + rgba-regex "^1.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-obj@^1.0.0, is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + +is-root@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.0.0.tgz#838d1e82318144e5a6f77819d90207645acc7019" + integrity sha512-F/pJIk8QD6OX5DNhRB7hWamLsUilmkDGho48KbgZ6xg/lmAZXHxzXQ91jzB3yRSw5kdQGGGc4yz8HYhTYIMWPg== + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-svg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" + integrity sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ== + dependencies: + html-comment-regex "^1.1.0" + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.1.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.4.tgz#4e0d0ddf0f0ad5b49a314069d31b4f06afe49ad3" + integrity sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w== + dependencies: + handlebars "^4.1.2" + +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== + dependencies: + "@jest/types" "^24.8.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.7.1: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== + dependencies: + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^12.0.2" + +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + micromatch "^3.1.10" + pretty-format "^24.8.0" + realpath-native "^1.1.0" + +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.3.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== + dependencies: + "@jest/types" "^24.8.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom-fourteen@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom-fourteen/-/jest-environment-jsdom-fourteen-0.1.0.tgz#aad6393a9d4b565b69a609109bf469f62bf18ccc" + integrity sha512-4vtoRMg7jAstitRzL4nbw83VmGH8Rs13wrND3Ud2o1fczDhMUF32iIrNKwYGgeOPUdfvZU4oy8Bbv+ni1fgVCA== + dependencies: + jest-mock "^24.5.0" + jest-util "^24.5.0" + jsdom "^14.0.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + jsdom "^11.5.1" + +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== + +jest-haste-map@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" + integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== + dependencies: + "@jest/types" "^24.8.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.4.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.8.0" + is-generator-fn "^2.0.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + throat "^4.0.0" + +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== + dependencies: + pretty-format "^24.8.0" + +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== + dependencies: + chalk "^2.0.1" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.5.0, jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== + dependencies: + "@jest/types" "^24.8.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== + +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== + dependencies: + "@jest/types" "^24.8.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.8.0" + +jest-resolve@24.7.1: + version "24.7.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.7.1.tgz#e4150198299298380a75a9fd55043fa3b9b17fde" + integrity sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw== + dependencies: + "@jest/types" "^24.7.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== + dependencies: + "@jest/types" "^24.8.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.2" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^12.0.2" + +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== + +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.8.0" + semver "^5.5.0" + +jest-util@^24.5.0, jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/fake-timers" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== + dependencies: + "@jest/types" "^24.8.0" + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + leven "^2.1.0" + pretty-format "^24.8.0" + +jest-watch-typeahead@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-0.3.0.tgz#f56d9ee17ea71ecbf8253fed213df3185a1584c9" + integrity sha512-+uOtlppt9ysST6k6ZTqsPI0WNz2HLa8bowiZylZoQCQaAVn7XsVmHhZREkz73FhKelrFrpne4hQQjdq42nFEmA== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.4.1" + jest-watcher "^24.3.0" + slash "^2.0.0" + string-length "^2.0.0" + strip-ansi "^5.0.0" + +jest-watcher@^24.3.0, jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== + dependencies: + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.9" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.8.0" + string-length "^2.0.0" + +jest-worker@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + +jest@24.7.1: + version "24.7.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.7.1.tgz#0d94331cf510c75893ee32f87d7321d5bf8f2501" + integrity sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA== + dependencies: + import-local "^2.0.0" + jest-cli "^24.7.1" + +js-levenshtein@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.9.0: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsdom@^14.0.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-14.1.0.tgz#916463b6094956b0a6c1782c94e380cd30e1981b" + integrity sha512-O901mfJSuTdwU2w3Sn+74T+RnDVP+FuV5fH8tcPWyqrseRAb0s5xOtPgCFiPOtLcyK7CLIJwPyD83ZqQWvA5ng== + dependencies: + abab "^2.0.0" + acorn "^6.0.4" + acorn-globals "^4.3.0" + array-equal "^1.0.0" + cssom "^0.3.4" + cssstyle "^1.1.1" + data-urls "^1.1.0" + domexception "^1.0.1" + escodegen "^1.11.0" + html-encoding-sniffer "^1.0.2" + nwsapi "^2.1.3" + parse5 "5.1.0" + pn "^1.1.0" + request "^2.88.0" + request-promise-native "^1.0.5" + saxes "^3.1.9" + symbol-tree "^3.2.2" + tough-cookie "^2.5.0" + w3c-hr-time "^1.0.1" + w3c-xmlserializer "^1.1.2" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.5" + whatwg-mimetype "^2.3.0" + whatwg-url "^7.0.0" + ws "^6.1.2" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + +json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json3@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +jsx-ast-utils@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz#0ee4e2c971fb9601c67b5641b71be80faecf0b36" + integrity sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA== + dependencies: + array-includes "^3.0.3" + +killable@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" + integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== + +kind-of@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-2.0.1.tgz#018ec7a4ce7e3a86cb9141be519d24c8faa981b5" + integrity sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU= + dependencies: + is-buffer "^1.0.2" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +last-call-webpack-plugin@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz#9742df0e10e3cf46e5c0381c2de90d3a7a2d7555" + integrity sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w== + dependencies: + lodash "^4.17.5" + webpack-sources "^1.1.0" + +lazy-cache@^0.2.3: + version "0.2.7" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65" + integrity sha1-f+3fLctu23fRHvHRF6tf/fCrG2U= + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +loader-fs-cache@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.2.tgz#54cedf6b727e1779fd8f01205f05f6e88706f086" + integrity sha512-70IzT/0/L+M20jUlEqZhZyArTU6VKLRTYRDAYN26g4jfzpJqjipLL3/hgYpySqI9PwsVRHHFja0LfEmsx9X2Cw== + dependencies: + find-cache-dir "^0.1.1" + mkdirp "0.5.1" + +loader-runner@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== + +loader-utils@1.2.3, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= + +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash.tail@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" + integrity sha1-0jM6NtnncXyK0vfKyv7HwytERmQ= + +lodash.template@^4.2.4, lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + dependencies: + lodash._reinterpolate "~3.0.0" + +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + +lodash.uniq@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= + +"lodash@>=3.5 <5", lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +loglevel@^1.4.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" + integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po= + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lower-case@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +make-dir@^2.0.0, make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +mamacro@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" + integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mdn-data@~1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" + integrity sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA== + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +merge-deep@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/merge-deep/-/merge-deep-3.0.2.tgz#f39fa100a4f1bd34ff29f7d2bf4508fbb8d83ad2" + integrity sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA== + dependencies: + arr-union "^3.1.0" + clone-deep "^0.2.4" + kind-of "^3.0.2" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + +microevent.ts@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" + integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== + +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.40.0, "mime-db@>= 1.40.0 < 2": + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== + +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + dependencies: + mime-db "1.40.0" + +mime@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== + +mime@^2.0.3, mime@^2.3.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78" + integrity sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mini-css-extract-plugin@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.5.0.tgz#ac0059b02b9692515a637115b0cc9fed3a35c7b0" + integrity sha512-IuaLjruM0vMKhUUT51fQdQzBYTX49dLj8w68ALEAe2A4iYNpIC4eMac67mt3NzycvjOlf07/kYxJDc0RTl1Wqw== + dependencies: + loader-utils "^1.1.0" + schema-utils "^1.0.0" + webpack-sources "^1.1.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mixin-object@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" + integrity sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4= + dependencies: + for-in "^0.1.3" + is-extendable "^0.1.1" + +mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +multicast-dns-service-types@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" + integrity sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE= + +multicast-dns@^6.0.1: + version "6.2.3" + resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229" + integrity sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g== + dependencies: + dns-packet "^1.3.1" + thunky "^1.0.2" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +nan@^2.12.1: + version "2.13.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" + integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +needle@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388" + integrity sha512-CaLXV3W8Vnbps8ZANqDGz7j4x7Yj1LW4TWF/TQuDfj7Cfx4nAPTvw98qgTevtto1oHDrh3pQkaODbqupXlsWTg== + dependencies: + debug "^4.1.0" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +neo-async@^2.5.0, neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +no-case@^2.2.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== + dependencies: + lower-case "^1.1.1" + +node-forge@0.7.5: + version "0.7.5" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" + integrity sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-libs-browser@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.0.tgz#c72f60d9d46de08a940dedbb25f3ffa2f9bbaa77" + integrity sha512-5MQunG/oyOaBdttrL40dA7bUfPORLRWMUJLQtMg7nluxUvk5XwnLdL9twQHFAjRx/y7mIMkLKT9++qPbbk6BZA== + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^3.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.0" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.11.0" + vm-browserify "0.0.4" + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^5.2.1: + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +node-releases@^1.1.13, node-releases@^1.1.17: + version "1.1.18" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.18.tgz#cc98fd75598a324a77188ebddf6650e9cbd8b1d5" + integrity sha512-/mnVgm6u/8OwlIsoyRXtTI0RfQcxZoAZbdwyXap0EeWwcOpDDymyCHM2/aR9XKmHXrvizHoPAOs0pcbiJ6RUaA== + dependencies: + semver "^5.3.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= + +normalize-url@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +nth-check@^1.0.2, nth-check@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== + dependencies: + boolbase "~1.0.0" + +num2fraction@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" + integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nwsapi@^2.0.7, nwsapi@^2.1.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" + integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-hash@^1.1.4: + version "1.3.1" + resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" + integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== + +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.fromentries@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" + integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.11.0" + function-bind "^1.1.1" + has "^1.0.1" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +obuf@^1.0.0, obuf@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +opn@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" + integrity sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw== + dependencies: + is-wsl "^1.1.0" + +opn@^5.1.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" + integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== + dependencies: + is-wsl "^1.1.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optimize-css-assets-webpack-plugin@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.1.tgz#9eb500711d35165b45e7fd60ba2df40cb3eb9159" + integrity sha512-Rqm6sSjWtx9FchdP0uzTQDc7GXDKnwVEGoSxjezPkzMewx7gEWE9IMUYKmigTRC4U3RaNSwYVnUDLuIdtTpm0A== + dependencies: + cssnano "^4.1.0" + last-call-webpack-plugin "^3.0.0" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +original@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" + integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== + dependencies: + url-parse "^1.4.3" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +pako@~1.0.5: + version "1.0.10" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +param-case@2.1.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= + dependencies: + no-case "^2.2.0" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-asn1@^5.0.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + +parse5@5.1.0, parse5@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" + integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== + +parseurl@~1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= + dependencies: + find-up "^1.0.0" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +pkg-up@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" + integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + dependencies: + find-up "^2.1.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +pnp-webpack-plugin@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.2.1.tgz#cd9d698df2a6fcf7255093c1c9511adf65b9421b" + integrity sha512-W6GctK7K2qQiVR+gYSv/Gyt6jwwIH4vwdviFqx+Y2jAtVf5eZyYIDf5Ac2NCDMBiX5yWscBLZElPTsyA1UtVVA== + dependencies: + ts-pnp "^1.0.0" + +portfinder@^1.0.9: + version "1.0.20" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.20.tgz#bea68632e54b2e13ab7b0c4775e9b41bf270e44a" + integrity sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw== + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +postcss-attribute-case-insensitive@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz#b2a721a0d279c2f9103a36331c88981526428cc7" + integrity sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A== + dependencies: + postcss "^7.0.2" + postcss-selector-parser "^5.0.0" + +postcss-browser-comments@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-browser-comments/-/postcss-browser-comments-2.0.0.tgz#dc48d6a8ddbff188a80a000b7393436cb18aed88" + integrity sha512-xGG0UvoxwBc4Yx4JX3gc0RuDl1kc4bVihCzzk6UC72YPfq5fu3c717Nu8Un3nvnq1BJ31gBnFXIG/OaUTnpHgA== + dependencies: + postcss "^7.0.2" + +postcss-calc@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.1.tgz#36d77bab023b0ecbb9789d84dcb23c4941145436" + integrity sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ== + dependencies: + css-unit-converter "^1.1.1" + postcss "^7.0.5" + postcss-selector-parser "^5.0.0-rc.4" + postcss-value-parser "^3.3.1" + +postcss-color-functional-notation@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz#5efd37a88fbabeb00a2966d1e53d98ced93f74e0" + integrity sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g== + dependencies: + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-color-gray@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz#532a31eb909f8da898ceffe296fdc1f864be8547" + integrity sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw== + dependencies: + "@csstools/convert-colors" "^1.4.0" + postcss "^7.0.5" + postcss-values-parser "^2.0.0" + +postcss-color-hex-alpha@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz#a8d9ca4c39d497c9661e374b9c51899ef0f87388" + integrity sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw== + dependencies: + postcss "^7.0.14" + postcss-values-parser "^2.0.1" + +postcss-color-mod-function@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz#816ba145ac11cc3cb6baa905a75a49f903e4d31d" + integrity sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ== + dependencies: + "@csstools/convert-colors" "^1.4.0" + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-color-rebeccapurple@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz#c7a89be872bb74e45b1e3022bfe5748823e6de77" + integrity sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g== + dependencies: + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-colormin@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-4.0.3.tgz#ae060bce93ed794ac71264f08132d550956bd381" + integrity sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw== + dependencies: + browserslist "^4.0.0" + color "^3.0.0" + has "^1.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-convert-values@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz#ca3813ed4da0f812f9d43703584e449ebe189a7f" + integrity sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ== + dependencies: + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-custom-media@^7.0.7: + version "7.0.8" + resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz#fffd13ffeffad73621be5f387076a28b00294e0c" + integrity sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg== + dependencies: + postcss "^7.0.14" + +postcss-custom-properties@^8.0.9: + version "8.0.10" + resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-8.0.10.tgz#e8dc969e1e15c555f0b836b7f278ef47e3cdeaff" + integrity sha512-GDL0dyd7++goDR4SSasYdRNNvp4Gqy1XMzcCnTijiph7VB27XXpJ8bW/AI0i2VSBZ55TpdGhMr37kMSpRfYD0Q== + dependencies: + postcss "^7.0.14" + postcss-values-parser "^2.0.1" + +postcss-custom-selectors@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz#64858c6eb2ecff2fb41d0b28c9dd7b3db4de7fba" + integrity sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w== + dependencies: + postcss "^7.0.2" + postcss-selector-parser "^5.0.0-rc.3" + +postcss-dir-pseudo-class@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2" + integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw== + dependencies: + postcss "^7.0.2" + postcss-selector-parser "^5.0.0-rc.3" + +postcss-discard-comments@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz#1fbabd2c246bff6aaad7997b2b0918f4d7af4033" + integrity sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg== + dependencies: + postcss "^7.0.0" + +postcss-discard-duplicates@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz#3fe133cd3c82282e550fc9b239176a9207b784eb" + integrity sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ== + dependencies: + postcss "^7.0.0" + +postcss-discard-empty@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz#c8c951e9f73ed9428019458444a02ad90bb9f765" + integrity sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w== + dependencies: + postcss "^7.0.0" + +postcss-discard-overridden@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz#652aef8a96726f029f5e3e00146ee7a4e755ff57" + integrity sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg== + dependencies: + postcss "^7.0.0" + +postcss-double-position-gradients@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz#fc927d52fddc896cb3a2812ebc5df147e110522e" + integrity sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA== + dependencies: + postcss "^7.0.5" + postcss-values-parser "^2.0.0" + +postcss-env-function@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-2.0.2.tgz#0f3e3d3c57f094a92c2baf4b6241f0b0da5365d7" + integrity sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw== + dependencies: + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-flexbugs-fixes@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz#e094a9df1783e2200b7b19f875dcad3b3aff8b20" + integrity sha512-jr1LHxQvStNNAHlgco6PzY308zvLklh7SJVYuWUwyUQncofaAlD2l+P/gxKHOdqWKe7xJSkVLFF/2Tp+JqMSZA== + dependencies: + postcss "^7.0.0" + +postcss-focus-visible@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz#477d107113ade6024b14128317ade2bd1e17046e" + integrity sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g== + dependencies: + postcss "^7.0.2" + +postcss-focus-within@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz#763b8788596cee9b874c999201cdde80659ef680" + integrity sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w== + dependencies: + postcss "^7.0.2" + +postcss-font-variant@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-4.0.0.tgz#71dd3c6c10a0d846c5eda07803439617bbbabacc" + integrity sha512-M8BFYKOvCrI2aITzDad7kWuXXTm0YhGdP9Q8HanmN4EF1Hmcgs1KK5rSHylt/lUJe8yLxiSwWAHdScoEiIxztg== + dependencies: + postcss "^7.0.2" + +postcss-gap-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz#431c192ab3ed96a3c3d09f2ff615960f902c1715" + integrity sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg== + dependencies: + postcss "^7.0.2" + +postcss-image-set-function@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz#28920a2f29945bed4c3198d7df6496d410d3f288" + integrity sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw== + dependencies: + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-initial@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-3.0.0.tgz#1772512faf11421b791fb2ca6879df5f68aa0517" + integrity sha512-WzrqZ5nG9R9fUtrA+we92R4jhVvEB32IIRTzfIG/PLL8UV4CvbF1ugTEHEFX6vWxl41Xt5RTCJPEZkuWzrOM+Q== + dependencies: + lodash.template "^4.2.4" + postcss "^7.0.2" + +postcss-lab-function@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz#bb51a6856cd12289ab4ae20db1e3821ef13d7d2e" + integrity sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg== + dependencies: + "@csstools/convert-colors" "^1.4.0" + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-load-config@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484" + integrity sha512-V5JBLzw406BB8UIfsAWSK2KSwIJ5yoEIVFb4gVkXci0QdKgA24jLmHZ/ghe/GgX0lJ0/D1uUK1ejhzEY94MChQ== + dependencies: + cosmiconfig "^4.0.0" + import-cwd "^2.0.0" + +postcss-loader@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d" + integrity sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA== + dependencies: + loader-utils "^1.1.0" + postcss "^7.0.0" + postcss-load-config "^2.0.0" + schema-utils "^1.0.0" + +postcss-logical@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5" + integrity sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA== + dependencies: + postcss "^7.0.2" + +postcss-media-minmax@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz#b75bb6cbc217c8ac49433e12f22048814a4f5ed5" + integrity sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw== + dependencies: + postcss "^7.0.2" + +postcss-merge-longhand@^4.0.11: + version "4.0.11" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz#62f49a13e4a0ee04e7b98f42bb16062ca2549e24" + integrity sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw== + dependencies: + css-color-names "0.0.4" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + stylehacks "^4.0.0" + +postcss-merge-rules@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz#362bea4ff5a1f98e4075a713c6cb25aefef9a650" + integrity sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ== + dependencies: + browserslist "^4.0.0" + caniuse-api "^3.0.0" + cssnano-util-same-parent "^4.0.0" + postcss "^7.0.0" + postcss-selector-parser "^3.0.0" + vendors "^1.0.0" + +postcss-minify-font-values@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz#cd4c344cce474343fac5d82206ab2cbcb8afd5a6" + integrity sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg== + dependencies: + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-minify-gradients@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz#93b29c2ff5099c535eecda56c4aa6e665a663471" + integrity sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q== + dependencies: + cssnano-util-get-arguments "^4.0.0" + is-color-stop "^1.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-minify-params@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz#6b9cef030c11e35261f95f618c90036d680db874" + integrity sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg== + dependencies: + alphanum-sort "^1.0.0" + browserslist "^4.0.0" + cssnano-util-get-arguments "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + uniqs "^2.0.0" + +postcss-minify-selectors@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz#e2e5eb40bfee500d0cd9243500f5f8ea4262fbd8" + integrity sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g== + dependencies: + alphanum-sort "^1.0.0" + has "^1.0.0" + postcss "^7.0.0" + postcss-selector-parser "^3.0.0" + +postcss-modules-extract-imports@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz#818719a1ae1da325f9832446b01136eeb493cd7e" + integrity sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ== + dependencies: + postcss "^7.0.5" + +postcss-modules-local-by-default@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-2.0.6.tgz#dd9953f6dd476b5fd1ef2d8830c8929760b56e63" + integrity sha512-oLUV5YNkeIBa0yQl7EYnxMgy4N6noxmiwZStaEJUSe2xPMcdNc8WmBQuQCx18H5psYbVxz8zoHk0RAAYZXP9gA== + dependencies: + postcss "^7.0.6" + postcss-selector-parser "^6.0.0" + postcss-value-parser "^3.3.1" + +postcss-modules-scope@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.1.0.tgz#ad3f5bf7856114f6fcab901b0502e2a2bc39d4eb" + integrity sha512-91Rjps0JnmtUB0cujlc8KIKCsJXWjzuxGeT/+Q2i2HXKZ7nBUeF9YQTZZTNvHVoNYj1AthsjnGLtqDUE0Op79A== + dependencies: + postcss "^7.0.6" + postcss-selector-parser "^6.0.0" + +postcss-modules-values@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-2.0.0.tgz#479b46dc0c5ca3dc7fa5270851836b9ec7152f64" + integrity sha512-Ki7JZa7ff1N3EIMlPnGTZfUMe69FFwiQPnVSXC9mnn3jozCRBYIxiZd44yJOV2AmabOo4qFf8s0dC/+lweG7+w== + dependencies: + icss-replace-symbols "^1.1.0" + postcss "^7.0.6" + +postcss-nesting@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-7.0.0.tgz#6e26a770a0c8fcba33782a6b6f350845e1a448f6" + integrity sha512-WSsbVd5Ampi3Y0nk/SKr5+K34n52PqMqEfswu6RtU4r7wA8vSD+gM8/D9qq4aJkHImwn1+9iEFTbjoWsQeqtaQ== + dependencies: + postcss "^7.0.2" + +postcss-normalize-charset@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4" + integrity sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g== + dependencies: + postcss "^7.0.0" + +postcss-normalize-display-values@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz#0dbe04a4ce9063d4667ed2be476bb830c825935a" + integrity sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ== + dependencies: + cssnano-util-get-match "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-positions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz#05f757f84f260437378368a91f8932d4b102917f" + integrity sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA== + dependencies: + cssnano-util-get-arguments "^4.0.0" + has "^1.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-repeat-style@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz#c4ebbc289f3991a028d44751cbdd11918b17910c" + integrity sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q== + dependencies: + cssnano-util-get-arguments "^4.0.0" + cssnano-util-get-match "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-string@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz#cd44c40ab07a0c7a36dc5e99aace1eca4ec2690c" + integrity sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA== + dependencies: + has "^1.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-timing-functions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz#8e009ca2a3949cdaf8ad23e6b6ab99cb5e7d28d9" + integrity sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A== + dependencies: + cssnano-util-get-match "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-unicode@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz#841bd48fdcf3019ad4baa7493a3d363b52ae1cfb" + integrity sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg== + dependencies: + browserslist "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-url@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz#10e437f86bc7c7e58f7b9652ed878daaa95faae1" + integrity sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA== + dependencies: + is-absolute-url "^2.0.0" + normalize-url "^3.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize-whitespace@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz#bf1d4070fe4fcea87d1348e825d8cc0c5faa7d82" + integrity sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA== + dependencies: + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-normalize@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/postcss-normalize/-/postcss-normalize-7.0.1.tgz#eb51568d962b8aa61a8318383c8bb7e54332282e" + integrity sha512-NOp1fwrG+6kVXWo7P9SizCHX6QvioxFD/hZcI2MLxPmVnFJFC0j0DDpIuNw2tUDeCFMni59gCVgeJ1/hYhj2OQ== + dependencies: + "@csstools/normalize.css" "^9.0.1" + browserslist "^4.1.1" + postcss "^7.0.2" + postcss-browser-comments "^2.0.0" + +postcss-ordered-values@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz#0cf75c820ec7d5c4d280189559e0b571ebac0eee" + integrity sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw== + dependencies: + cssnano-util-get-arguments "^4.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-overflow-shorthand@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz#31ecf350e9c6f6ddc250a78f0c3e111f32dd4c30" + integrity sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g== + dependencies: + postcss "^7.0.2" + +postcss-page-break@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-2.0.0.tgz#add52d0e0a528cabe6afee8b46e2abb277df46bf" + integrity sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ== + dependencies: + postcss "^7.0.2" + +postcss-place@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-4.0.1.tgz#e9f39d33d2dc584e46ee1db45adb77ca9d1dcc62" + integrity sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg== + dependencies: + postcss "^7.0.2" + postcss-values-parser "^2.0.0" + +postcss-preset-env@6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-6.6.0.tgz#642e7d962e2bdc2e355db117c1eb63952690ed5b" + integrity sha512-I3zAiycfqXpPIFD6HXhLfWXIewAWO8emOKz+QSsxaUZb9Dp8HbF5kUf+4Wy/AxR33o+LRoO8blEWCHth0ZsCLA== + dependencies: + autoprefixer "^9.4.9" + browserslist "^4.4.2" + caniuse-lite "^1.0.30000939" + css-blank-pseudo "^0.1.4" + css-has-pseudo "^0.10.0" + css-prefers-color-scheme "^3.1.1" + cssdb "^4.3.0" + postcss "^7.0.14" + postcss-attribute-case-insensitive "^4.0.1" + postcss-color-functional-notation "^2.0.1" + postcss-color-gray "^5.0.0" + postcss-color-hex-alpha "^5.0.2" + postcss-color-mod-function "^3.0.3" + postcss-color-rebeccapurple "^4.0.1" + postcss-custom-media "^7.0.7" + postcss-custom-properties "^8.0.9" + postcss-custom-selectors "^5.1.2" + postcss-dir-pseudo-class "^5.0.0" + postcss-double-position-gradients "^1.0.0" + postcss-env-function "^2.0.2" + postcss-focus-visible "^4.0.0" + postcss-focus-within "^3.0.0" + postcss-font-variant "^4.0.0" + postcss-gap-properties "^2.0.0" + postcss-image-set-function "^3.0.1" + postcss-initial "^3.0.0" + postcss-lab-function "^2.0.1" + postcss-logical "^3.0.0" + postcss-media-minmax "^4.0.0" + postcss-nesting "^7.0.0" + postcss-overflow-shorthand "^2.0.0" + postcss-page-break "^2.0.0" + postcss-place "^4.0.1" + postcss-pseudo-class-any-link "^6.0.0" + postcss-replace-overflow-wrap "^3.0.0" + postcss-selector-matches "^4.0.0" + postcss-selector-not "^4.0.0" + +postcss-pseudo-class-any-link@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1" + integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew== + dependencies: + postcss "^7.0.2" + postcss-selector-parser "^5.0.0-rc.3" + +postcss-reduce-initial@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz#7fd42ebea5e9c814609639e2c2e84ae270ba48df" + integrity sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA== + dependencies: + browserslist "^4.0.0" + caniuse-api "^3.0.0" + has "^1.0.0" + postcss "^7.0.0" + +postcss-reduce-transforms@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz#17efa405eacc6e07be3414a5ca2d1074681d4e29" + integrity sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg== + dependencies: + cssnano-util-get-match "^4.0.0" + has "^1.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + +postcss-replace-overflow-wrap@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz#61b360ffdaedca84c7c918d2b0f0d0ea559ab01c" + integrity sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw== + dependencies: + postcss "^7.0.2" + +postcss-safe-parser@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz#8756d9e4c36fdce2c72b091bbc8ca176ab1fcdea" + integrity sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ== + dependencies: + postcss "^7.0.0" + +postcss-selector-matches@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz#71c8248f917ba2cc93037c9637ee09c64436fcff" + integrity sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww== + dependencies: + balanced-match "^1.0.0" + postcss "^7.0.2" + +postcss-selector-not@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-4.0.0.tgz#c68ff7ba96527499e832724a2674d65603b645c0" + integrity sha512-W+bkBZRhqJaYN8XAnbbZPLWMvZD1wKTu0UxtFKdhtGjWYmxhkUneoeOhRJKdAE5V7ZTlnbHfCR+6bNwK9e1dTQ== + dependencies: + balanced-match "^1.0.0" + postcss "^7.0.2" + +postcss-selector-parser@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" + integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= + dependencies: + dot-prop "^4.1.1" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-selector-parser@^5.0.0, postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" + integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== + dependencies: + cssesc "^2.0.0" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-selector-parser@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz#934cf799d016c83411859e09dcecade01286ec5c" + integrity sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg== + dependencies: + cssesc "^3.0.0" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-svgo@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-4.0.2.tgz#17b997bc711b333bab143aaed3b8d3d6e3d38258" + integrity sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw== + dependencies: + is-svg "^3.0.0" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + svgo "^1.0.0" + +postcss-unique-selectors@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" + integrity sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg== + dependencies: + alphanum-sort "^1.0.0" + postcss "^7.0.0" + uniqs "^2.0.0" + +postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0, postcss-value-parser@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" + integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== + +postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" + integrity sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg== + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.5, postcss@^7.0.6: + version "7.0.16" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.16.tgz#48f64f1b4b558cb8b52c88987724359acb010da2" + integrity sha512-MOo8zNSlIqh22Uaa3drkdIAgUGEL+AD1ESiSdmElLUmE2uVDo1QloiT/IfW9qRw8Gw+Y/w69UVMGwbufMSftxA== + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +pretty-bytes@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.2.0.tgz#96c92c6e95a0b35059253fb33c03e260d40f5a1f" + integrity sha512-ujANBhiUsl9AhREUDUEY1GPOharMGm8x8juS7qOHybcLi7XsKfrYQ88hSly1l2i0klXHTDYrlL8ihMCG55Dc3w== + +pretty-error@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3" + integrity sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM= + dependencies: + renderkid "^2.0.1" + utila "~0.4" + +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== + dependencies: + "@jest/types" "^24.8.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +private@^0.1.6: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + +promise@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/promise/-/promise-8.0.2.tgz#9dcd0672192c589477d56891271bdc27547ae9f0" + integrity sha512-EIyzM39FpVOMbqgzEHhxdrEhtOSDOtjMZQ0M6iVfCE+kWNgCkAyOdnuCWqfmflylftfadU6FkiMgHZA2kUzwRw== + dependencies: + asap "~2.0.6" + +prompts@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" + integrity sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA== + dependencies: + kleur "^3.0.2" + sisteransi "^1.0.0" + +prop-types@^15.6.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +property-information@^5.0.0, property-information@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.0.1.tgz#c3b09f4f5750b1634c0b24205adbf78f18bdf94f" + integrity sha512-nAtBDVeSwFM3Ot/YxT7s4NqZmqXI7lLzf46BThvotEtYf2uk2yH0ACYuWQkJ7gxKs49PPtKVY0UlDGkyN9aJlw== + dependencies: + xtend "^4.0.1" + +proxy-addr@~2.0.4: + version "2.0.5" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" + integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.0" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + +psl@^1.1.24, psl@^1.1.28: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +q@^1.1.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +qs@6.5.2, qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +querystringify@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" + integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== + +raf@3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@^1.0.3, range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= + +raw-body@2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== + dependencies: + bytes "3.0.0" + http-errors "1.6.3" + iconv-lite "0.4.23" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-app-polyfill@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.1.tgz#809a858e44f9564c7f4205e173076f90048274f1" + integrity sha512-LbVpT1NdzTdDDs7xEZdebjDrqsvKi5UyVKUQqtTYYNyC1JJYVAwNQWe4ybWvoT2V2WW9PGVO2u5Y6aVj4ER/Ow== + dependencies: + core-js "3.0.1" + object-assign "4.1.1" + promise "8.0.2" + raf "3.4.1" + regenerator-runtime "0.13.2" + whatwg-fetch "3.0.0" + +react-dev-utils@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.0.1.tgz#5c03d85a0b2537d0c46af7165c24a7dfb274bef2" + integrity sha512-pnaeMo/Pxel8aZpxk1WwxT3uXxM3tEwYvsjCYn5R7gNxjhN1auowdcLDzFB8kr7rafAj2rxmvfic/fbac5CzwQ== + dependencies: + "@babel/code-frame" "7.0.0" + address "1.0.3" + browserslist "4.5.4" + chalk "2.4.2" + cross-spawn "6.0.5" + detect-port-alt "1.1.6" + escape-string-regexp "1.0.5" + filesize "3.6.1" + find-up "3.0.0" + fork-ts-checker-webpack-plugin "1.1.1" + global-modules "2.0.0" + globby "8.0.2" + gzip-size "5.0.0" + immer "1.10.0" + inquirer "6.2.2" + is-root "2.0.0" + loader-utils "1.2.3" + opn "5.4.0" + pkg-up "2.0.0" + react-error-overlay "^5.1.6" + recursive-readdir "2.2.2" + shell-quote "1.6.1" + sockjs-client "1.3.0" + strip-ansi "5.2.0" + text-table "0.2.0" + +react-dom@16.8.6: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f" + integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.6" + +react-error-overlay@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-5.1.6.tgz#0cd73407c5d141f9638ae1e0c63e7b2bf7e9929d" + integrity sha512-X1Y+0jR47ImDVr54Ab6V9eGk0Hnu7fVWGeHQSOXHf/C2pF9c6uy3gef8QUeuUiWlNb0i08InPSE5a/KJzNzw1Q== + +react-is@^16.8.1, react-is@^16.8.4: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +react-scripts@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-3.0.1.tgz#e5565350d8069cc9966b5998d3fe3befe3d243ac" + integrity sha512-LKEjBhVpEB+c312NeJhzF+NATxF7JkHNr5GhtwMeRS1cMeLElMeIu8Ye7WGHtDP7iz7ra4ryy48Zpo6G/cwWUw== + dependencies: + "@babel/core" "7.4.3" + "@svgr/webpack" "4.1.0" + "@typescript-eslint/eslint-plugin" "1.6.0" + "@typescript-eslint/parser" "1.6.0" + babel-eslint "10.0.1" + babel-jest "^24.8.0" + babel-loader "8.0.5" + babel-plugin-named-asset-import "^0.3.2" + babel-preset-react-app "^9.0.0" + camelcase "^5.2.0" + case-sensitive-paths-webpack-plugin "2.2.0" + css-loader "2.1.1" + dotenv "6.2.0" + dotenv-expand "4.2.0" + eslint "^5.16.0" + eslint-config-react-app "^4.0.1" + eslint-loader "2.1.2" + eslint-plugin-flowtype "2.50.1" + eslint-plugin-import "2.16.0" + eslint-plugin-jsx-a11y "6.2.1" + eslint-plugin-react "7.12.4" + eslint-plugin-react-hooks "^1.5.0" + file-loader "3.0.1" + fs-extra "7.0.1" + html-webpack-plugin "4.0.0-beta.5" + identity-obj-proxy "3.0.0" + is-wsl "^1.1.0" + jest "24.7.1" + jest-environment-jsdom-fourteen "0.1.0" + jest-resolve "24.7.1" + jest-watch-typeahead "0.3.0" + mini-css-extract-plugin "0.5.0" + optimize-css-assets-webpack-plugin "5.0.1" + pnp-webpack-plugin "1.2.1" + postcss-flexbugs-fixes "4.1.0" + postcss-loader "3.0.0" + postcss-normalize "7.0.1" + postcss-preset-env "6.6.0" + postcss-safe-parser "4.0.1" + react-app-polyfill "^1.0.1" + react-dev-utils "^9.0.1" + resolve "1.10.0" + sass-loader "7.1.0" + semver "6.0.0" + style-loader "0.23.1" + terser-webpack-plugin "1.2.3" + ts-pnp "1.1.2" + url-loader "1.1.2" + webpack "4.29.6" + webpack-dev-server "3.2.1" + webpack-manifest-plugin "2.0.4" + workbox-webpack-plugin "4.2.0" + optionalDependencies: + fsevents "2.0.6" + +react@16.8.6: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" + integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.6" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6, readable-stream@^3.1.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9" + integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + +recursive-readdir@2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" + integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== + dependencies: + minimatch "3.0.4" + +regenerate-unicode-properties@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz#7b38faa296252376d363558cfbda90c9ce709662" + integrity sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ== + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + +regenerator-runtime@0.13.2, regenerator-runtime@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" + integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb" + integrity sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A== + dependencies: + private "^0.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp-tree@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.6.tgz#84900fa12fdf428a2ac25f04300382a7c0148479" + integrity sha512-LFrA98Dw/heXqDojz7qKFdygZmFoiVlvE1Zp7Cq2cvF+ZA+03Gmhy0k0PQlsC1jvHPiTUSs+pDHEuSWv6+6D7w== + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpu-core@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" + integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.0.2" + regjsgen "^0.5.0" + regjsparser "^0.6.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.1.0" + +regjsgen@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== + +regjsparser@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== + dependencies: + jsesc "~0.5.0" + +rehype-parse@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-6.0.0.tgz#f681555f2598165bee2c778b39f9073d17b16bca" + integrity sha512-V2OjMD0xcSt39G4uRdMTqDXXm6HwkUbLMDayYKA/d037j8/OtVSQ+tqKwYWOuyBeoCs/3clXRe30VUjeMDTBSA== + dependencies: + hast-util-from-parse5 "^5.0.0" + parse5 "^5.0.0" + xtend "^4.0.1" + +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +renderkid@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.3.tgz#380179c2ff5ae1365c522bf2fcfcff01c5b74149" + integrity sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA== + dependencies: + css-select "^1.1.0" + dom-converter "^0.2" + htmlparser2 "^3.3.0" + strip-ansi "^3.0.0" + utila "^0.4.0" + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +replace-ext@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= + +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== + dependencies: + lodash "^4.17.11" + +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.87.0, request@^2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-from-string@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + +resolve@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + +resolve@^1.10.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" + integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rgb-regex@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" + integrity sha1-wODWiC3w4jviVKR16O3UGRX+rrE= + +rgba-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" + integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= + +rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rsvp@^4.8.4: + version "4.8.4" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" + integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA== + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= + dependencies: + aproba "^1.1.1" + +rxjs@^6.4.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4" + integrity sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg== + dependencies: + tslib "^1.9.0" + +safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +sass-loader@7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-7.1.0.tgz#16fd5138cb8b424bf8a759528a1972d72aad069d" + integrity sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w== + dependencies: + clone-deep "^2.0.1" + loader-utils "^1.0.1" + lodash.tail "^4.1.1" + neo-async "^2.5.0" + pify "^3.0.0" + semver "^5.5.0" + +sax@^1.2.4, sax@~1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +saxes@^3.1.9: + version "3.1.9" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.9.tgz#c1c197cd54956d88c09f960254b999e192d7058b" + integrity sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw== + dependencies: + xmlchars "^1.3.1" + +scheduler@^0.13.6: + version "0.13.6" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" + integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" + +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= + +selfsigned@^1.9.1: + version "1.10.4" + resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd" + integrity sha512-9AukTiDmHXGXWtWjembZ5NDmVvP2695EtpgbCsxCa68w3c88B+alqbmZ4O3hZ4VWGXeGWzEVdvqgAJD8DQPCDw== + dependencies: + node-forge "0.7.5" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + +semver@6.0.0, semver@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" + integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== + +send@0.16.2: + version "0.16.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" + integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.6.2" + mime "1.4.1" + ms "2.0.0" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.4.0" + +serialize-javascript@^1.4.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" + integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== + +serve-index@^1.7.2: + version "1.9.1" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" + integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= + dependencies: + accepts "~1.3.4" + batch "0.6.1" + debug "2.6.9" + escape-html "~1.0.3" + http-errors "~1.6.2" + mime-types "~2.1.17" + parseurl "~1.3.2" + +serve-static@1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" + integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.2" + send "0.16.2" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shallow-clone@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-0.1.2.tgz#5909e874ba77106d73ac414cfec1ffca87d97060" + integrity sha1-WQnodLp3EG1zrEFM/sH/yofZcGA= + dependencies: + is-extendable "^0.1.1" + kind-of "^2.0.1" + lazy-cache "^0.2.3" + mixin-object "^2.0.1" + +shallow-clone@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-1.0.0.tgz#4480cd06e882ef68b2ad88a3ea54832e2c48b571" + integrity sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA== + dependencies: + is-extendable "^0.1.1" + kind-of "^5.0.0" + mixin-object "^2.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shell-quote@1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +simple-swizzle@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= + dependencies: + is-arrayish "^0.3.1" + +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sockjs-client@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.3.0.tgz#12fc9d6cb663da5739d3dc5fb6e8687da95cb177" + integrity sha512-R9jxEzhnnrdxLCNln0xg5uGHqMnkhPSTzUZH2eXcR03S/On9Yvoq2wyUZILRUhZCNVu2PmwWVoyuiPz8th8zbg== + dependencies: + debug "^3.2.5" + eventsource "^1.0.7" + faye-websocket "~0.11.1" + inherits "^2.0.3" + json3 "^3.3.2" + url-parse "^1.4.3" + +sockjs@0.3.19: + version "0.3.19" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d" + integrity sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw== + dependencies: + faye-websocket "^0.10.0" + uuid "^3.0.1" + +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.6, source-map-support@~0.5.10: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +space-separated-tokens@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.3.tgz#bc6500e116d13285a94b59b58c44c7f045fe6124" + integrity sha512-/M5RAdBuQlSDPNfA5ube+fkHbHyY08pMuADLmsAQURzo56w90r681oiOoz3o3ZQyWdSeNucpTFjL+Ggd5qui3w== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + +spdy-transport@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" + integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== + dependencies: + debug "^4.1.0" + detect-node "^2.0.4" + hpack.js "^2.1.6" + obuf "^1.1.2" + readable-stream "^3.0.6" + wbuf "^1.7.3" + +spdy@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.0.tgz#81f222b5a743a329aa12cea6a390e60e9b613c52" + integrity sha512-ot0oEGT/PGUpzf/6uk4AWLqkq+irlqHXkrdbk51oWONh3bxQmBuljxPNl66zlRRcIJStWq0QkLUCPOPjgjvU0Q== + dependencies: + debug "^4.1.0" + handle-thing "^2.0.0" + http-deceiver "^1.2.7" + select-hose "^2.0.0" + spdy-transport "^3.0.0" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +ssri@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + dependencies: + figgy-pudding "^3.5.1" + +stable@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" + integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.4.0 < 2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +statuses@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" + integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +stream-browserify@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@^1.0.0, string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +strip-ansi@5.2.0, strip-ansi@^5.0.0, strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-comments@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-1.0.2.tgz#82b9c45e7f05873bee53f37168af930aa368679d" + integrity sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw== + dependencies: + babel-extract-comments "^1.0.0" + babel-plugin-transform-object-rest-spread "^6.26.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +style-loader@0.23.1: + version "0.23.1" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925" + integrity sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg== + dependencies: + loader-utils "^1.1.0" + schema-utils "^1.0.0" + +stylehacks@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" + integrity sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g== + dependencies: + browserslist "^4.0.0" + postcss "^7.0.0" + postcss-selector-parser "^3.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +svgo@^1.0.0, svgo@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316" + integrity sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA== + dependencies: + chalk "^2.4.1" + coa "^2.0.2" + css-select "^2.0.0" + css-select-base-adapter "^0.1.1" + css-tree "1.0.0-alpha.28" + css-url-regex "^1.1.0" + csso "^3.5.1" + js-yaml "^3.13.1" + mkdirp "~0.5.1" + object.values "^1.1.0" + sax "~1.2.4" + stable "^0.1.8" + unquote "~1.1.1" + util.promisify "~1.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + +table@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" + integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + dependencies: + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +tapable@^1.0.0, tapable@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +terser-webpack-plugin@1.2.3, terser-webpack-plugin@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz#3f98bc902fac3e5d0de730869f50668561262ec8" + integrity sha512-GOK7q85oAb/5kE12fMuLdn2btOS9OBZn4VsecpHDywoUC/jLhSAKOiYo0ezx7ss2EXPMzyEWFoE0s1WLE+4+oA== + dependencies: + cacache "^11.0.2" + find-cache-dir "^2.0.0" + schema-utils "^1.0.0" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + terser "^3.16.1" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" + +terser@^3.16.1: + version "3.17.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2" + integrity sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ== + dependencies: + commander "^2.19.0" + source-map "~0.6.1" + source-map-support "~0.5.10" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + +text-table@0.2.0, text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +thunky@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.0.3.tgz#f5df732453407b09191dae73e2a8cc73f381a826" + integrity sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow== + +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== + dependencies: + setimmediate "^1.0.4" + +timsort@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" + integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +trough@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.3.tgz#e29bd1614c6458d44869fc28b255ab7857ef7c24" + integrity sha512-fwkLWH+DimvA4YCy+/nvJd61nWQQ2liO/nF/RjkTpiOGi+zxZzVkhb1mvbHIIW4b/8nDsYI8uTmAlc0nNkRMOw== + +ts-pnp@1.1.2, ts-pnp@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.2.tgz#be8e4bfce5d00f0f58e0666a82260c34a57af552" + integrity sha512-f5Knjh7XCyRIzoC/z1Su1yLLRrPrFCgtUAh/9fCSP6NKbATwpOL1+idQVXQokK9GRFURn/jYPGPfegIctwunoA== + +tslib@^1.8.1, tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tsutils@^3.7.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.10.0.tgz#6f1c95c94606e098592b0dff06590cf9659227d6" + integrity sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q== + dependencies: + tslib "^1.8.1" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-is@~1.6.16: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +uglify-js@3.4.x: + version "3.4.10" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" + integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== + dependencies: + commander "~2.19.0" + source-map "~0.6.1" + +uglify-js@^3.1.4: + version "3.5.11" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.11.tgz#833442c0aa29b3a7d34344c7c63adaa3f3504f6a" + integrity sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" + integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" + integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== + +unified@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" + integrity sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw== + dependencies: + "@types/unist" "^2.0.0" + "@types/vfile" "^3.0.0" + bail "^1.0.0" + extend "^3.0.0" + is-plain-obj "^1.1.0" + trough "^1.0.0" + vfile "^3.0.0" + x-is-string "^0.1.0" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= + +uniqs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" + integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= + +unique-filename@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== + dependencies: + imurmurhash "^0.1.4" + +unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" + integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== + +unist-util-stringify-position@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.0.tgz#4c452c0dbcbc509f7bcd366e9a8afd646f9d51ae" + integrity sha512-Uz5negUTrf9zm2ZT2Z9kdOL7Mr7FJLyq3ByqagUi7QZRVK1HnspVazvSqwHt73jj7APHtpuJ4K110Jm8O6/elw== + dependencies: + "@types/unist" "^2.0.2" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unquote@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" + integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + +upper-case@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url-loader@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-1.1.2.tgz#b971d191b83af693c5e3fea4064be9e1f2d7f8d8" + integrity sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg== + dependencies: + loader-utils "^1.1.0" + mime "^2.0.3" + schema-utils "^1.0.0" + +url-parse@^1.4.3: + version "1.4.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" + integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util.promisify@1.0.0, util.promisify@^1.0.0, util.promisify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== + dependencies: + inherits "2.0.3" + +utila@^0.4.0, utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + +uuid@^3.0.1, uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +vendors@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.2.tgz#7fcb5eef9f5623b156bcea89ec37d63676f21801" + integrity sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vfile-message@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" + integrity sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA== + dependencies: + unist-util-stringify-position "^1.1.1" + +vfile-message@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.0.tgz#750bbb86fe545988a67e899b329bbcabb73edef6" + integrity sha512-YS6qg6UpBfIeiO+6XlhPOuJaoLvt1Y9g2cmlwqhBOOU0XRV8j5RLeoz72t6PWLvNXq3EBG1fQ05wNPrUoz0deQ== + dependencies: + "@types/unist" "^2.0.2" + unist-util-stringify-position "^1.1.1" + +vfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" + integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== + dependencies: + is-buffer "^2.0.0" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vfile-message "^1.0.0" + +vfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.0.0.tgz#ebf3b48af9fcde524d5e08d5f75812058a5f78ad" + integrity sha512-WMNeHy5djSl895BqE86D7WqA0Ie5fAIeGCa7V1EqiXyJg5LaGch2SUaZueok5abYQGH6mXEAsZ45jkoILIOlyA== + dependencies: + "@types/unist" "^2.0.2" + is-buffer "^2.0.0" + replace-ext "1.0.0" + unist-util-stringify-position "^2.0.0" + vfile-message "^2.0.0" + +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= + dependencies: + indexof "0.0.1" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +w3c-xmlserializer@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" + integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== + dependencies: + domexception "^1.0.1" + webidl-conversions "^4.0.2" + xml-name-validator "^3.0.0" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +watchpack@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +wbuf@^1.1.0, wbuf@^1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" + integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== + dependencies: + minimalistic-assert "^1.0.0" + +web-namespaces@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.3.tgz#9bbf5c99ff0908d2da031f1d732492a96571a83f" + integrity sha512-r8sAtNmgR0WKOKOxzuSgk09JsHlpKlB+uHi937qypOu3PZ17UxPrierFKDye/uNHjNTTEshu5PId8rojIPj/tA== + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +webpack-dev-middleware@^3.5.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz#f37a27ad7c09cd7dc67cd97655413abaa1f55942" + integrity sha512-A47I5SX60IkHrMmZUlB0ZKSWi29TZTcPz7cha1Z75yYOsgWh/1AcPmQEbC8ZIbU3A1ytSv1PMU0PyPz2Lmz2jg== + dependencies: + memory-fs "^0.4.1" + mime "^2.3.1" + range-parser "^1.0.3" + webpack-log "^2.0.0" + +webpack-dev-server@3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.2.1.tgz#1b45ce3ecfc55b6ebe5e36dab2777c02bc508c4e" + integrity sha512-sjuE4mnmx6JOh9kvSbPYw3u/6uxCLHNWfhWaIPwcXWsvWOPN+nc5baq4i9jui3oOBRXGonK9+OI0jVkaz6/rCw== + dependencies: + ansi-html "0.0.7" + bonjour "^3.5.0" + chokidar "^2.0.0" + compression "^1.5.2" + connect-history-api-fallback "^1.3.0" + debug "^4.1.1" + del "^3.0.0" + express "^4.16.2" + html-entities "^1.2.0" + http-proxy-middleware "^0.19.1" + import-local "^2.0.0" + internal-ip "^4.2.0" + ip "^1.1.5" + killable "^1.0.0" + loglevel "^1.4.1" + opn "^5.1.0" + portfinder "^1.0.9" + schema-utils "^1.0.0" + selfsigned "^1.9.1" + semver "^5.6.0" + serve-index "^1.7.2" + sockjs "0.3.19" + sockjs-client "1.3.0" + spdy "^4.0.0" + strip-ansi "^3.0.0" + supports-color "^6.1.0" + url "^0.11.0" + webpack-dev-middleware "^3.5.1" + webpack-log "^2.0.0" + yargs "12.0.2" + +webpack-log@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" + integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== + dependencies: + ansi-colors "^3.0.0" + uuid "^3.3.2" + +webpack-manifest-plugin@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-2.0.4.tgz#e4ca2999b09557716b8ba4475fb79fab5986f0cd" + integrity sha512-nejhOHexXDBKQOj/5v5IZSfCeTO3x1Dt1RZEcGfBSul891X/eLIcIVH31gwxPDdsi2Z8LKKFGpM4w9+oTBOSCg== + dependencies: + fs-extra "^7.0.0" + lodash ">=3.5 <5" + tapable "^1.0.0" + +webpack-sources@^1.1.0, webpack-sources@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@4.29.6: + version "4.29.6" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.29.6.tgz#66bf0ec8beee4d469f8b598d3988ff9d8d90e955" + integrity sha512-MwBwpiE1BQpMDkbnUUaW6K8RFZjljJHArC6tWQJoFm0oQtfoSebtg4Y7/QHnJ/SddtjYLHaKGX64CFjG5rehJw== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/wasm-edit" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + acorn "^6.0.5" + acorn-dynamic-import "^4.0.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chrome-trace-event "^1.0.0" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.0" + json-parse-better-errors "^1.0.2" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + micromatch "^3.1.8" + mkdirp "~0.5.0" + neo-async "^2.5.0" + node-libs-browser "^2.0.0" + schema-utils "^1.0.0" + tapable "^1.1.0" + terser-webpack-plugin "^1.1.0" + watchpack "^1.5.0" + webpack-sources "^1.3.0" + +websocket-driver@>=0.5.1: + version "0.7.0" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.0.tgz#0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb" + integrity sha1-DK+dLXVdk67gSdS90NP+LMoqJOs= + dependencies: + http-parser-js ">=0.4.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" + integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +workbox-background-sync@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-4.3.1.tgz#26821b9bf16e9e37fd1d640289edddc08afd1950" + integrity sha512-1uFkvU8JXi7L7fCHVBEEnc3asPpiAL33kO495UMcD5+arew9IbKW2rV5lpzhoWcm/qhGB89YfO4PmB/0hQwPRg== + dependencies: + workbox-core "^4.3.1" + +workbox-broadcast-update@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-broadcast-update/-/workbox-broadcast-update-4.3.1.tgz#e2c0280b149e3a504983b757606ad041f332c35b" + integrity sha512-MTSfgzIljpKLTBPROo4IpKjESD86pPFlZwlvVG32Kb70hW+aob4Jxpblud8EhNb1/L5m43DUM4q7C+W6eQMMbA== + dependencies: + workbox-core "^4.3.1" + +workbox-build@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-4.3.1.tgz#414f70fb4d6de47f6538608b80ec52412d233e64" + integrity sha512-UHdwrN3FrDvicM3AqJS/J07X0KXj67R8Cg0waq1MKEOqzo89ap6zh6LmaLnRAjpB+bDIz+7OlPye9iii9KBnxw== + dependencies: + "@babel/runtime" "^7.3.4" + "@hapi/joi" "^15.0.0" + common-tags "^1.8.0" + fs-extra "^4.0.2" + glob "^7.1.3" + lodash.template "^4.4.0" + pretty-bytes "^5.1.0" + stringify-object "^3.3.0" + strip-comments "^1.0.2" + workbox-background-sync "^4.3.1" + workbox-broadcast-update "^4.3.1" + workbox-cacheable-response "^4.3.1" + workbox-core "^4.3.1" + workbox-expiration "^4.3.1" + workbox-google-analytics "^4.3.1" + workbox-navigation-preload "^4.3.1" + workbox-precaching "^4.3.1" + workbox-range-requests "^4.3.1" + workbox-routing "^4.3.1" + workbox-strategies "^4.3.1" + workbox-streams "^4.3.1" + workbox-sw "^4.3.1" + workbox-window "^4.3.1" + +workbox-cacheable-response@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-4.3.1.tgz#f53e079179c095a3f19e5313b284975c91428c91" + integrity sha512-Rp5qlzm6z8IOvnQNkCdO9qrDgDpoPNguovs0H8C+wswLuPgSzSp9p2afb5maUt9R1uTIwOXrVQMmPfPypv+npw== + dependencies: + workbox-core "^4.3.1" + +workbox-core@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-4.3.1.tgz#005d2c6a06a171437afd6ca2904a5727ecd73be6" + integrity sha512-I3C9jlLmMKPxAC1t0ExCq+QoAMd0vAAHULEgRZ7kieCdUd919n53WC0AfvokHNwqRhGn+tIIj7vcb5duCjs2Kg== + +workbox-expiration@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-4.3.1.tgz#d790433562029e56837f341d7f553c4a78ebe921" + integrity sha512-vsJLhgQsQouv9m0rpbXubT5jw0jMQdjpkum0uT+d9tTwhXcEZks7qLfQ9dGSaufTD2eimxbUOJfWLbNQpIDMPw== + dependencies: + workbox-core "^4.3.1" + +workbox-google-analytics@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-4.3.1.tgz#9eda0183b103890b5c256e6f4ea15a1f1548519a" + integrity sha512-xzCjAoKuOb55CBSwQrbyWBKqp35yg1vw9ohIlU2wTy06ZrYfJ8rKochb1MSGlnoBfXGWss3UPzxR5QL5guIFdg== + dependencies: + workbox-background-sync "^4.3.1" + workbox-core "^4.3.1" + workbox-routing "^4.3.1" + workbox-strategies "^4.3.1" + +workbox-navigation-preload@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-4.3.1.tgz#29c8e4db5843803b34cd96dc155f9ebd9afa453d" + integrity sha512-K076n3oFHYp16/C+F8CwrRqD25GitA6Rkd6+qAmLmMv1QHPI2jfDwYqrytOfKfYq42bYtW8Pr21ejZX7GvALOw== + dependencies: + workbox-core "^4.3.1" + +workbox-precaching@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-4.3.1.tgz#9fc45ed122d94bbe1f0ea9584ff5940960771cba" + integrity sha512-piSg/2csPoIi/vPpp48t1q5JLYjMkmg5gsXBQkh/QYapCdVwwmKlU9mHdmy52KsDGIjVaqEUMFvEzn2LRaigqQ== + dependencies: + workbox-core "^4.3.1" + +workbox-range-requests@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-range-requests/-/workbox-range-requests-4.3.1.tgz#f8a470188922145cbf0c09a9a2d5e35645244e74" + integrity sha512-S+HhL9+iTFypJZ/yQSl/x2Bf5pWnbXdd3j57xnb0V60FW1LVn9LRZkPtneODklzYuFZv7qK6riZ5BNyc0R0jZA== + dependencies: + workbox-core "^4.3.1" + +workbox-routing@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-4.3.1.tgz#a675841af623e0bb0c67ce4ed8e724ac0bed0cda" + integrity sha512-FkbtrODA4Imsi0p7TW9u9MXuQ5P4pVs1sWHK4dJMMChVROsbEltuE79fBoIk/BCztvOJ7yUpErMKa4z3uQLX+g== + dependencies: + workbox-core "^4.3.1" + +workbox-strategies@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-4.3.1.tgz#d2be03c4ef214c115e1ab29c9c759c9fe3e9e646" + integrity sha512-F/+E57BmVG8dX6dCCopBlkDvvhg/zj6VDs0PigYwSN23L8hseSRwljrceU2WzTvk/+BSYICsWmRq5qHS2UYzhw== + dependencies: + workbox-core "^4.3.1" + +workbox-streams@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-streams/-/workbox-streams-4.3.1.tgz#0b57da70e982572de09c8742dd0cb40a6b7c2cc3" + integrity sha512-4Kisis1f/y0ihf4l3u/+ndMkJkIT4/6UOacU3A4BwZSAC9pQ9vSvJpIi/WFGQRH/uPXvuVjF5c2RfIPQFSS2uA== + dependencies: + workbox-core "^4.3.1" + +workbox-sw@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-4.3.1.tgz#df69e395c479ef4d14499372bcd84c0f5e246164" + integrity sha512-0jXdusCL2uC5gM3yYFT6QMBzKfBr2XTk0g5TPAV4y8IZDyVNDyj1a8uSXy3/XrvkVTmQvLN4O5k3JawGReXr9w== + +workbox-webpack-plugin@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-4.2.0.tgz#c94c3f69ff39c8a5b0c7e6bebc382cb53410a63d" + integrity sha512-YZsiA+y/ns/GdWRaBsfYv8dln1ebWtGnJcTOg1ppO0pO1tScAHX0yGtHIjndxz3L/UUhE8b0NQE9KeLNwJwA5A== + dependencies: + "@babel/runtime" "^7.0.0" + json-stable-stringify "^1.0.1" + workbox-build "^4.2.0" + +workbox-window@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-4.3.1.tgz#ee6051bf10f06afa5483c9b8dfa0531994ede0f3" + integrity sha512-C5gWKh6I58w3GeSc0wp2Ne+rqVw8qwcmZnQGpjiek8A2wpbxSJb1FdCoQVO+jDJs35bFgo/WETgl1fqgsxN0Hg== + dependencies: + workbox-core "^4.3.1" + +worker-farm@^1.5.2: + version "1.7.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" + integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== + dependencies: + errno "~0.1.7" + +worker-rpc@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/worker-rpc/-/worker-rpc-0.1.1.tgz#cb565bd6d7071a8f16660686051e969ad32f54d5" + integrity sha512-P1WjMrUB3qgJNI9jfmpZ/htmBEjFh//6l/5y8SD9hg1Ef5zTTVVoRjTrTEzPrNBQvmhMxkoTsjOXN10GWU7aCg== + dependencies: + microevent.ts "~0.1.1" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +ws@^6.1.2: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" + integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== + dependencies: + async-limiter "~1.0.0" + +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +xmlchars@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-1.3.1.tgz#1dda035f833dbb4f86a0c28eaa6ca769214793cf" + integrity sha512-tGkGJkN8XqCod7OT+EvGYK5Z4SfDQGD30zAa58OcnAa0RRWgzUEK72tkXhsX1FZd+rgnhRxFtmO+ihkp8LHSkw== + +xregexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== + +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs-parser@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== + dependencies: + camelcase "^4.1.0" + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@12.0.2: + version "12.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" + integrity sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ== + dependencies: + cliui "^4.0.0" + decamelize "^2.0.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^10.1.0" + +yargs@^12.0.2: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" From a5ba19bd9c6ff7c1c0c704b9ee95155c6f1c8277 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Mon, 29 Jul 2019 12:10:00 -0400 Subject: [PATCH 02/38] add gitignore for yarn.lock --- client/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/client/.gitignore b/client/.gitignore index 4d29575de..960b87d28 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -21,3 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +yarn.lock \ No newline at end of file From d012dfe36333f0e0fafd3ce4dc6eb652625bb304 Mon Sep 17 00:00:00 2001 From: Wei Du <30298322+chef27615@users.noreply.github.com> Date: Mon, 29 Jul 2019 12:11:46 -0400 Subject: [PATCH 03/38] Delete yarn.lock --- client/yarn.lock | 10011 --------------------------------------------- 1 file changed, 10011 deletions(-) delete mode 100644 client/yarn.lock diff --git a/client/yarn.lock b/client/yarn.lock deleted file mode 100644 index 25b6936b7..000000000 --- a/client/yarn.lock +++ /dev/null @@ -1,10011 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/core@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.3.tgz#198d6d3af4567be3989550d97e068de94503074f" - integrity sha512-oDpASqKFlbspQfzAE7yaeTmdljSH2ADIvBlb0RwbStltTuWa0+7CCI1fYVINNv9saHPa1W7oaKeuNuKj+RQCvA== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.0" - "@babel/helpers" "^7.4.3" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.11" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/core@^7.1.0", "@babel/core@^7.1.6", "@babel/core@^7.4.3": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.4.tgz#84055750b05fcd50f9915a826b44fa347a825250" - integrity sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" - "@babel/helpers" "^7.4.4" - "@babel/parser" "^7.4.4" - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.11" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" - integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== - dependencies: - "@babel/types" "^7.4.4" - jsesc "^2.5.1" - lodash "^4.17.11" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/helper-annotate-as-pure@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" - integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" - integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-builder-react-jsx@^7.3.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" - integrity sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw== - dependencies: - "@babel/types" "^7.3.0" - esutils "^2.0.0" - -"@babel/helper-call-delegate@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" - integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== - dependencies: - "@babel/helper-hoist-variables" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/helper-create-class-features-plugin@^7.4.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.4.tgz#fc3d690af6554cc9efc607364a82d48f58736dba" - integrity sha512-UbBHIa2qeAGgyiNR9RszVF7bUHEdgS4JAUNT8SiqrAN6YJVxlOxeLr5pBzb5kan302dejJ9nla4RyKcR1XT6XA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" - "@babel/helper-split-export-declaration" "^7.4.4" - -"@babel/helper-define-map@^7.4.0", "@babel/helper-define-map@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" - integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.4.4" - lodash "^4.17.11" - -"@babel/helper-explode-assignable-expression@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" - integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== - dependencies: - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" - integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== - dependencies: - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-get-function-arity@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" - integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-hoist-variables@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" - integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== - dependencies: - "@babel/types" "^7.4.4" - -"@babel/helper-member-expression-to-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" - integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" - integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" - integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/template" "^7.4.4" - "@babel/types" "^7.4.4" - lodash "^4.17.11" - -"@babel/helper-optimise-call-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" - integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-plugin-utils@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" - integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== - -"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" - integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== - dependencies: - lodash "^4.17.11" - -"@babel/helper-remap-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" - integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-wrap-function" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.0", "@babel/helper-replace-supers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" - integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/helper-simple-access@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" - integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== - dependencies: - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-split-export-declaration@^7.4.0", "@babel/helper-split-export-declaration@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" - integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== - dependencies: - "@babel/types" "^7.4.4" - -"@babel/helper-wrap-function@^7.1.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" - integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.2.0" - -"@babel/helpers@^7.4.3", "@babel/helpers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" - integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== - dependencies: - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" - integrity sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w== - -"@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" - integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - -"@babel/plugin-proposal-class-properties@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz#d70db61a2f1fd79de927eea91f6411c964e084b8" - integrity sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-proposal-decorators@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz#8e1bfd83efa54a5f662033afcc2b8e701f4bb3a9" - integrity sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-decorators" "^7.2.0" - -"@babel/plugin-proposal-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - -"@babel/plugin-proposal-object-rest-spread@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.3.tgz#be27cd416eceeba84141305b93c282f5de23bbb4" - integrity sha512-xC//6DNSSHVjq8O2ge0dyYlhshsH4T7XdCVoxbi5HzLYWfsC5ooFlJjrXk8RcAT+hjHAK9UjBXdylzSoDK3t4g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - -"@babel/plugin-proposal-object-rest-spread@^7.4.3", "@babel/plugin-proposal-object-rest-spread@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz#1ef173fcf24b3e2df92a678f027673b55e7e3005" - integrity sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - -"@babel/plugin-proposal-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - -"@babel/plugin-proposal-unicode-property-regex@^7.4.0", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" - integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/plugin-syntax-async-generators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-decorators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" - integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-dynamic-import@7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-flow@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" - integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-jsx@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" - integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-typescript@^7.2.0": - version "7.3.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" - integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-arrow-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-async-to-generator@^7.4.0", "@babel/plugin-transform-async-to-generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz#a3f1d01f2f21cadab20b33a82133116f14fb5894" - integrity sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - -"@babel/plugin-transform-block-scoped-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-block-scoping@^7.4.0", "@babel/plugin-transform-block-scoping@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" - integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.11" - -"@babel/plugin-transform-classes@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.3.tgz#adc7a1137ab4287a555d429cc56ecde8f40c062c" - integrity sha512-PUaIKyFUDtG6jF5DUJOfkBdwAS/kFFV3XFk7Nn0a6vR7ZT8jYw5cGtIlat77wcnd0C6ViGqo/wyNf4ZHytF/nQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.0" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.0" - "@babel/helper-split-export-declaration" "^7.4.0" - globals "^11.1.0" - -"@babel/plugin-transform-classes@^7.4.3", "@babel/plugin-transform-classes@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" - integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.4" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" - "@babel/helper-split-export-declaration" "^7.4.4" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-destructuring@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.3.tgz#1a95f5ca2bf2f91ef0648d5de38a8d472da4350f" - integrity sha512-rVTLLZpydDFDyN4qnXdzwoVpk1oaXHIvPEOkOLyr88o7oHxVc/LyrnDx+amuBWGOwUb7D1s/uLsKBNTx08htZg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-destructuring@^7.4.3", "@babel/plugin-transform-destructuring@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz#9d964717829cc9e4b601fc82a26a71a4d8faf20f" - integrity sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-dotall-regex@^7.4.3", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" - integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/plugin-transform-duplicate-keys@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" - integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-exponentiation-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-flow-strip-types@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.0.tgz#f3c59eecff68c99b9c96eaafe4fe9d1fa8947138" - integrity sha512-C4ZVNejHnfB22vI2TYN4RUp2oCmq6cSEAg4RygSvYZUECRqUu9O4PMEMNJ4wsemaRGg27BbgYctG4BZh+AgIHw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.2.0" - -"@babel/plugin-transform-for-of@^7.4.3", "@babel/plugin-transform-for-of@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" - integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-function-name@^7.4.3", "@babel/plugin-transform-function-name@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" - integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-member-expression-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" - integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-modules-amd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" - integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== - dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-modules-commonjs@^7.4.3", "@babel/plugin-transform-modules-commonjs@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz#0bef4713d30f1d78c2e59b3d6db40e60192cac1e" - integrity sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw== - dependencies: - "@babel/helper-module-transforms" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - -"@babel/plugin-transform-modules-systemjs@^7.4.0", "@babel/plugin-transform-modules-systemjs@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz#dc83c5665b07d6c2a7b224c00ac63659ea36a405" - integrity sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ== - dependencies: - "@babel/helper-hoist-variables" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-modules-umd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" - integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== - dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.4.2", "@babel/plugin-transform-named-capturing-groups-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.4.tgz#5611d96d987dfc4a3a81c4383bb173361037d68d" - integrity sha512-Ki+Y9nXBlKfhD+LXaRS7v95TtTGYRAf9Y1rTDiE75zf8YQz4GDaWRXosMfJBXxnk88mGFjWdCRIeqDbon7spYA== - dependencies: - regexp-tree "^0.1.0" - -"@babel/plugin-transform-new-target@^7.4.0", "@babel/plugin-transform-new-target@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" - integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-object-super@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" - integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - -"@babel/plugin-transform-parameters@^7.4.3", "@babel/plugin-transform-parameters@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" - integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== - dependencies: - "@babel/helper-call-delegate" "^7.4.4" - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-property-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" - integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-react-constant-elements@7.2.0", "@babel/plugin-transform-react-constant-elements@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.2.0.tgz#ed602dc2d8bff2f0cb1a5ce29263dbdec40779f7" - integrity sha512-YYQFg6giRFMsZPKUM9v+VcHOdfSQdz9jHCx3akAi3UYgyjndmdYGSXylQ/V+HswQt4fL8IklchD9HTsaOCrWQQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-react-display-name@7.2.0", "@babel/plugin-transform-react-display-name@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" - integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-react-jsx-self@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" - integrity sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-react-jsx-source@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.2.0.tgz#20c8c60f0140f5dd3cd63418d452801cf3f7180f" - integrity sha512-A32OkKTp4i5U6aE88GwwcuV4HAprUgHcTq0sSafLxjr6AW0QahrCRCjxogkbbcdtpbXkuTOlgpjophCxb6sh5g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-react-jsx@^7.0.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" - integrity sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg== - dependencies: - "@babel/helper-builder-react-jsx" "^7.3.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-regenerator@^7.4.3", "@babel/plugin-transform-regenerator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.4.tgz#5b4da4df79391895fca9e28f99e87e22cfc02072" - integrity sha512-Zz3w+pX1SI0KMIiqshFZkwnVGUhDZzpX2vtPzfJBKQQq8WsP/Xy9DNdELWivxcKOCX/Pywge4SiEaPaLtoDT4g== - dependencies: - regenerator-transform "^0.13.4" - -"@babel/plugin-transform-reserved-words@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" - integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-runtime@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.3.tgz#4d6691690ecdc9f5cb8c3ab170a1576c1f556371" - integrity sha512-7Q61bU+uEI7bCUFReT1NKn7/X6sDQsZ7wL1sJ9IYMAO7cI+eg6x9re1cEw2fCRMbbTVyoeUKWSV1M6azEfKCfg== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - resolve "^1.8.1" - semver "^5.5.1" - -"@babel/plugin-transform-shorthand-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-spread@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" - integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-sticky-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - -"@babel/plugin-transform-template-literals@^7.2.0", "@babel/plugin-transform-template-literals@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" - integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-typeof-symbol@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-typescript@^7.3.2": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.4.tgz#93e9c3f2a546e6d3da1e9cc990e30791b807aa9f" - integrity sha512-rwDvjaMTx09WC0rXGBRlYSSkEHOKRrecY6hEr3SVIPKII8DVWXtapNAfAyMC0dovuO+zYArcAuKeu3q9DNRfzA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-typescript" "^7.2.0" - -"@babel/plugin-transform-unicode-regex@^7.4.3", "@babel/plugin-transform-unicode-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" - integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/preset-env@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.3.tgz#e71e16e123dc0fbf65a52cbcbcefd072fbd02880" - integrity sha512-FYbZdV12yHdJU5Z70cEg0f6lvtpZ8jFSDakTm7WXeJbLXh4R0ztGEu/SW7G1nJ2ZvKwDhz8YrbA84eYyprmGqw== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.4.3" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.4.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.4.0" - "@babel/plugin-transform-classes" "^7.4.3" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.4.3" - "@babel/plugin-transform-dotall-regex" "^7.4.3" - "@babel/plugin-transform-duplicate-keys" "^7.2.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.3" - "@babel/plugin-transform-function-name" "^7.4.3" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.2.0" - "@babel/plugin-transform-modules-commonjs" "^7.4.3" - "@babel/plugin-transform-modules-systemjs" "^7.4.0" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.2" - "@babel/plugin-transform-new-target" "^7.4.0" - "@babel/plugin-transform-object-super" "^7.2.0" - "@babel/plugin-transform-parameters" "^7.4.3" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.4.3" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.2.0" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.4.3" - "@babel/types" "^7.4.0" - browserslist "^4.5.2" - core-js-compat "^3.0.0" - invariant "^2.2.2" - js-levenshtein "^1.1.3" - semver "^5.5.0" - -"@babel/preset-env@^7.1.6": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.4.tgz#b6f6825bfb27b3e1394ca3de4f926482722c1d6f" - integrity sha512-FU1H+ACWqZZqfw1x2G1tgtSSYSfxJLkpaUQL37CenULFARDo+h4xJoVHzRoHbK+85ViLciuI7ME4WTIhFRBBlw== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.4.4" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.4.4" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.4.4" - "@babel/plugin-transform-classes" "^7.4.4" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/plugin-transform-duplicate-keys" "^7.2.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.4" - "@babel/plugin-transform-function-name" "^7.4.4" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.2.0" - "@babel/plugin-transform-modules-commonjs" "^7.4.4" - "@babel/plugin-transform-modules-systemjs" "^7.4.4" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.4" - "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.2.0" - "@babel/plugin-transform-parameters" "^7.4.4" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.4.4" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.4.4" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.4.4" - browserslist "^4.5.2" - core-js-compat "^3.0.0" - invariant "^2.2.2" - js-levenshtein "^1.1.3" - semver "^5.5.0" - -"@babel/preset-react@7.0.0", "@babel/preset-react@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" - integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-react-display-name" "^7.0.0" - "@babel/plugin-transform-react-jsx" "^7.0.0" - "@babel/plugin-transform-react-jsx-self" "^7.0.0" - "@babel/plugin-transform-react-jsx-source" "^7.0.0" - -"@babel/preset-typescript@7.3.3": - version "7.3.3" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a" - integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-typescript" "^7.3.2" - -"@babel/runtime@7.4.3": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.3.tgz#79888e452034223ad9609187a0ad1fe0d2ad4bdc" - integrity sha512-9lsJwJLxDh/T3Q3SZszfWOTkk3pHbkmH+3KY+zwIDmsNlxsumuhS2TH3NIpktU4kNvfzy+k3eLT7aTJSPTo0OA== - dependencies: - regenerator-runtime "^0.13.2" - -"@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.2": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d" - integrity sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg== - dependencies: - regenerator-runtime "^0.13.2" - -"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" - integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" - integrity sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.11" - -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" - integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== - dependencies: - esutils "^2.0.2" - lodash "^4.17.11" - to-fast-properties "^2.0.0" - -"@cnakazawa/watch@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" - integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== - dependencies: - exec-sh "^0.3.2" - minimist "^1.2.0" - -"@csstools/convert-colors@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" - integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw== - -"@csstools/normalize.css@^9.0.1": - version "9.0.1" - resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-9.0.1.tgz#c27b391d8457d1e893f1eddeaf5e5412d12ffbb5" - integrity sha512-6It2EVfGskxZCQhuykrfnALg7oVeiI6KclWSmGDqB0AiInVrTGB9Jp9i4/Ad21u9Jde/voVQz6eFX/eSg/UsPA== - -"@hapi/address@2.x.x": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.0.0.tgz#9f05469c88cb2fd3dcd624776b54ee95c312126a" - integrity sha512-mV6T0IYqb0xL1UALPFplXYQmR0twnXG0M6jUswpquqT2sD12BOiCiLy3EvMp/Fy7s3DZElC4/aPjEjo2jeZpvw== - -"@hapi/hoek@6.x.x": - version "6.2.1" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-6.2.1.tgz#d3a66329159af879bfdf0b0cff2229c43c5a3451" - integrity sha512-+ryw4GU9pjr1uT6lBuErHJg3NYqzwJTvZ75nKuJijEzpd00Uqi6oiawTGDDf5Hl0zWmI7qHfOtaqB0kpQZJQzA== - -"@hapi/joi@^15.0.0": - version "15.0.2" - resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.0.2.tgz#2989041a06ee2941cf6dd247ffff8032640d16bb" - integrity sha512-c3NwWBHzUnEavcaCpGaepOcygS17pSnOh5ZYUBz+sfqCP7kC9haLcRnd3U8KFC4TbLFmRwKnmYglsc47m9yapg== - dependencies: - "@hapi/address" "2.x.x" - "@hapi/hoek" "6.x.x" - "@hapi/topo" "3.x.x" - -"@hapi/topo@3.x.x": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.0.tgz#5c47cd9637c2953db185aa957a27bcb2a8b7a6f8" - integrity sha512-gZDI/eXOIk8kP2PkUKjWu9RW8GGVd2Hkgjxyr/S7Z+JF+0mr7bAlbw+DkTRxnD580o8Kqxlnba9wvqp5aOHBww== - dependencies: - "@hapi/hoek" "6.x.x" - -"@jest/console@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" - integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== - dependencies: - "@jest/source-map" "^24.3.0" - chalk "^2.0.1" - slash "^2.0.0" - -"@jest/core@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" - integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== - dependencies: - "@jest/console" "^24.7.1" - "@jest/reporters" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - exit "^0.1.2" - graceful-fs "^4.1.15" - jest-changed-files "^24.8.0" - jest-config "^24.8.0" - jest-haste-map "^24.8.0" - jest-message-util "^24.8.0" - jest-regex-util "^24.3.0" - jest-resolve-dependencies "^24.8.0" - jest-runner "^24.8.0" - jest-runtime "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" - jest-watcher "^24.8.0" - micromatch "^3.1.10" - p-each-series "^1.0.0" - pirates "^4.0.1" - realpath-native "^1.1.0" - rimraf "^2.5.4" - strip-ansi "^5.0.0" - -"@jest/environment@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" - integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== - dependencies: - "@jest/fake-timers" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - -"@jest/fake-timers@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" - integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== - dependencies: - "@jest/types" "^24.8.0" - jest-message-util "^24.8.0" - jest-mock "^24.8.0" - -"@jest/reporters@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" - integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== - dependencies: - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - chalk "^2.0.1" - exit "^0.1.2" - glob "^7.1.2" - istanbul-lib-coverage "^2.0.2" - istanbul-lib-instrument "^3.0.1" - istanbul-lib-report "^2.0.4" - istanbul-lib-source-maps "^3.0.1" - istanbul-reports "^2.1.1" - jest-haste-map "^24.8.0" - jest-resolve "^24.8.0" - jest-runtime "^24.8.0" - jest-util "^24.8.0" - jest-worker "^24.6.0" - node-notifier "^5.2.1" - slash "^2.0.0" - source-map "^0.6.0" - string-length "^2.0.0" - -"@jest/source-map@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" - integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.1.15" - source-map "^0.6.0" - -"@jest/test-result@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" - integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== - dependencies: - "@jest/console" "^24.7.1" - "@jest/types" "^24.8.0" - "@types/istanbul-lib-coverage" "^2.0.0" - -"@jest/test-sequencer@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" - integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== - dependencies: - "@jest/test-result" "^24.8.0" - jest-haste-map "^24.8.0" - jest-runner "^24.8.0" - jest-runtime "^24.8.0" - -"@jest/transform@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" - integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^24.8.0" - babel-plugin-istanbul "^5.1.0" - chalk "^2.0.1" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.15" - jest-haste-map "^24.8.0" - jest-regex-util "^24.3.0" - jest-util "^24.8.0" - micromatch "^3.1.10" - realpath-native "^1.1.0" - slash "^2.0.0" - source-map "^0.6.1" - write-file-atomic "2.4.1" - -"@jest/types@^24.7.0", "@jest/types@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" - integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^12.0.9" - -"@mrmlnc/readdir-enhanced@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" - integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== - dependencies: - call-me-maybe "^1.0.1" - glob-to-regexp "^0.3.0" - -"@nodelib/fs.stat@^1.1.2": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" - integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== - -"@svgr/babel-plugin-add-jsx-attribute@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz#dadcb6218503532d6884b210e7f3c502caaa44b1" - integrity sha512-j7KnilGyZzYr/jhcrSYS3FGWMZVaqyCG0vzMCwzvei0coIkczuYMcniK07nI0aHJINciujjH11T72ICW5eL5Ig== - -"@svgr/babel-plugin-remove-jsx-attribute@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-4.2.0.tgz#297550b9a8c0c7337bea12bdfc8a80bb66f85abc" - integrity sha512-3XHLtJ+HbRCH4n28S7y/yZoEQnRpl0tvTZQsHqvaeNXPra+6vE5tbRliH3ox1yZYPCxrlqaJT/Mg+75GpDKlvQ== - -"@svgr/babel-plugin-remove-jsx-empty-expression@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-4.2.0.tgz#c196302f3e68eab6a05e98af9ca8570bc13131c7" - integrity sha512-yTr2iLdf6oEuUE9MsRdvt0NmdpMBAkgK8Bjhl6epb+eQWk6abBaX3d65UZ3E3FWaOwePyUgNyNCMVG61gGCQ7w== - -"@svgr/babel-plugin-replace-jsx-attribute-value@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-4.2.0.tgz#310ec0775de808a6a2e4fd4268c245fd734c1165" - integrity sha512-U9m870Kqm0ko8beHawRXLGLvSi/ZMrl89gJ5BNcT452fAjtF2p4uRzXkdzvGJJJYBgx7BmqlDjBN/eCp5AAX2w== - -"@svgr/babel-plugin-svg-dynamic-title@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-4.2.0.tgz#43f0f689a5347a894160eb51b39a109889a4df20" - integrity sha512-gH2qItapwCUp6CCqbxvzBbc4dh4OyxdYKsW3EOkYexr0XUmQL0ScbdNh6DexkZ01T+sdClniIbnCObsXcnx3sQ== - -"@svgr/babel-plugin-svg-em-dimensions@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-4.2.0.tgz#9a94791c9a288108d20a9d2cc64cac820f141391" - integrity sha512-C0Uy+BHolCHGOZ8Dnr1zXy/KgpBOkEUYY9kI/HseHVPeMbluaX3CijJr7D4C5uR8zrc1T64nnq/k63ydQuGt4w== - -"@svgr/babel-plugin-transform-react-native-svg@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-4.2.0.tgz#151487322843359a1ca86b21a3815fd21a88b717" - integrity sha512-7YvynOpZDpCOUoIVlaaOUU87J4Z6RdD6spYN4eUb5tfPoKGSF9OG2NuhgYnq4jSkAxcpMaXWPf1cePkzmqTPNw== - -"@svgr/babel-plugin-transform-svg-component@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-4.2.0.tgz#5f1e2f886b2c85c67e76da42f0f6be1b1767b697" - integrity sha512-hYfYuZhQPCBVotABsXKSCfel2slf/yvJY8heTVX1PCTaq/IgASq1IyxPPKJ0chWREEKewIU/JMSsIGBtK1KKxw== - -"@svgr/babel-preset@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-4.2.0.tgz#c9fc236445a02a8cd4e750085e51c181de00d6c5" - integrity sha512-iLetHpRCQXfK47voAs5/uxd736cCyocEdorisjAveZo8ShxJ/ivSZgstBmucI1c8HyMF5tOrilJLoFbhpkPiKw== - dependencies: - "@svgr/babel-plugin-add-jsx-attribute" "^4.2.0" - "@svgr/babel-plugin-remove-jsx-attribute" "^4.2.0" - "@svgr/babel-plugin-remove-jsx-empty-expression" "^4.2.0" - "@svgr/babel-plugin-replace-jsx-attribute-value" "^4.2.0" - "@svgr/babel-plugin-svg-dynamic-title" "^4.2.0" - "@svgr/babel-plugin-svg-em-dimensions" "^4.2.0" - "@svgr/babel-plugin-transform-react-native-svg" "^4.2.0" - "@svgr/babel-plugin-transform-svg-component" "^4.2.0" - -"@svgr/core@^4.1.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/core/-/core-4.2.0.tgz#f32ef8b9d05312aaa775896ec30ae46a6521e248" - integrity sha512-nvzXaf2VavqjMCTTfsZfjL4o9035KedALkMzk82qOlHOwBb8JT+9+zYDgBl0oOunbVF94WTLnvGunEg0csNP3Q== - dependencies: - "@svgr/plugin-jsx" "^4.2.0" - camelcase "^5.3.1" - cosmiconfig "^5.2.0" - -"@svgr/hast-util-to-babel-ast@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.2.0.tgz#dd743435a5f3a8e84a1da067f27b5fae3d7b6b63" - integrity sha512-IvAeb7gqrGB5TH9EGyBsPrMRH/QCzIuAkLySKvH2TLfLb2uqk98qtJamordRQTpHH3e6TORfBXoTo7L7Opo/Ow== - dependencies: - "@babel/types" "^7.4.0" - -"@svgr/plugin-jsx@^4.1.0", "@svgr/plugin-jsx@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-4.2.0.tgz#15a91562c9b5f90640ea0bdcb2ad59d692ee7ae9" - integrity sha512-AM1YokmZITgveY9bulLVquqNmwiFo2Px2HL+IlnTCR01YvWDfRL5QKdnF7VjRaS5MNP938mmqvL0/8oz3zQMkg== - dependencies: - "@babel/core" "^7.4.3" - "@svgr/babel-preset" "^4.2.0" - "@svgr/hast-util-to-babel-ast" "^4.2.0" - rehype-parse "^6.0.0" - unified "^7.1.0" - vfile "^4.0.0" - -"@svgr/plugin-svgo@^4.0.3": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@svgr/plugin-svgo/-/plugin-svgo-4.2.0.tgz#2a594a2d3312955e75fd87dc77ae51f377c809f3" - integrity sha512-zUEKgkT172YzHh3mb2B2q92xCnOAMVjRx+o0waZ1U50XqKLrVQ/8dDqTAtnmapdLsGurv8PSwenjLCUpj6hcvw== - dependencies: - cosmiconfig "^5.2.0" - merge-deep "^3.0.2" - svgo "^1.2.1" - -"@svgr/webpack@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-4.1.0.tgz#20c88f32f731c7b1d4711045b2b993887d731c28" - integrity sha512-d09ehQWqLMywP/PT/5JvXwPskPK9QCXUjiSkAHehreB381qExXf5JFCBWhfEyNonRbkIneCeYM99w+Ud48YIQQ== - dependencies: - "@babel/core" "^7.1.6" - "@babel/plugin-transform-react-constant-elements" "^7.0.0" - "@babel/preset-env" "^7.1.6" - "@babel/preset-react" "^7.0.0" - "@svgr/core" "^4.1.0" - "@svgr/plugin-jsx" "^4.1.0" - "@svgr/plugin-svgo" "^4.0.3" - loader-utils "^1.1.0" - -"@types/babel__core@^7.1.0": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" - integrity sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" - integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" - integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" - integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== - dependencies: - "@babel/types" "^7.3.0" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" - integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== - -"@types/istanbul-lib-report@*": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" - integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" - integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== - dependencies: - "@types/istanbul-lib-coverage" "*" - "@types/istanbul-lib-report" "*" - -"@types/node@*": - version "12.0.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.0.tgz#d11813b9c0ff8aaca29f04cbc12817f4c7d656e5" - integrity sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg== - -"@types/q@^1.5.1": - version "1.5.2" - resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8" - integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== - -"@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== - -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" - integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== - -"@types/vfile-message@*": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a" - integrity sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA== - dependencies: - "@types/node" "*" - "@types/unist" "*" - -"@types/vfile@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/vfile/-/vfile-3.0.2.tgz#19c18cd232df11ce6fa6ad80259bc86c366b09b9" - integrity sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw== - dependencies: - "@types/node" "*" - "@types/unist" "*" - "@types/vfile-message" "*" - -"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": - version "12.0.12" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" - integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== - -"@typescript-eslint/eslint-plugin@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz#a5ff3128c692393fb16efa403ec7c8a5593dab0f" - integrity sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ== - dependencies: - "@typescript-eslint/parser" "1.6.0" - "@typescript-eslint/typescript-estree" "1.6.0" - requireindex "^1.2.0" - tsutils "^3.7.0" - -"@typescript-eslint/parser@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804" - integrity sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw== - dependencies: - "@typescript-eslint/typescript-estree" "1.6.0" - eslint-scope "^4.0.0" - eslint-visitor-keys "^1.0.0" - -"@typescript-eslint/typescript-estree@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0" - integrity sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA== - dependencies: - lodash.unescape "4.0.1" - semver "5.5.0" - -"@webassemblyjs/ast@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" - integrity sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ== - dependencies: - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/wast-parser" "1.8.5" - -"@webassemblyjs/floating-point-hex-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" - integrity sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ== - -"@webassemblyjs/helper-api-error@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" - integrity sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA== - -"@webassemblyjs/helper-buffer@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" - integrity sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q== - -"@webassemblyjs/helper-code-frame@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" - integrity sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ== - dependencies: - "@webassemblyjs/wast-printer" "1.8.5" - -"@webassemblyjs/helper-fsm@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" - integrity sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow== - -"@webassemblyjs/helper-module-context@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" - integrity sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g== - dependencies: - "@webassemblyjs/ast" "1.8.5" - mamacro "^0.0.3" - -"@webassemblyjs/helper-wasm-bytecode@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" - integrity sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ== - -"@webassemblyjs/helper-wasm-section@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" - integrity sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - -"@webassemblyjs/ieee754@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" - integrity sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" - integrity sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" - integrity sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw== - -"@webassemblyjs/wasm-edit@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" - integrity sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/helper-wasm-section" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - "@webassemblyjs/wasm-opt" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - "@webassemblyjs/wast-printer" "1.8.5" - -"@webassemblyjs/wasm-gen@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" - integrity sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/ieee754" "1.8.5" - "@webassemblyjs/leb128" "1.8.5" - "@webassemblyjs/utf8" "1.8.5" - -"@webassemblyjs/wasm-opt@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" - integrity sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-buffer" "1.8.5" - "@webassemblyjs/wasm-gen" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - -"@webassemblyjs/wasm-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" - integrity sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-api-error" "1.8.5" - "@webassemblyjs/helper-wasm-bytecode" "1.8.5" - "@webassemblyjs/ieee754" "1.8.5" - "@webassemblyjs/leb128" "1.8.5" - "@webassemblyjs/utf8" "1.8.5" - -"@webassemblyjs/wast-parser@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" - integrity sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/floating-point-hex-parser" "1.8.5" - "@webassemblyjs/helper-api-error" "1.8.5" - "@webassemblyjs/helper-code-frame" "1.8.5" - "@webassemblyjs/helper-fsm" "1.8.5" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/wast-printer@1.8.5": - version "1.8.5" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" - integrity sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/wast-parser" "1.8.5" - "@xtuc/long" "4.2.2" - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - -abab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" - integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -accepts@~1.3.4, accepts@~1.3.5: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - -acorn-globals@^4.1.0, acorn-globals@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" - integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== - dependencies: - acorn "^6.0.1" - acorn-walk "^6.0.1" - -acorn-jsx@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" - integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== - -acorn-walk@^6.0.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" - integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== - -acorn@^5.5.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== - -acorn@^6.0.1, acorn@^6.0.4, acorn@^6.0.5, acorn@^6.0.7: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" - integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== - -address@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9" - integrity sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg== - -address@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/address/-/address-1.1.0.tgz#ef8e047847fcd2c5b6f50c16965f924fd99fe709" - integrity sha512-4diPfzWbLEIElVG4AnqP+00SULlPzNuyJFNnmMrLgyaxG6tZXJ1sn7mjBu4fHrJE+Yp/jgylOweJn2xsLMFggQ== - -ajv-errors@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" - integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== - -ajv-keywords@^3.1.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" - integrity sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw== - -ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -alphanum-sort@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" - integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= - -ansi-colors@^3.0.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" - integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== - -ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-html@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" - integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.0.0, ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3, aproba@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -aria-query@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" - integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= - dependencies: - ast-types-flow "0.0.7" - commander "^2.11.0" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" - integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= - -array-filter@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" - integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-flatten@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" - integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== - -array-includes@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" - integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - -array-map@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" - integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= - -array-reduce@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" - integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -asap@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= - -asn1.js@^4.0.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -ast-types-flow@0.0.7, ast-types-flow@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" - integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -async@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -autoprefixer@^9.4.9: - version "9.5.1" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.5.1.tgz#243b1267b67e7e947f28919d786b50d3bb0fb357" - integrity sha512-KJSzkStUl3wP0D5sdMlP82Q52JLy5+atf2MHAre48+ckWkXgixmfHyWmA77wFDy6jTHU6mIgXv6hAQ2mf1PjJQ== - dependencies: - browserslist "^4.5.4" - caniuse-lite "^1.0.30000957" - normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^7.0.14" - postcss-value-parser "^3.3.1" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - -axobject-query@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" - integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== - dependencies: - ast-types-flow "0.0.7" - -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-eslint@10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" - integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" - -babel-extract-comments@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21" - integrity sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ== - dependencies: - babylon "^6.18.0" - -babel-jest@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" - integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== - dependencies: - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/babel__core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.6.0" - chalk "^2.4.2" - slash "^2.0.0" - -babel-loader@8.0.5: - version "8.0.5" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.5.tgz#225322d7509c2157655840bba52e46b6c2f2fe33" - integrity sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw== - dependencies: - find-cache-dir "^2.0.0" - loader-utils "^1.0.2" - mkdirp "^0.5.1" - util.promisify "^1.0.0" - -babel-plugin-dynamic-import-node@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz#c0adfb07d95f4a4495e9aaac6ec386c4d7c2524e" - integrity sha512-fP899ELUnTaBcIzmrW7nniyqqdYWrWuJUyPWHxFa/c7r7hS6KC8FscNfLlBNIoPSc55kYMGEEKjPjJGCLbE1qA== - dependencies: - object.assign "^4.1.0" - -babel-plugin-istanbul@^5.1.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" - integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== - dependencies: - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" - -babel-plugin-jest-hoist@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" - integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== - dependencies: - "@types/babel__traverse" "^7.0.6" - -babel-plugin-macros@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.5.1.tgz#4a119ac2c2e19b458c259b9accd7ee34fd57ec6f" - integrity sha512-xN3KhAxPzsJ6OQTktCanNpIFnnMsCV+t8OloKxIL72D6+SUZYFn9qfklPgef5HyyDtzYZqqb+fs1S12+gQY82Q== - dependencies: - "@babel/runtime" "^7.4.2" - cosmiconfig "^5.2.0" - resolve "^1.10.0" - -babel-plugin-named-asset-import@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.2.tgz#20978ed446b8e1bf4a2f42d0a94c0ece85f75f4f" - integrity sha512-CxwvxrZ9OirpXQ201Ec57OmGhmI8/ui/GwTDy0hSp6CmRvgRC0pSair6Z04Ck+JStA0sMPZzSJ3uE4n17EXpPQ== - -babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" - integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= - -babel-plugin-transform-object-rest-spread@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" - -babel-plugin-transform-react-remove-prop-types@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" - integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== - -babel-preset-jest@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" - integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== - dependencies: - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.6.0" - -babel-preset-react-app@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-react-app/-/babel-preset-react-app-9.0.0.tgz#703108142bc9dd7173bde6a1a0138a762abc76f9" - integrity sha512-YVsDA8HpAKklhFLJtl9+AgaxrDaor8gGvDFlsg1ByOS0IPGUovumdv4/gJiAnLcDmZmKlH6+9sVOz4NVW7emAg== - dependencies: - "@babel/core" "7.4.3" - "@babel/plugin-proposal-class-properties" "7.4.0" - "@babel/plugin-proposal-decorators" "7.4.0" - "@babel/plugin-proposal-object-rest-spread" "7.4.3" - "@babel/plugin-syntax-dynamic-import" "7.2.0" - "@babel/plugin-transform-classes" "7.4.3" - "@babel/plugin-transform-destructuring" "7.4.3" - "@babel/plugin-transform-flow-strip-types" "7.4.0" - "@babel/plugin-transform-react-constant-elements" "7.2.0" - "@babel/plugin-transform-react-display-name" "7.2.0" - "@babel/plugin-transform-runtime" "7.4.3" - "@babel/preset-env" "7.4.3" - "@babel/preset-react" "7.0.0" - "@babel/preset-typescript" "7.3.3" - "@babel/runtime" "7.4.3" - babel-plugin-dynamic-import-node "2.2.0" - babel-plugin-macros "2.5.1" - babel-plugin-transform-react-remove-prop-types "0.4.24" - -babel-runtime@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babylon@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" - integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== - -bail@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b" - integrity sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -batch@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -bluebird@^3.5.3: - version "3.5.4" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" - integrity sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw== - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== - -body-parser@1.18.3: - version "1.18.3" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" - integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ= - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "~1.6.3" - iconv-lite "0.4.23" - on-finished "~2.3.0" - qs "6.5.2" - raw-body "2.3.3" - type-is "~1.6.16" - -bonjour@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" - integrity sha1-jokKGD2O6aI5OzhExpGkK897yfU= - dependencies: - array-flatten "^2.1.0" - deep-equal "^1.0.1" - dns-equal "^1.0.0" - dns-txt "^2.0.2" - multicast-dns "^6.0.1" - multicast-dns-service-types "^1.1.0" - -boolbase@^1.0.0, boolbase@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-process-hrtime@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" - integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== - -browser-resolve@^1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - -browserslist@4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.4.tgz#166c4ecef3b51737a42436ea8002aeea466ea2c7" - integrity sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag== - dependencies: - caniuse-lite "^1.0.30000955" - electron-to-chromium "^1.3.122" - node-releases "^1.1.13" - -browserslist@^4.0.0, browserslist@^4.1.1, browserslist@^4.4.2, browserslist@^4.5.2, browserslist@^4.5.4: - version "4.5.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.5.6.tgz#ea42e8581ca2513fa7f371d4dd66da763938163d" - integrity sha512-o/hPOtbU9oX507lIqon+UvPYqpx3mHc8cV3QemSBTXwkG8gSQSK6UKvXcE/DcleU3+A59XTUHyCvZ5qGy8xVAg== - dependencies: - caniuse-lite "^1.0.30000963" - electron-to-chromium "^1.3.127" - node-releases "^1.1.17" - -bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" - integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== - -buffer-indexof@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" - integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cacache@^11.0.2: - version "11.3.2" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" - integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== - dependencies: - bluebird "^3.5.3" - chownr "^1.1.1" - figgy-pudding "^3.5.1" - glob "^7.1.3" - graceful-fs "^4.1.15" - lru-cache "^5.1.1" - mississippi "^3.0.0" - mkdirp "^0.5.1" - move-concurrently "^1.0.1" - promise-inflight "^1.0.1" - rimraf "^2.6.2" - ssri "^6.0.1" - unique-filename "^1.1.1" - y18n "^4.0.0" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" - integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= - -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camel-case@3.0.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" - integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= - dependencies: - no-case "^2.2.0" - upper-case "^1.1.1" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.2.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -caniuse-api@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" - integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== - dependencies: - browserslist "^4.0.0" - caniuse-lite "^1.0.0" - lodash.memoize "^4.1.2" - lodash.uniq "^4.5.0" - -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000939, caniuse-lite@^1.0.30000955, caniuse-lite@^1.0.30000957, caniuse-lite@^1.0.30000963: - version "1.0.30000967" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz#a5039577806fccee80a04aaafb2c0890b1ee2f73" - integrity sha512-rUBIbap+VJfxTzrM4akJ00lkvVb5/n5v3EGXfWzSH5zT8aJmGzjA8HWhJ4U6kCpzxozUSnB+yvAYDRPY6mRpgQ== - -capture-exit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" - integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== - dependencies: - rsvp "^4.8.4" - -case-sensitive-paths-webpack-plugin@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz#3371ef6365ef9c25fa4b81c16ace0e9c7dc58c3e" - integrity sha512-u5ElzokS8A1pm9vM3/iDgTcI3xqHxuCao94Oz8etI3cf0Tio0p8izkDYbTIn09uP3yUUr6+veaE6IkjnTYS46g== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -ccount@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386" - integrity sha512-fpZ81yYfzentuieinmGnphk0pLkOTMm6MZdVqwd77ROvhko6iujLNGrHH5E7utq3ygWklwfmwuG+A7P+NpqT6w== - -chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d" - integrity sha512-i0TprVWp+Kj4WRPtInjexJ8Q+BqTE909VpH8xVhXrJkoc5QC8VO9TryGOqTr+2hljzc1sC62t22h5tZePodM/A== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== - -chrome-trace-event@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48" - integrity sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A== - dependencies: - tslib "^1.9.0" - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -clean-css@4.2.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" - integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== - dependencies: - source-map "~0.6.0" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -clone-deep@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-0.2.4.tgz#4e73dd09e9fb971cc38670c5dced9c1896481cc6" - integrity sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY= - dependencies: - for-own "^0.1.3" - is-plain-object "^2.0.1" - kind-of "^3.0.2" - lazy-cache "^1.0.3" - shallow-clone "^0.1.2" - -clone-deep@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" - integrity sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ== - dependencies: - for-own "^1.0.0" - is-plain-object "^2.0.4" - kind-of "^6.0.0" - shallow-clone "^1.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -coa@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/coa/-/coa-2.0.2.tgz#43f6c21151b4ef2bf57187db0d73de229e3e7ec3" - integrity sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA== - dependencies: - "@types/q" "^1.5.1" - chalk "^2.4.1" - q "^1.1.2" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0, color-convert@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-string@^1.5.2: - version "1.5.3" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.3.tgz#c9bbc5f01b58b5492f3d6857459cb6590ce204cc" - integrity sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - -color@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/color/-/color-3.1.1.tgz#7abf5c0d38e89378284e873c207ae2172dcc8a61" - integrity sha512-PvUltIXRjehRKPSy89VnDWFKY58xyhTLyxIg21vwQBI6qLwZNPmC8k3C1uytIgFKEpOIzN4y32iPm8231zFHIg== - dependencies: - color-convert "^1.9.1" - color-string "^1.5.2" - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== - dependencies: - delayed-stream "~1.0.0" - -comma-separated-tokens@^1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.6.tgz#3cd3d8adc725ab473843db338bcdfd4a7bb087bf" - integrity sha512-f20oA7jsrrmERTS70r3tmRSxR8IJV2MTN7qe6hzgX+3ARfXrdMJFvGWvWQK0xpcBurg9j9eO2MiqzZ8Y+/UPCA== - -commander@2.17.x: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== - -commander@^2.11.0, commander@^2.19.0, commander@~2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== - -commander@~2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== - -common-tags@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" - integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -compressible@~2.0.16: - version "2.0.17" - resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.17.tgz#6e8c108a16ad58384a977f3a482ca20bff2f38c1" - integrity sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw== - dependencies: - mime-db ">= 1.40.0 < 2" - -compression@^1.5.2: - version "1.7.4" - resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" - integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== - dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.16" - debug "2.6.9" - on-headers "~1.0.2" - safe-buffer "5.1.2" - vary "~1.1.2" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.5.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -confusing-browser-globals@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.7.tgz#5ae852bd541a910e7ffb2dbb864a2d21a36ad29b" - integrity sha512-cgHI1azax5ATrZ8rJ+ODDML9Fvu67PimB6aNxBrc/QwSaDaM9eTfIEUHx3bBLJJ82ioSb+/5zfsMCCEJax3ByQ== - -connect-history-api-fallback@^1.3.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== - -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= - dependencies: - date-now "^0.1.4" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= - -content-disposition@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.1.0, convert-source-map@^1.4.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - -copy-concurrently@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" - integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== - dependencies: - aproba "^1.1.1" - fs-write-stream-atomic "^1.0.8" - iferr "^0.1.5" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.0" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js-compat@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.0.1.tgz#bff73ba31ca8687431b9c88f78d3362646fb76f0" - integrity sha512-2pC3e+Ht/1/gD7Sim/sqzvRplMiRnFQVlPpDVaHtY9l7zZP7knamr3VRD6NyGfHd84MrDC0tAM9ulNxYMW0T3g== - dependencies: - browserslist "^4.5.4" - core-js "3.0.1" - core-js-pure "3.0.1" - semver "^6.0.0" - -core-js-pure@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.0.1.tgz#37358fb0d024e6b86d443d794f4e37e949098cbe" - integrity sha512-mSxeQ6IghKW3MoyF4cz19GJ1cMm7761ON+WObSyLfTu/Jn3x7w4NwNFnrZxgl4MTSvYYepVLNuRtlB4loMwJ5g== - -core-js@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738" - integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew== - -core-js@^2.4.0: - version "2.6.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" - integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cosmiconfig@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" - integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== - dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^4.0.0" - require-from-string "^2.0.1" - -cosmiconfig@^5.0.0, cosmiconfig@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.0.tgz#45038e4d28a7fe787203aede9c25bca4a08b12c8" - integrity sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.0" - parse-json "^4.0.0" - -create-ecdh@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" - integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -css-blank-pseudo@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" - integrity sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w== - dependencies: - postcss "^7.0.5" - -css-color-names@0.0.4, css-color-names@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" - integrity sha1-gIrcLnnPhHOAabZGyyDsJ762KeA= - -css-declaration-sorter@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz#c198940f63a76d7e36c1e71018b001721054cb22" - integrity sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA== - dependencies: - postcss "^7.0.1" - timsort "^0.3.0" - -css-has-pseudo@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz#3c642ab34ca242c59c41a125df9105841f6966ee" - integrity sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ== - dependencies: - postcss "^7.0.6" - postcss-selector-parser "^5.0.0-rc.4" - -css-loader@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-2.1.1.tgz#d8254f72e412bb2238bb44dd674ffbef497333ea" - integrity sha512-OcKJU/lt232vl1P9EEDamhoO9iKY3tIjY5GU+XDLblAykTdgs6Ux9P1hTHve8nFKy5KPpOXOsVI/hIwi3841+w== - dependencies: - camelcase "^5.2.0" - icss-utils "^4.1.0" - loader-utils "^1.2.3" - normalize-path "^3.0.0" - postcss "^7.0.14" - postcss-modules-extract-imports "^2.0.0" - postcss-modules-local-by-default "^2.0.6" - postcss-modules-scope "^2.1.0" - postcss-modules-values "^2.0.0" - postcss-value-parser "^3.3.0" - schema-utils "^1.0.0" - -css-prefers-color-scheme@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" - integrity sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg== - dependencies: - postcss "^7.0.5" - -css-select-base-adapter@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7" - integrity sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w== - -css-select@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" - integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= - dependencies: - boolbase "~1.0.0" - css-what "2.1" - domutils "1.5.1" - nth-check "~1.0.1" - -css-select@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-2.0.2.tgz#ab4386cec9e1f668855564b17c3733b43b2a5ede" - integrity sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ== - dependencies: - boolbase "^1.0.0" - css-what "^2.1.2" - domutils "^1.7.0" - nth-check "^1.0.2" - -css-tree@1.0.0-alpha.28: - version "1.0.0-alpha.28" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.28.tgz#8e8968190d886c9477bc8d61e96f61af3f7ffa7f" - integrity sha512-joNNW1gCp3qFFzj4St6zk+Wh/NBv0vM5YbEreZk0SD4S23S+1xBKb6cLDg2uj4P4k/GUMlIm6cKIDqIG+vdt0w== - dependencies: - mdn-data "~1.1.0" - source-map "^0.5.3" - -css-tree@1.0.0-alpha.29: - version "1.0.0-alpha.29" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39" - integrity sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg== - dependencies: - mdn-data "~1.1.0" - source-map "^0.5.3" - -css-unit-converter@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996" - integrity sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY= - -css-url-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/css-url-regex/-/css-url-regex-1.1.0.tgz#83834230cc9f74c457de59eebd1543feeb83b7ec" - integrity sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w= - -css-what@2.1, css-what@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" - integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== - -cssdb@^4.3.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-4.4.0.tgz#3bf2f2a68c10f5c6a08abd92378331ee803cddb0" - integrity sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ== - -cssesc@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" - integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== - -cssesc@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" - integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== - -cssnano-preset-default@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz#51ec662ccfca0f88b396dcd9679cdb931be17f76" - integrity sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA== - dependencies: - css-declaration-sorter "^4.0.1" - cssnano-util-raw-cache "^4.0.1" - postcss "^7.0.0" - postcss-calc "^7.0.1" - postcss-colormin "^4.0.3" - postcss-convert-values "^4.0.1" - postcss-discard-comments "^4.0.2" - postcss-discard-duplicates "^4.0.2" - postcss-discard-empty "^4.0.1" - postcss-discard-overridden "^4.0.1" - postcss-merge-longhand "^4.0.11" - postcss-merge-rules "^4.0.3" - postcss-minify-font-values "^4.0.2" - postcss-minify-gradients "^4.0.2" - postcss-minify-params "^4.0.2" - postcss-minify-selectors "^4.0.2" - postcss-normalize-charset "^4.0.1" - postcss-normalize-display-values "^4.0.2" - postcss-normalize-positions "^4.0.2" - postcss-normalize-repeat-style "^4.0.2" - postcss-normalize-string "^4.0.2" - postcss-normalize-timing-functions "^4.0.2" - postcss-normalize-unicode "^4.0.1" - postcss-normalize-url "^4.0.1" - postcss-normalize-whitespace "^4.0.2" - postcss-ordered-values "^4.1.2" - postcss-reduce-initial "^4.0.3" - postcss-reduce-transforms "^4.0.2" - postcss-svgo "^4.0.2" - postcss-unique-selectors "^4.0.1" - -cssnano-util-get-arguments@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" - integrity sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8= - -cssnano-util-get-match@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz#c0e4ca07f5386bb17ec5e52250b4f5961365156d" - integrity sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0= - -cssnano-util-raw-cache@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz#b26d5fd5f72a11dfe7a7846fb4c67260f96bf282" - integrity sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA== - dependencies: - postcss "^7.0.0" - -cssnano-util-same-parent@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3" - integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q== - -cssnano@^4.1.0: - version "4.1.10" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2" - integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ== - dependencies: - cosmiconfig "^5.0.0" - cssnano-preset-default "^4.0.7" - is-resolvable "^1.0.0" - postcss "^7.0.0" - -csso@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/csso/-/csso-3.5.1.tgz#7b9eb8be61628973c1b261e169d2f024008e758b" - integrity sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg== - dependencies: - css-tree "1.0.0-alpha.29" - -cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0", cssom@^0.3.4: - version "0.3.6" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" - integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== - -cssstyle@^1.0.0, cssstyle@^1.1.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" - integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== - dependencies: - cssom "0.3.x" - -cyclist@~0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" - integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= - -damerau-levenshtein@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" - integrity sha1-AxkcQyy27qFou3fzpV/9zLiXhRQ= - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -data-urls@^1.0.0, data-urls@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" - integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== - dependencies: - abab "^2.0.0" - whatwg-mimetype "^2.2.0" - whatwg-url "^7.0.0" - -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.2.5, debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decamelize@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" - integrity sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg== - dependencies: - xregexp "4.0.0" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deep-equal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -default-gateway@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b" - integrity sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA== - dependencies: - execa "^1.0.0" - ip-regex "^2.1.0" - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -del@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" - integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU= - dependencies: - globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -detect-newline@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= - -detect-node@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" - integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== - -detect-port-alt@1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" - integrity sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q== - dependencies: - address "^1.0.1" - debug "^2.6.0" - -diff-sequences@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" - integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dir-glob@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" - integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== - dependencies: - arrify "^1.0.1" - path-type "^3.0.0" - -dns-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" - integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= - -dns-packet@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" - integrity sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg== - dependencies: - ip "^1.1.0" - safe-buffer "^5.0.1" - -dns-txt@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" - integrity sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY= - dependencies: - buffer-indexof "^1.0.0" - -doctrine@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dom-converter@^0.2: - version "0.2.0" - resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" - integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== - dependencies: - utila "~0.4" - -dom-serializer@0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" - integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== - dependencies: - domelementtype "^1.3.0" - entities "^1.1.1" - -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - -domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - -domexception@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" - integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== - dependencies: - webidl-conversions "^4.0.2" - -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" - -domutils@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= - dependencies: - dom-serializer "0" - domelementtype "1" - -domutils@^1.5.1, domutils@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" - integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== - dependencies: - dom-serializer "0" - domelementtype "1" - -dot-prop@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== - dependencies: - is-obj "^1.0.0" - -dotenv-expand@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-4.2.0.tgz#def1f1ca5d6059d24a766e587942c21106ce1275" - integrity sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU= - -dotenv@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" - integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== - -duplexer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= - -duplexify@^3.4.2, duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.3.122, electron-to-chromium@^1.3.127: - version "1.3.133" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.133.tgz#c47639c19b91feee3e22fad69f5556142007008c" - integrity sha512-lyoC8aoqbbDqsprb6aPdt9n3DpOZZzdz/T4IZKsR0/dkZIxnJVUjjcpOSwA66jPRIOyDAamCTAUqweU05kKNSg== - -elliptic@^6.0.0: - version "6.4.1" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" - integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emoji-regex@^7.0.1, emoji-regex@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - -enhanced-resolve@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" - integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - tapable "^1.0.0" - -entities@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" - integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== - -errno@^0.1.3, errno@~0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" - integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-keys "^1.0.12" - -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escodegen@^1.11.0, escodegen@^1.9.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" - integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -eslint-config-react-app@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-4.0.1.tgz#23fd0fd7ea89442ef1e733f66a7207674b23c8db" - integrity sha512-ZsaoXUIGsK8FCi/x4lT2bZR5mMkL/Kgj+Lnw690rbvvUr/uiwgFiD8FcfAhkCycm7Xte6O5lYz4EqMx2vX7jgw== - dependencies: - confusing-browser-globals "^1.0.7" - -eslint-import-resolver-node@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" - integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== - dependencies: - debug "^2.6.9" - resolve "^1.5.0" - -eslint-loader@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eslint-loader/-/eslint-loader-2.1.2.tgz#453542a1230d6ffac90e4e7cb9cadba9d851be68" - integrity sha512-rA9XiXEOilLYPOIInvVH5S/hYfyTPyxag6DZhoQOduM+3TkghAEQ3VcFO8VnX4J4qg/UIBzp72aOf/xvYmpmsg== - dependencies: - loader-fs-cache "^1.0.0" - loader-utils "^1.0.2" - object-assign "^4.0.1" - object-hash "^1.1.4" - rimraf "^2.6.1" - -eslint-module-utils@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" - integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== - dependencies: - debug "^2.6.8" - pkg-dir "^2.0.0" - -eslint-plugin-flowtype@2.50.1: - version "2.50.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.1.tgz#36d4c961ac8b9e9e1dc091d3fba0537dad34ae8a" - integrity sha512-9kRxF9hfM/O6WGZcZPszOVPd2W0TLHBtceulLTsGfwMPtiCCLnCW0ssRiOOiXyqrCA20pm1iXdXm7gQeN306zQ== - dependencies: - lodash "^4.17.10" - -eslint-plugin-import@2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f" - integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A== - dependencies: - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.3.0" - has "^1.0.3" - lodash "^4.17.11" - minimatch "^3.0.4" - read-pkg-up "^2.0.0" - resolve "^1.9.0" - -eslint-plugin-jsx-a11y@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c" - integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w== - dependencies: - aria-query "^3.0.0" - array-includes "^3.0.3" - ast-types-flow "^0.0.7" - axobject-query "^2.0.2" - damerau-levenshtein "^1.0.4" - emoji-regex "^7.0.2" - has "^1.0.3" - jsx-ast-utils "^2.0.1" - -eslint-plugin-react-hooks@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.0.tgz#348efcda8fb426399ac7b8609607c7b4025a6f5f" - integrity sha512-lHBVRIaz5ibnIgNG07JNiAuBUeKhEf8l4etNx5vfAEwqQ5tcuK3jV9yjmopPgQDagQb7HwIuQVsE3IVcGrRnag== - -eslint-plugin-react@7.12.4: - version "7.12.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c" - integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ== - dependencies: - array-includes "^3.0.3" - doctrine "^2.1.0" - has "^1.0.3" - jsx-ast-utils "^2.0.1" - object.fromentries "^2.0.0" - prop-types "^15.6.2" - resolve "^1.9.0" - -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^4.0.0, eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" - integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== - -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== - -eslint@^5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^5.0.1" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" - text-table "^0.2.0" - -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== - dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - -esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= - -esutils@^2.0.0, esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eventemitter3@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" - integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== - -events@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" - integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== - -eventsource@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" - integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== - dependencies: - original "^1.0.0" - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -exec-sh@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" - integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expect@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" - integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== - dependencies: - "@jest/types" "^24.8.0" - ansi-styles "^3.2.0" - jest-get-type "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-regex-util "^24.3.0" - -express@^4.16.2: - version "4.16.4" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e" - integrity sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg== - dependencies: - accepts "~1.3.5" - array-flatten "1.1.1" - body-parser "1.18.3" - content-disposition "0.5.2" - content-type "~1.0.4" - cookie "0.3.1" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.1.1" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.2" - path-to-regexp "0.1.7" - proxy-addr "~2.0.4" - qs "6.5.2" - range-parser "~1.2.0" - safe-buffer "5.1.2" - send "0.16.2" - serve-static "1.13.2" - setprototypeof "1.1.0" - statuses "~1.4.0" - type-is "~1.6.16" - utils-merge "1.0.1" - vary "~1.1.2" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0, extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-glob@^2.0.2: - version "2.2.6" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.6.tgz#a5d5b697ec8deda468d85a74035290a025a95295" - integrity sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w== - dependencies: - "@mrmlnc/readdir-enhanced" "^2.2.1" - "@nodelib/fs.stat" "^1.1.2" - glob-parent "^3.1.0" - is-glob "^4.0.0" - merge2 "^1.2.3" - micromatch "^3.1.10" - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -faye-websocket@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" - integrity sha1-TkkvjQTftviQA1B/btvy1QHnxvQ= - dependencies: - websocket-driver ">=0.5.1" - -faye-websocket@~0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.1.tgz#f0efe18c4f56e4f40afc7e06c719fd5ee6188f38" - integrity sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg= - dependencies: - websocket-driver ">=0.5.1" - -fb-watchman@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" - integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= - dependencies: - bser "^2.0.0" - -figgy-pudding@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" - integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -file-loader@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-3.0.1.tgz#f8e0ba0b599918b51adfe45d66d1e771ad560faa" - integrity sha512-4sNIOXgtH/9WZq4NvlfU3Opn5ynUsqBwSLyM+I7UOwdGigTBYfVVQEwe/msZNX/j4pCJTIM14Fsw66Svo1oVrw== - dependencies: - loader-utils "^1.0.2" - schema-utils "^1.0.0" - -filesize@3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" - integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105" - integrity sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.4.0" - unpipe "~1.0.0" - -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - integrity sha1-yN765XyKUqinhPnjHFfHQumToLk= - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - -find-cache-dir@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" - integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== - dependencies: - commondir "^1.0.1" - make-dir "^2.0.0" - pkg-dir "^3.0.0" - -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== - -flatten@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" - integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= - -flush-write-stream@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" - -follow-redirects@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76" - integrity sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ== - dependencies: - debug "^3.2.6" - -for-in@^0.1.3: - version "0.1.8" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" - integrity sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE= - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= - dependencies: - for-in "^1.0.1" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -fork-ts-checker-webpack-plugin@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.1.1.tgz#caf2a210778fb1e171b6993ca0a40f9b6589e3b7" - integrity sha512-gqWAEMLlae/oeVnN6RWCAhesOJMswAN1MaKNqhhjXHV5O0/rTUjWI4UbgQHdlrVbCnb+xLotXmJbBlC66QmpFw== - dependencies: - babel-code-frame "^6.22.0" - chalk "^2.4.1" - chokidar "^2.0.4" - micromatch "^3.1.10" - minimatch "^3.0.4" - semver "^5.6.0" - tapable "^1.0.0" - worker-rpc "^0.1.0" - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -from2@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.0" - -fs-extra@7.0.1, fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" - integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" - -fs-write-stream-atomic@^1.0.8: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" - integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= - dependencies: - graceful-fs "^4.1.2" - iferr "^0.1.5" - imurmurhash "^0.1.4" - readable-stream "1 || 2" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.6.tgz#87b19df0bfb4a1a51d7ddb51b01b5f3bedb40c33" - integrity sha512-vfmKZp3XPM36DNF0qhW+Cdxk7xm7gTEHY1clv1Xq1arwRQuKZgAhw+NZNWbJBtuaNxzNXwhfdPYRrvIbjfS33A== - -fsevents@^1.2.7: - version "1.2.9" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" - integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== - dependencies: - nan "^2.12.1" - node-pre-gyp "^0.12.0" - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" - integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-to-regexp@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" - integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= - -glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-modules@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" - integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== - dependencies: - global-prefix "^3.0.0" - -global-prefix@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" - integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== - dependencies: - ini "^1.3.5" - kind-of "^6.0.2" - which "^1.3.1" - -globals@^11.1.0, globals@^11.7.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globby@8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" - integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== - dependencies: - array-union "^1.0.1" - dir-glob "2.0.0" - fast-glob "^2.0.2" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" - -globby@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= - dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -growly@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" - integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= - -gzip-size@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.0.0.tgz#a55ecd99222f4c48fd8c01c625ce3b349d0a0e80" - integrity sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA== - dependencies: - duplexer "^0.1.1" - pify "^3.0.0" - -handle-thing@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" - integrity sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ== - -handlebars@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" - integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== - dependencies: - neo-async "^2.6.0" - optimist "^0.6.1" - source-map "^0.6.1" - optionalDependencies: - uglify-js "^3.1.4" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - -harmony-reflect@^1.4.6: - version "1.6.1" - resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.6.1.tgz#c108d4f2bb451efef7a37861fdbdae72c9bdefa9" - integrity sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA== - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.0, has@^1.0.1, has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -hast-util-from-parse5@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-5.0.0.tgz#a505a05766e0f96e389bfb0b1dd809eeefcef47b" - integrity sha512-A7ev5OseS/J15214cvDdcI62uwovJO2PB60Xhnq7kaxvvQRFDEccuqbkrFXU03GPBGopdPqlpQBRqIcDS/Fjbg== - dependencies: - ccount "^1.0.3" - hastscript "^5.0.0" - property-information "^5.0.0" - web-namespaces "^1.1.2" - xtend "^4.0.1" - -hast-util-parse-selector@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.1.tgz#4ddbae1ae12c124e3eb91b581d2556441766f0ab" - integrity sha512-Xyh0v+nHmQvrOqop2Jqd8gOdyQtE8sIP9IQf7mlVDqp924W4w/8Liuguk2L2qei9hARnQSG2m+wAOCxM7npJVw== - -hastscript@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.0.0.tgz#fee10382c1bc4ba3f1be311521d368c047d2c43a" - integrity sha512-xJtuJ8D42Xtq5yJrnDg/KAIxl2cXBXKoiIJwmWX9XMf8113qHTGl/Bf7jEsxmENJ4w6q4Tfl8s/Y6mEZo8x8qw== - dependencies: - comma-separated-tokens "^1.0.0" - hast-util-parse-selector "^2.2.0" - property-information "^5.0.1" - space-separated-tokens "^1.0.0" - -he@1.2.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hex-color-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" - integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== - -hpack.js@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" - integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= - dependencies: - inherits "^2.0.1" - obuf "^1.0.0" - readable-stream "^2.0.1" - wbuf "^1.1.0" - -hsl-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" - integrity sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4= - -hsla-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" - integrity sha1-wc56MWjIxmFAM6S194d/OyJfnDg= - -html-comment-regex@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" - integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== - -html-encoding-sniffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" - integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== - dependencies: - whatwg-encoding "^1.0.1" - -html-entities@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" - integrity sha1-DfKTUfByEWNRXfueVUPl9u7VFi8= - -html-minifier@^3.5.20: - version "3.5.21" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" - integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== - dependencies: - camel-case "3.0.x" - clean-css "4.2.x" - commander "2.17.x" - he "1.2.x" - param-case "2.1.x" - relateurl "0.2.x" - uglify-js "3.4.x" - -html-webpack-plugin@4.0.0-beta.5: - version "4.0.0-beta.5" - resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513" - integrity sha512-y5l4lGxOW3pz3xBTFdfB9rnnrWRPVxlAhX6nrBYIcW+2k2zC3mSp/3DxlWVCMBfnO6UAnoF8OcFn0IMy6kaKAQ== - dependencies: - html-minifier "^3.5.20" - loader-utils "^1.1.0" - lodash "^4.17.11" - pretty-error "^2.1.1" - tapable "^1.1.0" - util.promisify "1.0.0" - -htmlparser2@^3.3.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" - integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== - dependencies: - domelementtype "^1.3.1" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^3.1.1" - -http-deceiver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" - integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= - -http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-parser-js@>=0.4.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.0.tgz#d65edbede84349d0dc30320815a15d39cc3cbbd8" - integrity sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w== - -http-proxy-middleware@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a" - integrity sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q== - dependencies: - http-proxy "^1.17.0" - is-glob "^4.0.0" - lodash "^4.17.11" - micromatch "^3.1.10" - -http-proxy@^1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - integrity sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g== - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -icss-replace-symbols@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" - integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= - -icss-utils@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-4.1.0.tgz#339dbbffb9f8729a243b701e1c29d4cc58c52f0e" - integrity sha512-3DEun4VOeMvSczifM3F2cKQrDQ5Pj6WKhkOq6HD4QTnDUAq8MQRxy5TX6Sy1iY6WPBe4gQ3p5vTECjbIkglkkQ== - dependencies: - postcss "^7.0.14" - -identity-obj-proxy@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" - integrity sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ= - dependencies: - harmony-reflect "^1.4.6" - -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - -iferr@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" - integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - -ignore@^3.3.5: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -immer@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" - integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg== - -import-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" - integrity sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk= - dependencies: - import-from "^2.1.0" - -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - -import-fresh@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" - integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-from@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" - integrity sha1-M1238qev/VOqpHHUuAId7ja387E= - dependencies: - resolve-from "^3.0.0" - -import-local@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" - integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== - dependencies: - pkg-dir "^3.0.0" - resolve-cwd "^2.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indexes-of@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - -ini@^1.3.5, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -inquirer@6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" - integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.11" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.0.0" - through "^2.3.6" - -inquirer@^6.2.2: - version "6.3.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" - integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.11" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - -internal-ip@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" - integrity sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg== - dependencies: - default-gateway "^4.2.0" - ipaddr.js "^1.9.0" - -invariant@^2.2.2, invariant@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - -ip-regex@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" - integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= - -ip@^1.1.0, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - -ipaddr.js@1.9.0, ipaddr.js@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" - integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== - -is-absolute-url@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" - integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY= - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.0.2, is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" - integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== - -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-color-stop@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" - integrity sha1-z/9HGu5N1cnhWFmPvhKWe1za00U= - dependencies: - css-color-names "^0.0.4" - hex-color-regex "^1.1.0" - hsl-regex "^1.0.0" - hsla-regex "^1.0.0" - rgb-regex "^1.0.1" - rgba-regex "^1.0.0" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-obj@^1.0.0, is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= - -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= - dependencies: - path-is-inside "^1.0.1" - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= - dependencies: - has "^1.0.1" - -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= - -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== - -is-root@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.0.0.tgz#838d1e82318144e5a6f77819d90207645acc7019" - integrity sha512-F/pJIk8QD6OX5DNhRB7hWamLsUilmkDGho48KbgZ6xg/lmAZXHxzXQ91jzB3yRSw5kdQGGGc4yz8HYhTYIMWPg== - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-svg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" - integrity sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ== - dependencies: - html-comment-regex "^1.1.0" - -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== - dependencies: - has-symbols "^1.0.0" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= - -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - -istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" - -istanbul-lib-report@^2.0.4: - version "2.0.8" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" - integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== - dependencies: - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - supports-color "^6.1.0" - -istanbul-lib-source-maps@^3.0.1: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" - source-map "^0.6.1" - -istanbul-reports@^2.1.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.4.tgz#4e0d0ddf0f0ad5b49a314069d31b4f06afe49ad3" - integrity sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w== - dependencies: - handlebars "^4.1.2" - -jest-changed-files@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" - integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== - dependencies: - "@jest/types" "^24.8.0" - execa "^1.0.0" - throat "^4.0.0" - -jest-cli@^24.7.1: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" - integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== - dependencies: - "@jest/core" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - chalk "^2.0.1" - exit "^0.1.2" - import-local "^2.0.0" - is-ci "^2.0.0" - jest-config "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" - prompts "^2.0.1" - realpath-native "^1.1.0" - yargs "^12.0.2" - -jest-config@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" - integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== - dependencies: - "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.8.0" - "@jest/types" "^24.8.0" - babel-jest "^24.8.0" - chalk "^2.0.1" - glob "^7.1.1" - jest-environment-jsdom "^24.8.0" - jest-environment-node "^24.8.0" - jest-get-type "^24.8.0" - jest-jasmine2 "^24.8.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" - micromatch "^3.1.10" - pretty-format "^24.8.0" - realpath-native "^1.1.0" - -jest-diff@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" - integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== - dependencies: - chalk "^2.0.1" - diff-sequences "^24.3.0" - jest-get-type "^24.8.0" - pretty-format "^24.8.0" - -jest-docblock@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" - integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== - dependencies: - detect-newline "^2.1.0" - -jest-each@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" - integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== - dependencies: - "@jest/types" "^24.8.0" - chalk "^2.0.1" - jest-get-type "^24.8.0" - jest-util "^24.8.0" - pretty-format "^24.8.0" - -jest-environment-jsdom-fourteen@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom-fourteen/-/jest-environment-jsdom-fourteen-0.1.0.tgz#aad6393a9d4b565b69a609109bf469f62bf18ccc" - integrity sha512-4vtoRMg7jAstitRzL4nbw83VmGH8Rs13wrND3Ud2o1fczDhMUF32iIrNKwYGgeOPUdfvZU4oy8Bbv+ni1fgVCA== - dependencies: - jest-mock "^24.5.0" - jest-util "^24.5.0" - jsdom "^14.0.0" - -jest-environment-jsdom@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" - integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== - dependencies: - "@jest/environment" "^24.8.0" - "@jest/fake-timers" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - jest-util "^24.8.0" - jsdom "^11.5.1" - -jest-environment-node@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" - integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== - dependencies: - "@jest/environment" "^24.8.0" - "@jest/fake-timers" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - jest-util "^24.8.0" - -jest-get-type@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" - integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== - -jest-haste-map@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" - integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== - dependencies: - "@jest/types" "^24.8.0" - anymatch "^2.0.0" - fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.4.0" - jest-util "^24.8.0" - jest-worker "^24.6.0" - micromatch "^3.1.10" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^1.2.7" - -jest-jasmine2@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" - integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== - dependencies: - "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - chalk "^2.0.1" - co "^4.6.0" - expect "^24.8.0" - is-generator-fn "^2.0.0" - jest-each "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-runtime "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - pretty-format "^24.8.0" - throat "^4.0.0" - -jest-leak-detector@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" - integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== - dependencies: - pretty-format "^24.8.0" - -jest-matcher-utils@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" - integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== - dependencies: - chalk "^2.0.1" - jest-diff "^24.8.0" - jest-get-type "^24.8.0" - pretty-format "^24.8.0" - -jest-message-util@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" - integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" - stack-utils "^1.0.1" - -jest-mock@^24.5.0, jest-mock@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" - integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== - dependencies: - "@jest/types" "^24.8.0" - -jest-pnp-resolver@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" - integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== - -jest-regex-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" - integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== - -jest-resolve-dependencies@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" - integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== - dependencies: - "@jest/types" "^24.8.0" - jest-regex-util "^24.3.0" - jest-snapshot "^24.8.0" - -jest-resolve@24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.7.1.tgz#e4150198299298380a75a9fd55043fa3b9b17fde" - integrity sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw== - dependencies: - "@jest/types" "^24.7.0" - browser-resolve "^1.11.3" - chalk "^2.0.1" - jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" - -jest-resolve@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" - integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== - dependencies: - "@jest/types" "^24.8.0" - browser-resolve "^1.11.3" - chalk "^2.0.1" - jest-pnp-resolver "^1.2.1" - realpath-native "^1.1.0" - -jest-runner@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" - integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - chalk "^2.4.2" - exit "^0.1.2" - graceful-fs "^4.1.15" - jest-config "^24.8.0" - jest-docblock "^24.3.0" - jest-haste-map "^24.8.0" - jest-jasmine2 "^24.8.0" - jest-leak-detector "^24.8.0" - jest-message-util "^24.8.0" - jest-resolve "^24.8.0" - jest-runtime "^24.8.0" - jest-util "^24.8.0" - jest-worker "^24.6.0" - source-map-support "^0.5.6" - throat "^4.0.0" - -jest-runtime@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" - integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== - dependencies: - "@jest/console" "^24.7.1" - "@jest/environment" "^24.8.0" - "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/yargs" "^12.0.2" - chalk "^2.0.1" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.1.15" - jest-config "^24.8.0" - jest-haste-map "^24.8.0" - jest-message-util "^24.8.0" - jest-mock "^24.8.0" - jest-regex-util "^24.3.0" - jest-resolve "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" - realpath-native "^1.1.0" - slash "^2.0.0" - strip-bom "^3.0.0" - yargs "^12.0.2" - -jest-serializer@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" - integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== - -jest-snapshot@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" - integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== - dependencies: - "@babel/types" "^7.0.0" - "@jest/types" "^24.8.0" - chalk "^2.0.1" - expect "^24.8.0" - jest-diff "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-resolve "^24.8.0" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - pretty-format "^24.8.0" - semver "^5.5.0" - -jest-util@^24.5.0, jest-util@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" - integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== - dependencies: - "@jest/console" "^24.7.1" - "@jest/fake-timers" "^24.8.0" - "@jest/source-map" "^24.3.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" - is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" - -jest-validate@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" - integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== - dependencies: - "@jest/types" "^24.8.0" - camelcase "^5.0.0" - chalk "^2.0.1" - jest-get-type "^24.8.0" - leven "^2.1.0" - pretty-format "^24.8.0" - -jest-watch-typeahead@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/jest-watch-typeahead/-/jest-watch-typeahead-0.3.0.tgz#f56d9ee17ea71ecbf8253fed213df3185a1584c9" - integrity sha512-+uOtlppt9ysST6k6ZTqsPI0WNz2HLa8bowiZylZoQCQaAVn7XsVmHhZREkz73FhKelrFrpne4hQQjdq42nFEmA== - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.4.1" - jest-watcher "^24.3.0" - slash "^2.0.0" - string-length "^2.0.0" - strip-ansi "^5.0.0" - -jest-watcher@^24.3.0, jest-watcher@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" - integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== - dependencies: - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/yargs" "^12.0.9" - ansi-escapes "^3.0.0" - chalk "^2.0.1" - jest-util "^24.8.0" - string-length "^2.0.0" - -jest-worker@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" - integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== - dependencies: - merge-stream "^1.0.1" - supports-color "^6.1.0" - -jest@24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.7.1.tgz#0d94331cf510c75893ee32f87d7321d5bf8f2501" - integrity sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA== - dependencies: - import-local "^2.0.0" - jest-cli "^24.7.1" - -js-levenshtein@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" - integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.9.0: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsdom@^11.5.1: - version "11.12.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" - integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== - dependencies: - abab "^2.0.0" - acorn "^5.5.3" - acorn-globals "^4.1.0" - array-equal "^1.0.0" - cssom ">= 0.3.2 < 0.4.0" - cssstyle "^1.0.0" - data-urls "^1.0.0" - domexception "^1.0.1" - escodegen "^1.9.1" - html-encoding-sniffer "^1.0.2" - left-pad "^1.3.0" - nwsapi "^2.0.7" - parse5 "4.0.0" - pn "^1.1.0" - request "^2.87.0" - request-promise-native "^1.0.5" - sax "^1.2.4" - symbol-tree "^3.2.2" - tough-cookie "^2.3.4" - w3c-hr-time "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.3" - whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.1" - ws "^5.2.0" - xml-name-validator "^3.0.0" - -jsdom@^14.0.0: - version "14.1.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-14.1.0.tgz#916463b6094956b0a6c1782c94e380cd30e1981b" - integrity sha512-O901mfJSuTdwU2w3Sn+74T+RnDVP+FuV5fH8tcPWyqrseRAb0s5xOtPgCFiPOtLcyK7CLIJwPyD83ZqQWvA5ng== - dependencies: - abab "^2.0.0" - acorn "^6.0.4" - acorn-globals "^4.3.0" - array-equal "^1.0.0" - cssom "^0.3.4" - cssstyle "^1.1.1" - data-urls "^1.1.0" - domexception "^1.0.1" - escodegen "^1.11.0" - html-encoding-sniffer "^1.0.2" - nwsapi "^2.1.3" - parse5 "5.1.0" - pn "^1.1.0" - request "^2.88.0" - request-promise-native "^1.0.5" - saxes "^3.1.9" - symbol-tree "^3.2.2" - tough-cookie "^2.5.0" - w3c-hr-time "^1.0.1" - w3c-xmlserializer "^1.1.2" - webidl-conversions "^4.0.2" - whatwg-encoding "^1.0.5" - whatwg-mimetype "^2.3.0" - whatwg-url "^7.0.0" - ws "^6.1.2" - xml-name-validator "^3.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json3@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - integrity sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== - dependencies: - minimist "^1.2.0" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -jsx-ast-utils@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz#0ee4e2c971fb9601c67b5641b71be80faecf0b36" - integrity sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA== - dependencies: - array-includes "^3.0.3" - -killable@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" - integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== - -kind-of@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-2.0.1.tgz#018ec7a4ce7e3a86cb9141be519d24c8faa981b5" - integrity sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU= - dependencies: - is-buffer "^1.0.2" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -kleur@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -last-call-webpack-plugin@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz#9742df0e10e3cf46e5c0381c2de90d3a7a2d7555" - integrity sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w== - dependencies: - lodash "^4.17.5" - webpack-sources "^1.1.0" - -lazy-cache@^0.2.3: - version "0.2.7" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65" - integrity sha1-f+3fLctu23fRHvHRF6tf/fCrG2U= - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= - -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - -left-pad@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" - integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== - -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -loader-fs-cache@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.2.tgz#54cedf6b727e1779fd8f01205f05f6e88706f086" - integrity sha512-70IzT/0/L+M20jUlEqZhZyArTU6VKLRTYRDAYN26g4jfzpJqjipLL3/hgYpySqI9PwsVRHHFja0LfEmsx9X2Cw== - dependencies: - find-cache-dir "^0.1.1" - mkdirp "0.5.1" - -loader-runner@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - -loader-utils@1.2.3, loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== - dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -lodash._reinterpolate@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= - -lodash.memoize@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= - -lodash.tail@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" - integrity sha1-0jM6NtnncXyK0vfKyv7HwytERmQ= - -lodash.template@^4.2.4, lodash.template@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" - integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= - dependencies: - lodash._reinterpolate "~3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" - integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= - dependencies: - lodash._reinterpolate "~3.0.0" - -lodash.unescape@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" - integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= - -lodash.uniq@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" - integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= - -"lodash@>=3.5 <5", lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.5: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -loglevel@^1.4.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" - integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po= - -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lower-case@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" - integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -make-dir@^2.0.0, make-dir@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" - integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== - dependencies: - pify "^4.0.1" - semver "^5.6.0" - -makeerror@1.0.x: - version "1.0.11" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" - integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= - dependencies: - tmpl "1.0.x" - -mamacro@^0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" - integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== - -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -mdn-data@~1.1.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" - integrity sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA== - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - -memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -merge-deep@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/merge-deep/-/merge-deep-3.0.2.tgz#f39fa100a4f1bd34ff29f7d2bf4508fbb8d83ad2" - integrity sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA== - dependencies: - arr-union "^3.1.0" - clone-deep "^0.2.4" - kind-of "^3.0.2" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= - dependencies: - readable-stream "^2.0.1" - -merge2@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" - integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -microevent.ts@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" - integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== - -micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.40.0, "mime-db@>= 1.40.0 < 2": - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== - -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== - dependencies: - mime-db "1.40.0" - -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== - -mime@^2.0.3, mime@^2.3.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78" - integrity sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mini-css-extract-plugin@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.5.0.tgz#ac0059b02b9692515a637115b0cc9fed3a35c7b0" - integrity sha512-IuaLjruM0vMKhUUT51fQdQzBYTX49dLj8w68ALEAe2A4iYNpIC4eMac67mt3NzycvjOlf07/kYxJDc0RTl1Wqw== - dependencies: - loader-utils "^1.1.0" - schema-utils "^1.0.0" - webpack-sources "^1.1.0" - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.1.1, minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - -mississippi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" - integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== - dependencies: - concat-stream "^1.5.0" - duplexify "^3.4.2" - end-of-stream "^1.1.0" - flush-write-stream "^1.0.0" - from2 "^2.1.0" - parallel-transform "^1.1.0" - pump "^3.0.0" - pumpify "^1.3.3" - stream-each "^1.1.0" - through2 "^2.0.0" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mixin-object@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" - integrity sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4= - dependencies: - for-in "^0.1.3" - is-extendable "^0.1.1" - -mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -move-concurrently@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" - integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= - dependencies: - aproba "^1.1.1" - copy-concurrently "^1.0.0" - fs-write-stream-atomic "^1.0.8" - mkdirp "^0.5.1" - rimraf "^2.5.4" - run-queue "^1.0.3" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -multicast-dns-service-types@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" - integrity sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE= - -multicast-dns@^6.0.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229" - integrity sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g== - dependencies: - dns-packet "^1.3.1" - thunky "^1.0.2" - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -nan@^2.12.1: - version "2.13.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" - integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -needle@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388" - integrity sha512-CaLXV3W8Vnbps8ZANqDGz7j4x7Yj1LW4TWF/TQuDfj7Cfx4nAPTvw98qgTevtto1oHDrh3pQkaODbqupXlsWTg== - dependencies: - debug "^4.1.0" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -neo-async@^2.5.0, neo-async@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" - integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -no-case@^2.2.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" - integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== - dependencies: - lower-case "^1.1.1" - -node-forge@0.7.5: - version "0.7.5" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" - integrity sha512-MmbQJ2MTESTjt3Gi/3yG1wGpIMhUfcIypUCGtTizFR9IiccFwxSpfp0vtIZlkFclEqERemxfnSdZEMR9VqqEFQ== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-libs-browser@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.0.tgz#c72f60d9d46de08a940dedbb25f3ffa2f9bbaa77" - integrity sha512-5MQunG/oyOaBdttrL40dA7bUfPORLRWMUJLQtMg7nluxUvk5XwnLdL9twQHFAjRx/y7mIMkLKT9++qPbbk6BZA== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.0" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "0.0.4" - -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - -node-notifier@^5.2.1: - version "5.4.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" - integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== - dependencies: - growly "^1.3.0" - is-wsl "^1.1.0" - semver "^5.5.0" - shellwords "^0.1.1" - which "^1.3.0" - -node-pre-gyp@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" - integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-releases@^1.1.13, node-releases@^1.1.17: - version "1.1.18" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.18.tgz#cc98fd75598a324a77188ebddf6650e9cbd8b1d5" - integrity sha512-/mnVgm6u/8OwlIsoyRXtTI0RfQcxZoAZbdwyXap0EeWwcOpDDymyCHM2/aR9XKmHXrvizHoPAOs0pcbiJ6RUaA== - dependencies: - semver "^5.3.0" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-range@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" - integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= - -normalize-url@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" - integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== - -npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== - -npm-packlist@^1.1.6: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -nth-check@^1.0.2, nth-check@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" - integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== - dependencies: - boolbase "~1.0.0" - -num2fraction@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" - integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -nwsapi@^2.0.7, nwsapi@^2.1.3: - version "2.1.4" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" - integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@4.1.1, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-hash@^1.1.4: - version "1.3.1" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" - integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== - -object-keys@^1.0.11, object-keys@^1.0.12: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.fromentries@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" - integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== - dependencies: - define-properties "^1.1.2" - es-abstract "^1.11.0" - function-bind "^1.1.1" - has "^1.0.1" - -object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -object.values@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" - integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.12.0" - function-bind "^1.1.1" - has "^1.0.3" - -obuf@^1.0.0, obuf@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" - integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -opn@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" - integrity sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw== - dependencies: - is-wsl "^1.1.0" - -opn@^5.1.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" - integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== - dependencies: - is-wsl "^1.1.0" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optimize-css-assets-webpack-plugin@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.1.tgz#9eb500711d35165b45e7fd60ba2df40cb3eb9159" - integrity sha512-Rqm6sSjWtx9FchdP0uzTQDc7GXDKnwVEGoSxjezPkzMewx7gEWE9IMUYKmigTRC4U3RaNSwYVnUDLuIdtTpm0A== - dependencies: - cssnano "^4.1.0" - last-call-webpack-plugin "^3.0.0" - -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -original@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" - integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== - dependencies: - url-parse "^1.4.3" - -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - -os-locale@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - -p-each-series@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" - integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= - dependencies: - p-reduce "^1.0.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== - dependencies: - p-try "^2.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-map@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== - -p-reduce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" - integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -pako@~1.0.5: - version "1.0.10" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" - integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== - -parallel-transform@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" - integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= - dependencies: - cyclist "~0.2.2" - inherits "^2.0.3" - readable-stream "^2.1.5" - -param-case@2.1.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= - dependencies: - no-case "^2.2.0" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-asn1@^5.0.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" - integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse5@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" - integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== - -parse5@5.1.0, parse5@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" - integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== - -parseurl@~1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.1, path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= - dependencies: - pify "^2.0.0" - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -pbkdf2@^3.0.3: - version "3.0.17" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" - integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - -pkg-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" - integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== - dependencies: - find-up "^3.0.0" - -pkg-up@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - -pn@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" - integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== - -pnp-webpack-plugin@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.2.1.tgz#cd9d698df2a6fcf7255093c1c9511adf65b9421b" - integrity sha512-W6GctK7K2qQiVR+gYSv/Gyt6jwwIH4vwdviFqx+Y2jAtVf5eZyYIDf5Ac2NCDMBiX5yWscBLZElPTsyA1UtVVA== - dependencies: - ts-pnp "^1.0.0" - -portfinder@^1.0.9: - version "1.0.20" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.20.tgz#bea68632e54b2e13ab7b0c4775e9b41bf270e44a" - integrity sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw== - dependencies: - async "^1.5.2" - debug "^2.2.0" - mkdirp "0.5.x" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -postcss-attribute-case-insensitive@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz#b2a721a0d279c2f9103a36331c88981526428cc7" - integrity sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A== - dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0" - -postcss-browser-comments@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-browser-comments/-/postcss-browser-comments-2.0.0.tgz#dc48d6a8ddbff188a80a000b7393436cb18aed88" - integrity sha512-xGG0UvoxwBc4Yx4JX3gc0RuDl1kc4bVihCzzk6UC72YPfq5fu3c717Nu8Un3nvnq1BJ31gBnFXIG/OaUTnpHgA== - dependencies: - postcss "^7.0.2" - -postcss-calc@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.1.tgz#36d77bab023b0ecbb9789d84dcb23c4941145436" - integrity sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ== - dependencies: - css-unit-converter "^1.1.1" - postcss "^7.0.5" - postcss-selector-parser "^5.0.0-rc.4" - postcss-value-parser "^3.3.1" - -postcss-color-functional-notation@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz#5efd37a88fbabeb00a2966d1e53d98ced93f74e0" - integrity sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-color-gray@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz#532a31eb909f8da898ceffe296fdc1f864be8547" - integrity sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw== - dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.5" - postcss-values-parser "^2.0.0" - -postcss-color-hex-alpha@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz#a8d9ca4c39d497c9661e374b9c51899ef0f87388" - integrity sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw== - dependencies: - postcss "^7.0.14" - postcss-values-parser "^2.0.1" - -postcss-color-mod-function@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz#816ba145ac11cc3cb6baa905a75a49f903e4d31d" - integrity sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ== - dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-color-rebeccapurple@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz#c7a89be872bb74e45b1e3022bfe5748823e6de77" - integrity sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-colormin@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-4.0.3.tgz#ae060bce93ed794ac71264f08132d550956bd381" - integrity sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw== - dependencies: - browserslist "^4.0.0" - color "^3.0.0" - has "^1.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-convert-values@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz#ca3813ed4da0f812f9d43703584e449ebe189a7f" - integrity sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ== - dependencies: - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-custom-media@^7.0.7: - version "7.0.8" - resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz#fffd13ffeffad73621be5f387076a28b00294e0c" - integrity sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg== - dependencies: - postcss "^7.0.14" - -postcss-custom-properties@^8.0.9: - version "8.0.10" - resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-8.0.10.tgz#e8dc969e1e15c555f0b836b7f278ef47e3cdeaff" - integrity sha512-GDL0dyd7++goDR4SSasYdRNNvp4Gqy1XMzcCnTijiph7VB27XXpJ8bW/AI0i2VSBZ55TpdGhMr37kMSpRfYD0Q== - dependencies: - postcss "^7.0.14" - postcss-values-parser "^2.0.1" - -postcss-custom-selectors@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz#64858c6eb2ecff2fb41d0b28c9dd7b3db4de7fba" - integrity sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w== - dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" - -postcss-dir-pseudo-class@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2" - integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw== - dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" - -postcss-discard-comments@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz#1fbabd2c246bff6aaad7997b2b0918f4d7af4033" - integrity sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg== - dependencies: - postcss "^7.0.0" - -postcss-discard-duplicates@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz#3fe133cd3c82282e550fc9b239176a9207b784eb" - integrity sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ== - dependencies: - postcss "^7.0.0" - -postcss-discard-empty@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz#c8c951e9f73ed9428019458444a02ad90bb9f765" - integrity sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w== - dependencies: - postcss "^7.0.0" - -postcss-discard-overridden@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz#652aef8a96726f029f5e3e00146ee7a4e755ff57" - integrity sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg== - dependencies: - postcss "^7.0.0" - -postcss-double-position-gradients@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz#fc927d52fddc896cb3a2812ebc5df147e110522e" - integrity sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA== - dependencies: - postcss "^7.0.5" - postcss-values-parser "^2.0.0" - -postcss-env-function@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-2.0.2.tgz#0f3e3d3c57f094a92c2baf4b6241f0b0da5365d7" - integrity sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-flexbugs-fixes@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz#e094a9df1783e2200b7b19f875dcad3b3aff8b20" - integrity sha512-jr1LHxQvStNNAHlgco6PzY308zvLklh7SJVYuWUwyUQncofaAlD2l+P/gxKHOdqWKe7xJSkVLFF/2Tp+JqMSZA== - dependencies: - postcss "^7.0.0" - -postcss-focus-visible@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz#477d107113ade6024b14128317ade2bd1e17046e" - integrity sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g== - dependencies: - postcss "^7.0.2" - -postcss-focus-within@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz#763b8788596cee9b874c999201cdde80659ef680" - integrity sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w== - dependencies: - postcss "^7.0.2" - -postcss-font-variant@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-4.0.0.tgz#71dd3c6c10a0d846c5eda07803439617bbbabacc" - integrity sha512-M8BFYKOvCrI2aITzDad7kWuXXTm0YhGdP9Q8HanmN4EF1Hmcgs1KK5rSHylt/lUJe8yLxiSwWAHdScoEiIxztg== - dependencies: - postcss "^7.0.2" - -postcss-gap-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz#431c192ab3ed96a3c3d09f2ff615960f902c1715" - integrity sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg== - dependencies: - postcss "^7.0.2" - -postcss-image-set-function@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz#28920a2f29945bed4c3198d7df6496d410d3f288" - integrity sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-initial@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-3.0.0.tgz#1772512faf11421b791fb2ca6879df5f68aa0517" - integrity sha512-WzrqZ5nG9R9fUtrA+we92R4jhVvEB32IIRTzfIG/PLL8UV4CvbF1ugTEHEFX6vWxl41Xt5RTCJPEZkuWzrOM+Q== - dependencies: - lodash.template "^4.2.4" - postcss "^7.0.2" - -postcss-lab-function@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz#bb51a6856cd12289ab4ae20db1e3821ef13d7d2e" - integrity sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg== - dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-load-config@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484" - integrity sha512-V5JBLzw406BB8UIfsAWSK2KSwIJ5yoEIVFb4gVkXci0QdKgA24jLmHZ/ghe/GgX0lJ0/D1uUK1ejhzEY94MChQ== - dependencies: - cosmiconfig "^4.0.0" - import-cwd "^2.0.0" - -postcss-loader@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d" - integrity sha512-cLWoDEY5OwHcAjDnkyRQzAXfs2jrKjXpO/HQFcc5b5u/r7aa471wdmChmwfnv7x2u840iat/wi0lQ5nbRgSkUA== - dependencies: - loader-utils "^1.1.0" - postcss "^7.0.0" - postcss-load-config "^2.0.0" - schema-utils "^1.0.0" - -postcss-logical@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5" - integrity sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA== - dependencies: - postcss "^7.0.2" - -postcss-media-minmax@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz#b75bb6cbc217c8ac49433e12f22048814a4f5ed5" - integrity sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw== - dependencies: - postcss "^7.0.2" - -postcss-merge-longhand@^4.0.11: - version "4.0.11" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz#62f49a13e4a0ee04e7b98f42bb16062ca2549e24" - integrity sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw== - dependencies: - css-color-names "0.0.4" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - stylehacks "^4.0.0" - -postcss-merge-rules@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz#362bea4ff5a1f98e4075a713c6cb25aefef9a650" - integrity sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ== - dependencies: - browserslist "^4.0.0" - caniuse-api "^3.0.0" - cssnano-util-same-parent "^4.0.0" - postcss "^7.0.0" - postcss-selector-parser "^3.0.0" - vendors "^1.0.0" - -postcss-minify-font-values@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz#cd4c344cce474343fac5d82206ab2cbcb8afd5a6" - integrity sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg== - dependencies: - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-minify-gradients@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz#93b29c2ff5099c535eecda56c4aa6e665a663471" - integrity sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q== - dependencies: - cssnano-util-get-arguments "^4.0.0" - is-color-stop "^1.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-minify-params@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz#6b9cef030c11e35261f95f618c90036d680db874" - integrity sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg== - dependencies: - alphanum-sort "^1.0.0" - browserslist "^4.0.0" - cssnano-util-get-arguments "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - uniqs "^2.0.0" - -postcss-minify-selectors@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz#e2e5eb40bfee500d0cd9243500f5f8ea4262fbd8" - integrity sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g== - dependencies: - alphanum-sort "^1.0.0" - has "^1.0.0" - postcss "^7.0.0" - postcss-selector-parser "^3.0.0" - -postcss-modules-extract-imports@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz#818719a1ae1da325f9832446b01136eeb493cd7e" - integrity sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ== - dependencies: - postcss "^7.0.5" - -postcss-modules-local-by-default@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-2.0.6.tgz#dd9953f6dd476b5fd1ef2d8830c8929760b56e63" - integrity sha512-oLUV5YNkeIBa0yQl7EYnxMgy4N6noxmiwZStaEJUSe2xPMcdNc8WmBQuQCx18H5psYbVxz8zoHk0RAAYZXP9gA== - dependencies: - postcss "^7.0.6" - postcss-selector-parser "^6.0.0" - postcss-value-parser "^3.3.1" - -postcss-modules-scope@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.1.0.tgz#ad3f5bf7856114f6fcab901b0502e2a2bc39d4eb" - integrity sha512-91Rjps0JnmtUB0cujlc8KIKCsJXWjzuxGeT/+Q2i2HXKZ7nBUeF9YQTZZTNvHVoNYj1AthsjnGLtqDUE0Op79A== - dependencies: - postcss "^7.0.6" - postcss-selector-parser "^6.0.0" - -postcss-modules-values@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-2.0.0.tgz#479b46dc0c5ca3dc7fa5270851836b9ec7152f64" - integrity sha512-Ki7JZa7ff1N3EIMlPnGTZfUMe69FFwiQPnVSXC9mnn3jozCRBYIxiZd44yJOV2AmabOo4qFf8s0dC/+lweG7+w== - dependencies: - icss-replace-symbols "^1.1.0" - postcss "^7.0.6" - -postcss-nesting@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-7.0.0.tgz#6e26a770a0c8fcba33782a6b6f350845e1a448f6" - integrity sha512-WSsbVd5Ampi3Y0nk/SKr5+K34n52PqMqEfswu6RtU4r7wA8vSD+gM8/D9qq4aJkHImwn1+9iEFTbjoWsQeqtaQ== - dependencies: - postcss "^7.0.2" - -postcss-normalize-charset@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4" - integrity sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g== - dependencies: - postcss "^7.0.0" - -postcss-normalize-display-values@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz#0dbe04a4ce9063d4667ed2be476bb830c825935a" - integrity sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ== - dependencies: - cssnano-util-get-match "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-positions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz#05f757f84f260437378368a91f8932d4b102917f" - integrity sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA== - dependencies: - cssnano-util-get-arguments "^4.0.0" - has "^1.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-repeat-style@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz#c4ebbc289f3991a028d44751cbdd11918b17910c" - integrity sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q== - dependencies: - cssnano-util-get-arguments "^4.0.0" - cssnano-util-get-match "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-string@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz#cd44c40ab07a0c7a36dc5e99aace1eca4ec2690c" - integrity sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA== - dependencies: - has "^1.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-timing-functions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz#8e009ca2a3949cdaf8ad23e6b6ab99cb5e7d28d9" - integrity sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A== - dependencies: - cssnano-util-get-match "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-unicode@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz#841bd48fdcf3019ad4baa7493a3d363b52ae1cfb" - integrity sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg== - dependencies: - browserslist "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-url@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz#10e437f86bc7c7e58f7b9652ed878daaa95faae1" - integrity sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA== - dependencies: - is-absolute-url "^2.0.0" - normalize-url "^3.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize-whitespace@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz#bf1d4070fe4fcea87d1348e825d8cc0c5faa7d82" - integrity sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA== - dependencies: - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-normalize@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize/-/postcss-normalize-7.0.1.tgz#eb51568d962b8aa61a8318383c8bb7e54332282e" - integrity sha512-NOp1fwrG+6kVXWo7P9SizCHX6QvioxFD/hZcI2MLxPmVnFJFC0j0DDpIuNw2tUDeCFMni59gCVgeJ1/hYhj2OQ== - dependencies: - "@csstools/normalize.css" "^9.0.1" - browserslist "^4.1.1" - postcss "^7.0.2" - postcss-browser-comments "^2.0.0" - -postcss-ordered-values@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz#0cf75c820ec7d5c4d280189559e0b571ebac0eee" - integrity sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw== - dependencies: - cssnano-util-get-arguments "^4.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-overflow-shorthand@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz#31ecf350e9c6f6ddc250a78f0c3e111f32dd4c30" - integrity sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g== - dependencies: - postcss "^7.0.2" - -postcss-page-break@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-2.0.0.tgz#add52d0e0a528cabe6afee8b46e2abb277df46bf" - integrity sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ== - dependencies: - postcss "^7.0.2" - -postcss-place@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-4.0.1.tgz#e9f39d33d2dc584e46ee1db45adb77ca9d1dcc62" - integrity sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-preset-env@6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-6.6.0.tgz#642e7d962e2bdc2e355db117c1eb63952690ed5b" - integrity sha512-I3zAiycfqXpPIFD6HXhLfWXIewAWO8emOKz+QSsxaUZb9Dp8HbF5kUf+4Wy/AxR33o+LRoO8blEWCHth0ZsCLA== - dependencies: - autoprefixer "^9.4.9" - browserslist "^4.4.2" - caniuse-lite "^1.0.30000939" - css-blank-pseudo "^0.1.4" - css-has-pseudo "^0.10.0" - css-prefers-color-scheme "^3.1.1" - cssdb "^4.3.0" - postcss "^7.0.14" - postcss-attribute-case-insensitive "^4.0.1" - postcss-color-functional-notation "^2.0.1" - postcss-color-gray "^5.0.0" - postcss-color-hex-alpha "^5.0.2" - postcss-color-mod-function "^3.0.3" - postcss-color-rebeccapurple "^4.0.1" - postcss-custom-media "^7.0.7" - postcss-custom-properties "^8.0.9" - postcss-custom-selectors "^5.1.2" - postcss-dir-pseudo-class "^5.0.0" - postcss-double-position-gradients "^1.0.0" - postcss-env-function "^2.0.2" - postcss-focus-visible "^4.0.0" - postcss-focus-within "^3.0.0" - postcss-font-variant "^4.0.0" - postcss-gap-properties "^2.0.0" - postcss-image-set-function "^3.0.1" - postcss-initial "^3.0.0" - postcss-lab-function "^2.0.1" - postcss-logical "^3.0.0" - postcss-media-minmax "^4.0.0" - postcss-nesting "^7.0.0" - postcss-overflow-shorthand "^2.0.0" - postcss-page-break "^2.0.0" - postcss-place "^4.0.1" - postcss-pseudo-class-any-link "^6.0.0" - postcss-replace-overflow-wrap "^3.0.0" - postcss-selector-matches "^4.0.0" - postcss-selector-not "^4.0.0" - -postcss-pseudo-class-any-link@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1" - integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew== - dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" - -postcss-reduce-initial@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz#7fd42ebea5e9c814609639e2c2e84ae270ba48df" - integrity sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA== - dependencies: - browserslist "^4.0.0" - caniuse-api "^3.0.0" - has "^1.0.0" - postcss "^7.0.0" - -postcss-reduce-transforms@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz#17efa405eacc6e07be3414a5ca2d1074681d4e29" - integrity sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg== - dependencies: - cssnano-util-get-match "^4.0.0" - has "^1.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - -postcss-replace-overflow-wrap@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz#61b360ffdaedca84c7c918d2b0f0d0ea559ab01c" - integrity sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw== - dependencies: - postcss "^7.0.2" - -postcss-safe-parser@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz#8756d9e4c36fdce2c72b091bbc8ca176ab1fcdea" - integrity sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ== - dependencies: - postcss "^7.0.0" - -postcss-selector-matches@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz#71c8248f917ba2cc93037c9637ee09c64436fcff" - integrity sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" - -postcss-selector-not@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-4.0.0.tgz#c68ff7ba96527499e832724a2674d65603b645c0" - integrity sha512-W+bkBZRhqJaYN8XAnbbZPLWMvZD1wKTu0UxtFKdhtGjWYmxhkUneoeOhRJKdAE5V7ZTlnbHfCR+6bNwK9e1dTQ== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" - -postcss-selector-parser@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" - integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= - dependencies: - dot-prop "^4.1.1" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-selector-parser@^5.0.0, postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" - integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== - dependencies: - cssesc "^2.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-selector-parser@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz#934cf799d016c83411859e09dcecade01286ec5c" - integrity sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg== - dependencies: - cssesc "^3.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-svgo@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-4.0.2.tgz#17b997bc711b333bab143aaed3b8d3d6e3d38258" - integrity sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw== - dependencies: - is-svg "^3.0.0" - postcss "^7.0.0" - postcss-value-parser "^3.0.0" - svgo "^1.0.0" - -postcss-unique-selectors@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" - integrity sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg== - dependencies: - alphanum-sort "^1.0.0" - postcss "^7.0.0" - uniqs "^2.0.0" - -postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.0, postcss-value-parser@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" - integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== - -postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" - integrity sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg== - dependencies: - flatten "^1.0.2" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.16" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.16.tgz#48f64f1b4b558cb8b52c88987724359acb010da2" - integrity sha512-MOo8zNSlIqh22Uaa3drkdIAgUGEL+AD1ESiSdmElLUmE2uVDo1QloiT/IfW9qRw8Gw+Y/w69UVMGwbufMSftxA== - dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -pretty-bytes@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.2.0.tgz#96c92c6e95a0b35059253fb33c03e260d40f5a1f" - integrity sha512-ujANBhiUsl9AhREUDUEY1GPOharMGm8x8juS7qOHybcLi7XsKfrYQ88hSly1l2i0klXHTDYrlL8ihMCG55Dc3w== - -pretty-error@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3" - integrity sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM= - dependencies: - renderkid "^2.0.1" - utila "~0.4" - -pretty-format@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" - integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== - dependencies: - "@jest/types" "^24.8.0" - ansi-regex "^4.0.0" - ansi-styles "^3.2.0" - react-is "^16.8.4" - -private@^0.1.6: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -promise-inflight@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= - -promise@8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/promise/-/promise-8.0.2.tgz#9dcd0672192c589477d56891271bdc27547ae9f0" - integrity sha512-EIyzM39FpVOMbqgzEHhxdrEhtOSDOtjMZQ0M6iVfCE+kWNgCkAyOdnuCWqfmflylftfadU6FkiMgHZA2kUzwRw== - dependencies: - asap "~2.0.6" - -prompts@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" - integrity sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA== - dependencies: - kleur "^3.0.2" - sisteransi "^1.0.0" - -prop-types@^15.6.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== - dependencies: - loose-envify "^1.4.0" - object-assign "^4.1.1" - react-is "^16.8.1" - -property-information@^5.0.0, property-information@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.0.1.tgz#c3b09f4f5750b1634c0b24205adbf78f18bdf94f" - integrity sha512-nAtBDVeSwFM3Ot/YxT7s4NqZmqXI7lLzf46BThvotEtYf2uk2yH0ACYuWQkJ7gxKs49PPtKVY0UlDGkyN9aJlw== - dependencies: - xtend "^4.0.1" - -proxy-addr@~2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" - integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.0" - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -psl@^1.1.24, psl@^1.1.28: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.3.3: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -q@^1.1.2: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - -qs@6.5.2, qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -querystringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== - -raf@3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" - integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== - dependencies: - performance-now "^2.1.0" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@^1.0.3, range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= - -raw-body@2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -react-app-polyfill@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/react-app-polyfill/-/react-app-polyfill-1.0.1.tgz#809a858e44f9564c7f4205e173076f90048274f1" - integrity sha512-LbVpT1NdzTdDDs7xEZdebjDrqsvKi5UyVKUQqtTYYNyC1JJYVAwNQWe4ybWvoT2V2WW9PGVO2u5Y6aVj4ER/Ow== - dependencies: - core-js "3.0.1" - object-assign "4.1.1" - promise "8.0.2" - raf "3.4.1" - regenerator-runtime "0.13.2" - whatwg-fetch "3.0.0" - -react-dev-utils@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.0.1.tgz#5c03d85a0b2537d0c46af7165c24a7dfb274bef2" - integrity sha512-pnaeMo/Pxel8aZpxk1WwxT3uXxM3tEwYvsjCYn5R7gNxjhN1auowdcLDzFB8kr7rafAj2rxmvfic/fbac5CzwQ== - dependencies: - "@babel/code-frame" "7.0.0" - address "1.0.3" - browserslist "4.5.4" - chalk "2.4.2" - cross-spawn "6.0.5" - detect-port-alt "1.1.6" - escape-string-regexp "1.0.5" - filesize "3.6.1" - find-up "3.0.0" - fork-ts-checker-webpack-plugin "1.1.1" - global-modules "2.0.0" - globby "8.0.2" - gzip-size "5.0.0" - immer "1.10.0" - inquirer "6.2.2" - is-root "2.0.0" - loader-utils "1.2.3" - opn "5.4.0" - pkg-up "2.0.0" - react-error-overlay "^5.1.6" - recursive-readdir "2.2.2" - shell-quote "1.6.1" - sockjs-client "1.3.0" - strip-ansi "5.2.0" - text-table "0.2.0" - -react-dom@16.8.6: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f" - integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.13.6" - -react-error-overlay@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-5.1.6.tgz#0cd73407c5d141f9638ae1e0c63e7b2bf7e9929d" - integrity sha512-X1Y+0jR47ImDVr54Ab6V9eGk0Hnu7fVWGeHQSOXHf/C2pF9c6uy3gef8QUeuUiWlNb0i08InPSE5a/KJzNzw1Q== - -react-is@^16.8.1, react-is@^16.8.4: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" - integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== - -react-scripts@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-3.0.1.tgz#e5565350d8069cc9966b5998d3fe3befe3d243ac" - integrity sha512-LKEjBhVpEB+c312NeJhzF+NATxF7JkHNr5GhtwMeRS1cMeLElMeIu8Ye7WGHtDP7iz7ra4ryy48Zpo6G/cwWUw== - dependencies: - "@babel/core" "7.4.3" - "@svgr/webpack" "4.1.0" - "@typescript-eslint/eslint-plugin" "1.6.0" - "@typescript-eslint/parser" "1.6.0" - babel-eslint "10.0.1" - babel-jest "^24.8.0" - babel-loader "8.0.5" - babel-plugin-named-asset-import "^0.3.2" - babel-preset-react-app "^9.0.0" - camelcase "^5.2.0" - case-sensitive-paths-webpack-plugin "2.2.0" - css-loader "2.1.1" - dotenv "6.2.0" - dotenv-expand "4.2.0" - eslint "^5.16.0" - eslint-config-react-app "^4.0.1" - eslint-loader "2.1.2" - eslint-plugin-flowtype "2.50.1" - eslint-plugin-import "2.16.0" - eslint-plugin-jsx-a11y "6.2.1" - eslint-plugin-react "7.12.4" - eslint-plugin-react-hooks "^1.5.0" - file-loader "3.0.1" - fs-extra "7.0.1" - html-webpack-plugin "4.0.0-beta.5" - identity-obj-proxy "3.0.0" - is-wsl "^1.1.0" - jest "24.7.1" - jest-environment-jsdom-fourteen "0.1.0" - jest-resolve "24.7.1" - jest-watch-typeahead "0.3.0" - mini-css-extract-plugin "0.5.0" - optimize-css-assets-webpack-plugin "5.0.1" - pnp-webpack-plugin "1.2.1" - postcss-flexbugs-fixes "4.1.0" - postcss-loader "3.0.0" - postcss-normalize "7.0.1" - postcss-preset-env "6.6.0" - postcss-safe-parser "4.0.1" - react-app-polyfill "^1.0.1" - react-dev-utils "^9.0.1" - resolve "1.10.0" - sass-loader "7.1.0" - semver "6.0.0" - style-loader "0.23.1" - terser-webpack-plugin "1.2.3" - ts-pnp "1.1.2" - url-loader "1.1.2" - webpack "4.29.6" - webpack-dev-server "3.2.1" - webpack-manifest-plugin "2.0.4" - workbox-webpack-plugin "4.2.0" - optionalDependencies: - fsevents "2.0.6" - -react@16.8.6: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" - integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.13.6" - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.0.6, readable-stream@^3.1.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9" - integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -realpath-native@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" - integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== - dependencies: - util.promisify "^1.0.0" - -recursive-readdir@2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" - integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== - dependencies: - minimatch "3.0.4" - -regenerate-unicode-properties@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz#7b38faa296252376d363558cfbda90c9ce709662" - integrity sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ== - dependencies: - regenerate "^1.4.0" - -regenerate@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== - -regenerator-runtime@0.13.2, regenerator-runtime@^0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" - integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-transform@^0.13.4: - version "0.13.4" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb" - integrity sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A== - dependencies: - private "^0.1.6" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp-tree@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.6.tgz#84900fa12fdf428a2ac25f04300382a7c0148479" - integrity sha512-LFrA98Dw/heXqDojz7qKFdygZmFoiVlvE1Zp7Cq2cvF+ZA+03Gmhy0k0PQlsC1jvHPiTUSs+pDHEuSWv6+6D7w== - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpu-core@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" - integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== - dependencies: - regenerate "^1.4.0" - regenerate-unicode-properties "^8.0.2" - regjsgen "^0.5.0" - regjsparser "^0.6.0" - unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.1.0" - -regjsgen@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" - integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== - -regjsparser@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" - integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== - dependencies: - jsesc "~0.5.0" - -rehype-parse@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-6.0.0.tgz#f681555f2598165bee2c778b39f9073d17b16bca" - integrity sha512-V2OjMD0xcSt39G4uRdMTqDXXm6HwkUbLMDayYKA/d037j8/OtVSQ+tqKwYWOuyBeoCs/3clXRe30VUjeMDTBSA== - dependencies: - hast-util-from-parse5 "^5.0.0" - parse5 "^5.0.0" - xtend "^4.0.1" - -relateurl@0.2.x: - version "0.2.7" - resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" - integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -renderkid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.3.tgz#380179c2ff5ae1365c522bf2fcfcff01c5b74149" - integrity sha512-z8CLQp7EZBPCwCnncgf9C4XAi3WR0dv+uWu/PjIyhhAb5d6IJ/QZqlHFprHeKT+59//V6BNUsLbvN8+2LarxGA== - dependencies: - css-select "^1.1.0" - dom-converter "^0.2" - htmlparser2 "^3.3.0" - strip-ansi "^3.0.0" - utila "^0.4.0" - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -replace-ext@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= - -request-promise-core@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" - integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== - dependencies: - lodash "^4.17.11" - -request-promise-native@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" - integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== - dependencies: - request-promise-core "1.1.2" - stealthy-require "^1.1.1" - tough-cookie "^2.3.3" - -request@^2.87.0, request@^2.88.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -requireindex@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" - integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-cwd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" - integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= - dependencies: - resolve-from "^3.0.0" - -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" - integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== - dependencies: - path-parse "^1.0.6" - -resolve@^1.10.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" - integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== - dependencies: - path-parse "^1.0.6" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rgb-regex@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" - integrity sha1-wODWiC3w4jviVKR16O3UGRX+rrE= - -rgba-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" - integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= - -rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rsvp@^4.8.4: - version "4.8.4" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" - integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA== - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= - dependencies: - is-promise "^2.1.0" - -run-queue@^1.0.0, run-queue@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" - integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= - dependencies: - aproba "^1.1.1" - -rxjs@^6.4.0: - version "6.5.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4" - integrity sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sane@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" - integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== - dependencies: - "@cnakazawa/watch" "^1.0.3" - anymatch "^2.0.0" - capture-exit "^2.0.0" - exec-sh "^0.3.2" - execa "^1.0.0" - fb-watchman "^2.0.0" - micromatch "^3.1.4" - minimist "^1.1.1" - walker "~1.0.5" - -sass-loader@7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-7.1.0.tgz#16fd5138cb8b424bf8a759528a1972d72aad069d" - integrity sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w== - dependencies: - clone-deep "^2.0.1" - loader-utils "^1.0.1" - lodash.tail "^4.1.1" - neo-async "^2.5.0" - pify "^3.0.0" - semver "^5.5.0" - -sax@^1.2.4, sax@~1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - -saxes@^3.1.9: - version "3.1.9" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-3.1.9.tgz#c1c197cd54956d88c09f960254b999e192d7058b" - integrity sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw== - dependencies: - xmlchars "^1.3.1" - -scheduler@^0.13.6: - version "0.13.6" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" - integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - -schema-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" - integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== - dependencies: - ajv "^6.1.0" - ajv-errors "^1.0.0" - ajv-keywords "^3.1.0" - -select-hose@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" - integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= - -selfsigned@^1.9.1: - version "1.10.4" - resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd" - integrity sha512-9AukTiDmHXGXWtWjembZ5NDmVvP2695EtpgbCsxCa68w3c88B+alqbmZ4O3hZ4VWGXeGWzEVdvqgAJD8DQPCDw== - dependencies: - node-forge "0.7.5" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - -semver@6.0.0, semver@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" - integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== - -send@0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" - -serialize-javascript@^1.4.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" - integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== - -serve-index@^1.7.2: - version "1.9.1" - resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= - dependencies: - accepts "~1.3.4" - batch "0.6.1" - debug "2.6.9" - escape-html "~1.0.3" - http-errors "~1.6.2" - mime-types "~2.1.17" - parseurl "~1.3.2" - -serve-static@1.13.2: - version "1.13.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" - integrity sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.2" - -set-blocking@^2.0.0, set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shallow-clone@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-0.1.2.tgz#5909e874ba77106d73ac414cfec1ffca87d97060" - integrity sha1-WQnodLp3EG1zrEFM/sH/yofZcGA= - dependencies: - is-extendable "^0.1.1" - kind-of "^2.0.1" - lazy-cache "^0.2.3" - mixin-object "^2.0.1" - -shallow-clone@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-1.0.0.tgz#4480cd06e882ef68b2ad88a3ea54832e2c48b571" - integrity sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA== - dependencies: - is-extendable "^0.1.1" - kind-of "^5.0.0" - mixin-object "^2.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shell-quote@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" - integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= - dependencies: - array-filter "~0.0.0" - array-map "~0.0.0" - array-reduce "~0.0.0" - jsonify "~0.0.0" - -shellwords@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" - integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= - dependencies: - is-arrayish "^0.3.1" - -sisteransi@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" - integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sockjs-client@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.3.0.tgz#12fc9d6cb663da5739d3dc5fb6e8687da95cb177" - integrity sha512-R9jxEzhnnrdxLCNln0xg5uGHqMnkhPSTzUZH2eXcR03S/On9Yvoq2wyUZILRUhZCNVu2PmwWVoyuiPz8th8zbg== - dependencies: - debug "^3.2.5" - eventsource "^1.0.7" - faye-websocket "~0.11.1" - inherits "^2.0.3" - json3 "^3.3.2" - url-parse "^1.4.3" - -sockjs@0.3.19: - version "0.3.19" - resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d" - integrity sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw== - dependencies: - faye-websocket "^0.10.0" - uuid "^3.0.1" - -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.5.6, source-map-support@~0.5.10: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -space-separated-tokens@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.3.tgz#bc6500e116d13285a94b59b58c44c7f045fe6124" - integrity sha512-/M5RAdBuQlSDPNfA5ube+fkHbHyY08pMuADLmsAQURzo56w90r681oiOoz3o3ZQyWdSeNucpTFjL+Ggd5qui3w== - -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" - integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== - -spdy-transport@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" - integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== - dependencies: - debug "^4.1.0" - detect-node "^2.0.4" - hpack.js "^2.1.6" - obuf "^1.1.2" - readable-stream "^3.0.6" - wbuf "^1.7.3" - -spdy@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.0.tgz#81f222b5a743a329aa12cea6a390e60e9b613c52" - integrity sha512-ot0oEGT/PGUpzf/6uk4AWLqkq+irlqHXkrdbk51oWONh3bxQmBuljxPNl66zlRRcIJStWq0QkLUCPOPjgjvU0Q== - dependencies: - debug "^4.1.0" - handle-thing "^2.0.0" - http-deceiver "^1.2.7" - select-hose "^2.0.0" - spdy-transport "^3.0.0" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -ssri@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" - integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== - dependencies: - figgy-pudding "^3.5.1" - -stable@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" - integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== - -stack-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" - integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== - -stealthy-require@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" - integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= - -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-each@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" - integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== - dependencies: - end-of-stream "^1.1.0" - stream-shift "^1.0.0" - -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-shift@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" - integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= - -string-length@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" - integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= - dependencies: - astral-regex "^1.0.0" - strip-ansi "^4.0.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string_decoder@^1.0.0, string_decoder@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== - dependencies: - safe-buffer "~5.1.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -stringify-object@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - -strip-ansi@5.2.0, strip-ansi@^5.0.0, strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-comments@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-1.0.2.tgz#82b9c45e7f05873bee53f37168af930aa368679d" - integrity sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw== - dependencies: - babel-extract-comments "^1.0.0" - babel-plugin-transform-object-rest-spread "^6.26.0" - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -style-loader@0.23.1: - version "0.23.1" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.23.1.tgz#cb9154606f3e771ab6c4ab637026a1049174d925" - integrity sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg== - dependencies: - loader-utils "^1.1.0" - schema-utils "^1.0.0" - -stylehacks@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" - integrity sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g== - dependencies: - browserslist "^4.0.0" - postcss "^7.0.0" - postcss-selector-parser "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - -svgo@^1.0.0, svgo@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316" - integrity sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA== - dependencies: - chalk "^2.4.1" - coa "^2.0.2" - css-select "^2.0.0" - css-select-base-adapter "^0.1.1" - css-tree "1.0.0-alpha.28" - css-url-regex "^1.1.0" - csso "^3.5.1" - js-yaml "^3.13.1" - mkdirp "~0.5.1" - object.values "^1.1.0" - sax "~1.2.4" - stable "^0.1.8" - unquote "~1.1.1" - util.promisify "~1.0.0" - -symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= - -table@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" - integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== - dependencies: - ajv "^6.9.1" - lodash "^4.17.11" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -tapable@^1.0.0, tapable@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" - integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== - -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -terser-webpack-plugin@1.2.3, terser-webpack-plugin@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz#3f98bc902fac3e5d0de730869f50668561262ec8" - integrity sha512-GOK7q85oAb/5kE12fMuLdn2btOS9OBZn4VsecpHDywoUC/jLhSAKOiYo0ezx7ss2EXPMzyEWFoE0s1WLE+4+oA== - dependencies: - cacache "^11.0.2" - find-cache-dir "^2.0.0" - schema-utils "^1.0.0" - serialize-javascript "^1.4.0" - source-map "^0.6.1" - terser "^3.16.1" - webpack-sources "^1.1.0" - worker-farm "^1.5.2" - -terser@^3.16.1: - version "3.17.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2" - integrity sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ== - dependencies: - commander "^2.19.0" - source-map "~0.6.1" - source-map-support "~0.5.10" - -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" - -text-table@0.2.0, text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -throat@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" - integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= - -through2@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -thunky@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.0.3.tgz#f5df732453407b09191dae73e2a8cc73f381a826" - integrity sha512-YwT8pjmNcAXBZqrubu22P4FYsh2D4dxRmnWBOL8Jk8bUcRUtc5326kx32tuTmFDAZtLOGEVNl8POAR8j896Iow== - -timers-browserify@^2.0.4: - version "2.0.10" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" - integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== - dependencies: - setimmediate "^1.0.4" - -timsort@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" - integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - dependencies: - punycode "^2.1.0" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -trough@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.3.tgz#e29bd1614c6458d44869fc28b255ab7857ef7c24" - integrity sha512-fwkLWH+DimvA4YCy+/nvJd61nWQQ2liO/nF/RjkTpiOGi+zxZzVkhb1mvbHIIW4b/8nDsYI8uTmAlc0nNkRMOw== - -ts-pnp@1.1.2, ts-pnp@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.2.tgz#be8e4bfce5d00f0f58e0666a82260c34a57af552" - integrity sha512-f5Knjh7XCyRIzoC/z1Su1yLLRrPrFCgtUAh/9fCSP6NKbATwpOL1+idQVXQokK9GRFURn/jYPGPfegIctwunoA== - -tslib@^1.8.1, tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -tsutils@^3.7.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.10.0.tgz#6f1c95c94606e098592b0dff06590cf9659227d6" - integrity sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q== - dependencies: - tslib "^1.8.1" - -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -type-is@~1.6.16: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -uglify-js@3.4.x: - version "3.4.10" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" - integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== - dependencies: - commander "~2.19.0" - source-map "~0.6.1" - -uglify-js@^3.1.4: - version "3.5.11" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.11.tgz#833442c0aa29b3a7d34344c7c63adaa3f3504f6a" - integrity sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg== - dependencies: - commander "~2.20.0" - source-map "~0.6.1" - -unicode-canonical-property-names-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" - integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== - -unicode-match-property-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" - integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== - dependencies: - unicode-canonical-property-names-ecmascript "^1.0.4" - unicode-property-aliases-ecmascript "^1.0.4" - -unicode-match-property-value-ecmascript@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" - integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== - -unicode-property-aliases-ecmascript@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" - integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== - -unified@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" - integrity sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw== - dependencies: - "@types/unist" "^2.0.0" - "@types/vfile" "^3.0.0" - bail "^1.0.0" - extend "^3.0.0" - is-plain-obj "^1.1.0" - trough "^1.0.0" - vfile "^3.0.0" - x-is-string "^0.1.0" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= - -uniqs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" - integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= - -unique-filename@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" - integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== - dependencies: - unique-slug "^2.0.0" - -unique-slug@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" - integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== - dependencies: - imurmurhash "^0.1.4" - -unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz#3f37fcf351279dcbca7480ab5889bb8a832ee1c6" - integrity sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ== - -unist-util-stringify-position@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.0.tgz#4c452c0dbcbc509f7bcd366e9a8afd646f9d51ae" - integrity sha512-Uz5negUTrf9zm2ZT2Z9kdOL7Mr7FJLyq3ByqagUi7QZRVK1HnspVazvSqwHt73jj7APHtpuJ4K110Jm8O6/elw== - dependencies: - "@types/unist" "^2.0.2" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unquote@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" - integrity sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" - integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== - -upper-case@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" - integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -url-loader@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-1.1.2.tgz#b971d191b83af693c5e3fea4064be9e1f2d7f8d8" - integrity sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg== - dependencies: - loader-utils "^1.1.0" - mime "^2.0.3" - schema-utils "^1.0.0" - -url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util.promisify@1.0.0, util.promisify@^1.0.0, util.promisify@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" - integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== - dependencies: - define-properties "^1.1.2" - object.getownpropertydescriptors "^2.0.3" - -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - -utila@^0.4.0, utila@~0.4: - version "0.4.0" - resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" - integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@^3.0.1, uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -vendors@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.2.tgz#7fcb5eef9f5623b156bcea89ec37d63676f21801" - integrity sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ== - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vfile-message@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1" - integrity sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA== - dependencies: - unist-util-stringify-position "^1.1.1" - -vfile-message@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.0.tgz#750bbb86fe545988a67e899b329bbcabb73edef6" - integrity sha512-YS6qg6UpBfIeiO+6XlhPOuJaoLvt1Y9g2cmlwqhBOOU0XRV8j5RLeoz72t6PWLvNXq3EBG1fQ05wNPrUoz0deQ== - dependencies: - "@types/unist" "^2.0.2" - unist-util-stringify-position "^1.1.1" - -vfile@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" - integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== - dependencies: - is-buffer "^2.0.0" - replace-ext "1.0.0" - unist-util-stringify-position "^1.0.0" - vfile-message "^1.0.0" - -vfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.0.0.tgz#ebf3b48af9fcde524d5e08d5f75812058a5f78ad" - integrity sha512-WMNeHy5djSl895BqE86D7WqA0Ie5fAIeGCa7V1EqiXyJg5LaGch2SUaZueok5abYQGH6mXEAsZ45jkoILIOlyA== - dependencies: - "@types/unist" "^2.0.2" - is-buffer "^2.0.0" - replace-ext "1.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= - dependencies: - indexof "0.0.1" - -w3c-hr-time@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" - integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= - dependencies: - browser-process-hrtime "^0.1.2" - -w3c-xmlserializer@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" - integrity sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg== - dependencies: - domexception "^1.0.1" - webidl-conversions "^4.0.2" - xml-name-validator "^3.0.0" - -walker@^1.0.7, walker@~1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" - integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= - dependencies: - makeerror "1.0.x" - -watchpack@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" - integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== - dependencies: - chokidar "^2.0.2" - graceful-fs "^4.1.2" - neo-async "^2.5.0" - -wbuf@^1.1.0, wbuf@^1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" - integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== - dependencies: - minimalistic-assert "^1.0.0" - -web-namespaces@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.3.tgz#9bbf5c99ff0908d2da031f1d732492a96571a83f" - integrity sha512-r8sAtNmgR0WKOKOxzuSgk09JsHlpKlB+uHi937qypOu3PZ17UxPrierFKDye/uNHjNTTEshu5PId8rojIPj/tA== - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -webpack-dev-middleware@^3.5.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.6.2.tgz#f37a27ad7c09cd7dc67cd97655413abaa1f55942" - integrity sha512-A47I5SX60IkHrMmZUlB0ZKSWi29TZTcPz7cha1Z75yYOsgWh/1AcPmQEbC8ZIbU3A1ytSv1PMU0PyPz2Lmz2jg== - dependencies: - memory-fs "^0.4.1" - mime "^2.3.1" - range-parser "^1.0.3" - webpack-log "^2.0.0" - -webpack-dev-server@3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.2.1.tgz#1b45ce3ecfc55b6ebe5e36dab2777c02bc508c4e" - integrity sha512-sjuE4mnmx6JOh9kvSbPYw3u/6uxCLHNWfhWaIPwcXWsvWOPN+nc5baq4i9jui3oOBRXGonK9+OI0jVkaz6/rCw== - dependencies: - ansi-html "0.0.7" - bonjour "^3.5.0" - chokidar "^2.0.0" - compression "^1.5.2" - connect-history-api-fallback "^1.3.0" - debug "^4.1.1" - del "^3.0.0" - express "^4.16.2" - html-entities "^1.2.0" - http-proxy-middleware "^0.19.1" - import-local "^2.0.0" - internal-ip "^4.2.0" - ip "^1.1.5" - killable "^1.0.0" - loglevel "^1.4.1" - opn "^5.1.0" - portfinder "^1.0.9" - schema-utils "^1.0.0" - selfsigned "^1.9.1" - semver "^5.6.0" - serve-index "^1.7.2" - sockjs "0.3.19" - sockjs-client "1.3.0" - spdy "^4.0.0" - strip-ansi "^3.0.0" - supports-color "^6.1.0" - url "^0.11.0" - webpack-dev-middleware "^3.5.1" - webpack-log "^2.0.0" - yargs "12.0.2" - -webpack-log@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" - integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== - dependencies: - ansi-colors "^3.0.0" - uuid "^3.3.2" - -webpack-manifest-plugin@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-2.0.4.tgz#e4ca2999b09557716b8ba4475fb79fab5986f0cd" - integrity sha512-nejhOHexXDBKQOj/5v5IZSfCeTO3x1Dt1RZEcGfBSul891X/eLIcIVH31gwxPDdsi2Z8LKKFGpM4w9+oTBOSCg== - dependencies: - fs-extra "^7.0.0" - lodash ">=3.5 <5" - tapable "^1.0.0" - -webpack-sources@^1.1.0, webpack-sources@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack@4.29.6: - version "4.29.6" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.29.6.tgz#66bf0ec8beee4d469f8b598d3988ff9d8d90e955" - integrity sha512-MwBwpiE1BQpMDkbnUUaW6K8RFZjljJHArC6tWQJoFm0oQtfoSebtg4Y7/QHnJ/SddtjYLHaKGX64CFjG5rehJw== - dependencies: - "@webassemblyjs/ast" "1.8.5" - "@webassemblyjs/helper-module-context" "1.8.5" - "@webassemblyjs/wasm-edit" "1.8.5" - "@webassemblyjs/wasm-parser" "1.8.5" - acorn "^6.0.5" - acorn-dynamic-import "^4.0.0" - ajv "^6.1.0" - ajv-keywords "^3.1.0" - chrome-trace-event "^1.0.0" - enhanced-resolve "^4.1.0" - eslint-scope "^4.0.0" - json-parse-better-errors "^1.0.2" - loader-runner "^2.3.0" - loader-utils "^1.1.0" - memory-fs "~0.4.1" - micromatch "^3.1.8" - mkdirp "~0.5.0" - neo-async "^2.5.0" - node-libs-browser "^2.0.0" - schema-utils "^1.0.0" - tapable "^1.1.0" - terser-webpack-plugin "^1.1.0" - watchpack "^1.5.0" - webpack-sources "^1.3.0" - -websocket-driver@>=0.5.1: - version "0.7.0" - resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.0.tgz#0caf9d2d755d93aee049d4bdd0d3fe2cca2a24eb" - integrity sha1-DK+dLXVdk67gSdS90NP+LMoqJOs= - dependencies: - http-parser-js ">=0.4.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" - integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg== - -whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" - integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== - dependencies: - iconv-lite "0.4.24" - -whatwg-fetch@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== - -whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" - integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== - -whatwg-url@^6.4.1: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -whatwg-url@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@^1.2.9, which@^1.3.0, which@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -workbox-background-sync@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-4.3.1.tgz#26821b9bf16e9e37fd1d640289edddc08afd1950" - integrity sha512-1uFkvU8JXi7L7fCHVBEEnc3asPpiAL33kO495UMcD5+arew9IbKW2rV5lpzhoWcm/qhGB89YfO4PmB/0hQwPRg== - dependencies: - workbox-core "^4.3.1" - -workbox-broadcast-update@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-broadcast-update/-/workbox-broadcast-update-4.3.1.tgz#e2c0280b149e3a504983b757606ad041f332c35b" - integrity sha512-MTSfgzIljpKLTBPROo4IpKjESD86pPFlZwlvVG32Kb70hW+aob4Jxpblud8EhNb1/L5m43DUM4q7C+W6eQMMbA== - dependencies: - workbox-core "^4.3.1" - -workbox-build@^4.2.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-4.3.1.tgz#414f70fb4d6de47f6538608b80ec52412d233e64" - integrity sha512-UHdwrN3FrDvicM3AqJS/J07X0KXj67R8Cg0waq1MKEOqzo89ap6zh6LmaLnRAjpB+bDIz+7OlPye9iii9KBnxw== - dependencies: - "@babel/runtime" "^7.3.4" - "@hapi/joi" "^15.0.0" - common-tags "^1.8.0" - fs-extra "^4.0.2" - glob "^7.1.3" - lodash.template "^4.4.0" - pretty-bytes "^5.1.0" - stringify-object "^3.3.0" - strip-comments "^1.0.2" - workbox-background-sync "^4.3.1" - workbox-broadcast-update "^4.3.1" - workbox-cacheable-response "^4.3.1" - workbox-core "^4.3.1" - workbox-expiration "^4.3.1" - workbox-google-analytics "^4.3.1" - workbox-navigation-preload "^4.3.1" - workbox-precaching "^4.3.1" - workbox-range-requests "^4.3.1" - workbox-routing "^4.3.1" - workbox-strategies "^4.3.1" - workbox-streams "^4.3.1" - workbox-sw "^4.3.1" - workbox-window "^4.3.1" - -workbox-cacheable-response@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-4.3.1.tgz#f53e079179c095a3f19e5313b284975c91428c91" - integrity sha512-Rp5qlzm6z8IOvnQNkCdO9qrDgDpoPNguovs0H8C+wswLuPgSzSp9p2afb5maUt9R1uTIwOXrVQMmPfPypv+npw== - dependencies: - workbox-core "^4.3.1" - -workbox-core@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-4.3.1.tgz#005d2c6a06a171437afd6ca2904a5727ecd73be6" - integrity sha512-I3C9jlLmMKPxAC1t0ExCq+QoAMd0vAAHULEgRZ7kieCdUd919n53WC0AfvokHNwqRhGn+tIIj7vcb5duCjs2Kg== - -workbox-expiration@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-4.3.1.tgz#d790433562029e56837f341d7f553c4a78ebe921" - integrity sha512-vsJLhgQsQouv9m0rpbXubT5jw0jMQdjpkum0uT+d9tTwhXcEZks7qLfQ9dGSaufTD2eimxbUOJfWLbNQpIDMPw== - dependencies: - workbox-core "^4.3.1" - -workbox-google-analytics@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-4.3.1.tgz#9eda0183b103890b5c256e6f4ea15a1f1548519a" - integrity sha512-xzCjAoKuOb55CBSwQrbyWBKqp35yg1vw9ohIlU2wTy06ZrYfJ8rKochb1MSGlnoBfXGWss3UPzxR5QL5guIFdg== - dependencies: - workbox-background-sync "^4.3.1" - workbox-core "^4.3.1" - workbox-routing "^4.3.1" - workbox-strategies "^4.3.1" - -workbox-navigation-preload@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-4.3.1.tgz#29c8e4db5843803b34cd96dc155f9ebd9afa453d" - integrity sha512-K076n3oFHYp16/C+F8CwrRqD25GitA6Rkd6+qAmLmMv1QHPI2jfDwYqrytOfKfYq42bYtW8Pr21ejZX7GvALOw== - dependencies: - workbox-core "^4.3.1" - -workbox-precaching@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-4.3.1.tgz#9fc45ed122d94bbe1f0ea9584ff5940960771cba" - integrity sha512-piSg/2csPoIi/vPpp48t1q5JLYjMkmg5gsXBQkh/QYapCdVwwmKlU9mHdmy52KsDGIjVaqEUMFvEzn2LRaigqQ== - dependencies: - workbox-core "^4.3.1" - -workbox-range-requests@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-range-requests/-/workbox-range-requests-4.3.1.tgz#f8a470188922145cbf0c09a9a2d5e35645244e74" - integrity sha512-S+HhL9+iTFypJZ/yQSl/x2Bf5pWnbXdd3j57xnb0V60FW1LVn9LRZkPtneODklzYuFZv7qK6riZ5BNyc0R0jZA== - dependencies: - workbox-core "^4.3.1" - -workbox-routing@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-4.3.1.tgz#a675841af623e0bb0c67ce4ed8e724ac0bed0cda" - integrity sha512-FkbtrODA4Imsi0p7TW9u9MXuQ5P4pVs1sWHK4dJMMChVROsbEltuE79fBoIk/BCztvOJ7yUpErMKa4z3uQLX+g== - dependencies: - workbox-core "^4.3.1" - -workbox-strategies@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-4.3.1.tgz#d2be03c4ef214c115e1ab29c9c759c9fe3e9e646" - integrity sha512-F/+E57BmVG8dX6dCCopBlkDvvhg/zj6VDs0PigYwSN23L8hseSRwljrceU2WzTvk/+BSYICsWmRq5qHS2UYzhw== - dependencies: - workbox-core "^4.3.1" - -workbox-streams@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-streams/-/workbox-streams-4.3.1.tgz#0b57da70e982572de09c8742dd0cb40a6b7c2cc3" - integrity sha512-4Kisis1f/y0ihf4l3u/+ndMkJkIT4/6UOacU3A4BwZSAC9pQ9vSvJpIi/WFGQRH/uPXvuVjF5c2RfIPQFSS2uA== - dependencies: - workbox-core "^4.3.1" - -workbox-sw@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-4.3.1.tgz#df69e395c479ef4d14499372bcd84c0f5e246164" - integrity sha512-0jXdusCL2uC5gM3yYFT6QMBzKfBr2XTk0g5TPAV4y8IZDyVNDyj1a8uSXy3/XrvkVTmQvLN4O5k3JawGReXr9w== - -workbox-webpack-plugin@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-4.2.0.tgz#c94c3f69ff39c8a5b0c7e6bebc382cb53410a63d" - integrity sha512-YZsiA+y/ns/GdWRaBsfYv8dln1ebWtGnJcTOg1ppO0pO1tScAHX0yGtHIjndxz3L/UUhE8b0NQE9KeLNwJwA5A== - dependencies: - "@babel/runtime" "^7.0.0" - json-stable-stringify "^1.0.1" - workbox-build "^4.2.0" - -workbox-window@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-4.3.1.tgz#ee6051bf10f06afa5483c9b8dfa0531994ede0f3" - integrity sha512-C5gWKh6I58w3GeSc0wp2Ne+rqVw8qwcmZnQGpjiek8A2wpbxSJb1FdCoQVO+jDJs35bFgo/WETgl1fqgsxN0Hg== - dependencies: - workbox-core "^4.3.1" - -worker-farm@^1.5.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" - integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== - dependencies: - errno "~0.1.7" - -worker-rpc@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/worker-rpc/-/worker-rpc-0.1.1.tgz#cb565bd6d7071a8f16660686051e969ad32f54d5" - integrity sha512-P1WjMrUB3qgJNI9jfmpZ/htmBEjFh//6l/5y8SD9hg1Ef5zTTVVoRjTrTEzPrNBQvmhMxkoTsjOXN10GWU7aCg== - dependencies: - microevent.ts "~0.1.1" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -ws@^5.2.0: - version "5.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" - integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== - dependencies: - async-limiter "~1.0.0" - -ws@^6.1.2: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" - integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== - dependencies: - async-limiter "~1.0.0" - -x-is-string@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" - integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= - -xml-name-validator@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== - -xmlchars@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-1.3.1.tgz#1dda035f833dbb4f86a0c28eaa6ca769214793cf" - integrity sha512-tGkGJkN8XqCod7OT+EvGYK5Z4SfDQGD30zAa58OcnAa0RRWgzUEK72tkXhsX1FZd+rgnhRxFtmO+ihkp8LHSkw== - -xregexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" - integrity sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg== - -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= - -"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - -yargs-parser@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" - integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== - dependencies: - camelcase "^4.1.0" - -yargs-parser@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" - integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs@12.0.2: - version "12.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" - integrity sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ== - dependencies: - cliui "^4.0.0" - decamelize "^2.0.0" - find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^10.1.0" - -yargs@^12.0.2: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== - dependencies: - cliui "^4.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^11.1.1" From 9b2934e2388c5a508b3cbcf22b18b02d9ee5c7f7 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Tue, 30 Jul 2019 10:44:52 -0400 Subject: [PATCH 04/38] re-initiated front --- .DS_Store | Bin 0 -> 6148 bytes client/package.json | 5 + client/src/App.css | 33 -- client/src/App.js | 17 +- client/src/component/Game.js | 11 + client/src/component/Home.js | 11 + client/src/component/Login.js | 11 + client/src/component/Signup.js | 11 + client/src/index.css | 13 - client/src/index.js | 45 ++- client/src/logo.svg | 7 - prisma_server/datamodel.prisma | 4 + prisma_server/docker-compose.yml | 34 ++ .../generated/prisma-client/index.d.ts | 373 ++++++++++++++++++ .../generated/prisma-client/index.js | 17 + .../generated/prisma-client/prisma-schema.js | 151 +++++++ prisma_server/prisma.yml | 6 + 17 files changed, 674 insertions(+), 75 deletions(-) create mode 100644 .DS_Store create mode 100644 client/src/component/Game.js create mode 100644 client/src/component/Home.js create mode 100644 client/src/component/Login.js create mode 100644 client/src/component/Signup.js delete mode 100644 client/src/index.css delete mode 100644 client/src/logo.svg create mode 100644 prisma_server/datamodel.prisma create mode 100644 prisma_server/docker-compose.yml create mode 100644 prisma_server/generated/prisma-client/index.d.ts create mode 100644 prisma_server/generated/prisma-client/index.js create mode 100644 prisma_server/generated/prisma-client/prisma-schema.js create mode 100644 prisma_server/prisma.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..035f606d7dbad880b8ac23be9039ab18fe6f17d8 GIT binary patch literal 6148 zcmeHK%}(1u5S|SwY*Ha|Kq^OHxN%5Se$)e!73hImB_lYrRj{!ImW&<6P9jKC`8D8; z`UJcV-|TLX+O$2QQq4#+-*|RrZGUU+dWcB%$8nFSLqr zoT|9I%%Y;mma--AFEYSuw@R0kQA!E@vVQ9{q!9*6x}lH;zy#M5w$Zd4Mp+S|{6{p* z(z5DyA5~+e`DS%Z>$YyMx4#D0#WbkGYFzfi(PzH;6js-f^H1@SJo{mEmL}6dXY;7Y zt1!)zktt5&1Swz6(>yMw{bHQQrI{zN16sFqYtY%6&35-b?0CDqz4?weJ2>dVf4@JU zxAeR1-r>o`&F$Un+x+{zT>yn|)yRg!1w6p{%PUWUQJxj~6|xpHEGh+s0bxKGcwG#* zT};1yU5_nKD+~w&FTeor4<3}!cUW6ATL+A30f0?}jlkz#f@?g7zQfugMj*I7>rj-rJLdOHIw{|xSYbdI_?ZFj{U9Aa|3Ch@|2Iiu zgaKjT|71WlkAver-p!q@OK-_%tp~k;vT$B)@wo(!If{|XNAVWa2;v?)K;L0)5fO;| N2pAf~2m>$5z!RfrURnSE literal 0 HcmV?d00001 diff --git a/client/package.json b/client/package.json index d2e475a57..825765103 100644 --- a/client/package.json +++ b/client/package.json @@ -3,8 +3,13 @@ "version": "0.1.0", "private": true, "dependencies": { + "apollo-boost": "^0.4.3", + "graphql": "^14.4.2", + "graphql-tag": "^2.10.1", "react": "^16.8.6", + "react-apollo": "^2.5.8", "react-dom": "^16.8.6", + "react-router-dom": "^5.0.1", "react-scripts": "3.0.1" }, "scripts": { diff --git a/client/src/App.css b/client/src/App.css index b41d297ca..e69de29bb 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -1,33 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 40vmin; - pointer-events: none; -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/client/src/App.js b/client/src/App.js index ce9cbd294..3ba13e927 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,24 +1,11 @@ import React from 'react'; -import logo from './logo.svg'; + import './App.css'; function App() { return (
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
+ Hello
); } diff --git a/client/src/component/Game.js b/client/src/component/Game.js new file mode 100644 index 000000000..3c2244bd0 --- /dev/null +++ b/client/src/component/Game.js @@ -0,0 +1,11 @@ +import React, { Component } from 'react' + +export default class Game extends Component { + render() { + return ( +
+ Game +
+ ) + } +} diff --git a/client/src/component/Home.js b/client/src/component/Home.js new file mode 100644 index 000000000..f6796510d --- /dev/null +++ b/client/src/component/Home.js @@ -0,0 +1,11 @@ +import React, { Component } from 'react' + +export default class Home extends Component { + render() { + return ( +
+ Home +
+ ) + } +} diff --git a/client/src/component/Login.js b/client/src/component/Login.js new file mode 100644 index 000000000..4b4401123 --- /dev/null +++ b/client/src/component/Login.js @@ -0,0 +1,11 @@ +import React, { Component } from 'react' + +export default class Login extends Component { + render() { + return ( +
+ Login +
+ ) + } +} diff --git a/client/src/component/Signup.js b/client/src/component/Signup.js new file mode 100644 index 000000000..9604dc4be --- /dev/null +++ b/client/src/component/Signup.js @@ -0,0 +1,11 @@ +import React, { Component } from 'react' + +export default class Signup extends Component { + render() { + return ( +
+ Signup +
+ ) + } +} diff --git a/client/src/index.css b/client/src/index.css deleted file mode 100644 index 4a1df4db7..000000000 --- a/client/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", - "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", - monospace; -} diff --git a/client/src/index.js b/client/src/index.js index 87d1be551..a12060c35 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,12 +1,43 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import './index.css'; +import { + NavLink, + Link, + BrowserRouter as Router, + Route, + Switch +} from 'react-router-dom' +import { ApolloProvider } from 'react-apollo' +import ApolloClient from 'apollo-boost' +import Home from './component/Home' +import Game from './component/Game' +import Signup from './component/Signup' +import Login from './component/Login' import App from './App'; -import * as serviceWorker from './serviceWorker'; -ReactDOM.render(, document.getElementById('root')); +const client = new ApolloClient({ uri: 'http://localhost:4000'}) + + +ReactDOM.render( + + + <> + +
+ + + + + + +
+ +
+
, document.getElementById('root')); -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://bit.ly/CRA-PWA -serviceWorker.unregister(); diff --git a/client/src/logo.svg b/client/src/logo.svg deleted file mode 100644 index 6b60c1042..000000000 --- a/client/src/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/prisma_server/datamodel.prisma b/prisma_server/datamodel.prisma new file mode 100644 index 000000000..8c735e541 --- /dev/null +++ b/prisma_server/datamodel.prisma @@ -0,0 +1,4 @@ +type User { + id: ID! @id + name: String! +} diff --git a/prisma_server/docker-compose.yml b/prisma_server/docker-compose.yml new file mode 100644 index 000000000..a5017c451 --- /dev/null +++ b/prisma_server/docker-compose.yml @@ -0,0 +1,34 @@ +version: '3' +services: + prisma: + image: prismagraphql/prisma:1.34 + restart: always + ports: + - "4466:4466" + environment: + PRISMA_CONFIG: | + port: 4466 + # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security + # managementApiSecret: my-secret + databases: + default: + connector: postgres + host: postgres + user: prisma + password: prisma + rawAccess: true + port: 5432 + migrations: true + postgres: + image: postgres + restart: always + # Uncomment the next two lines to connect to your your database from outside the Docker environment, e.g. using a database GUI like Postico + # ports: + # - "5432:5432" + environment: + POSTGRES_USER: prisma + POSTGRES_PASSWORD: prisma + volumes: + - postgres:/var/lib/postgresql/data +volumes: + postgres: diff --git a/prisma_server/generated/prisma-client/index.d.ts b/prisma_server/generated/prisma-client/index.d.ts new file mode 100644 index 000000000..82417c514 --- /dev/null +++ b/prisma_server/generated/prisma-client/index.d.ts @@ -0,0 +1,373 @@ +// Code generated by Prisma (prisma@1.34.3). DO NOT EDIT. +// Please don't change this file manually but run `prisma generate` to update it. +// For more information, please read the docs: https://www.prisma.io/docs/prisma-client/ + +import { DocumentNode } from "graphql"; +import { + makePrismaClientClass, + BaseClientOptions, + Model +} from "prisma-client-lib"; +import { typeDefs } from "./prisma-schema"; + +export type AtLeastOne }> = Partial & + U[keyof U]; + +export type Maybe = T | undefined | null; + +export interface Exists { + user: (where?: UserWhereInput) => Promise; +} + +export interface Node {} + +export type FragmentableArray = Promise> & Fragmentable; + +export interface Fragmentable { + $fragment(fragment: string | DocumentNode): Promise; +} + +export interface Prisma { + $exists: Exists; + $graphql: ( + query: string, + variables?: { [key: string]: any } + ) => Promise; + + /** + * Queries + */ + + user: (where: UserWhereUniqueInput) => UserNullablePromise; + users: (args?: { + where?: UserWhereInput; + orderBy?: UserOrderByInput; + skip?: Int; + after?: String; + before?: String; + first?: Int; + last?: Int; + }) => FragmentableArray; + usersConnection: (args?: { + where?: UserWhereInput; + orderBy?: UserOrderByInput; + skip?: Int; + after?: String; + before?: String; + first?: Int; + last?: Int; + }) => UserConnectionPromise; + node: (args: { id: ID_Output }) => Node; + + /** + * Mutations + */ + + createUser: (data: UserCreateInput) => UserPromise; + updateUser: (args: { + data: UserUpdateInput; + where: UserWhereUniqueInput; + }) => UserPromise; + updateManyUsers: (args: { + data: UserUpdateManyMutationInput; + where?: UserWhereInput; + }) => BatchPayloadPromise; + upsertUser: (args: { + where: UserWhereUniqueInput; + create: UserCreateInput; + update: UserUpdateInput; + }) => UserPromise; + deleteUser: (where: UserWhereUniqueInput) => UserPromise; + deleteManyUsers: (where?: UserWhereInput) => BatchPayloadPromise; + + /** + * Subscriptions + */ + + $subscribe: Subscription; +} + +export interface Subscription { + user: ( + where?: UserSubscriptionWhereInput + ) => UserSubscriptionPayloadSubscription; +} + +export interface ClientConstructor { + new (options?: BaseClientOptions): T; +} + +/** + * Types + */ + +export type UserOrderByInput = "id_ASC" | "id_DESC" | "name_ASC" | "name_DESC"; + +export type MutationType = "CREATED" | "UPDATED" | "DELETED"; + +export type UserWhereUniqueInput = AtLeastOne<{ + id: Maybe; +}>; + +export interface UserWhereInput { + id?: Maybe; + id_not?: Maybe; + id_in?: Maybe; + id_not_in?: Maybe; + id_lt?: Maybe; + id_lte?: Maybe; + id_gt?: Maybe; + id_gte?: Maybe; + id_contains?: Maybe; + id_not_contains?: Maybe; + id_starts_with?: Maybe; + id_not_starts_with?: Maybe; + id_ends_with?: Maybe; + id_not_ends_with?: Maybe; + name?: Maybe; + name_not?: Maybe; + name_in?: Maybe; + name_not_in?: Maybe; + name_lt?: Maybe; + name_lte?: Maybe; + name_gt?: Maybe; + name_gte?: Maybe; + name_contains?: Maybe; + name_not_contains?: Maybe; + name_starts_with?: Maybe; + name_not_starts_with?: Maybe; + name_ends_with?: Maybe; + name_not_ends_with?: Maybe; + AND?: Maybe; + OR?: Maybe; + NOT?: Maybe; +} + +export interface UserCreateInput { + id?: Maybe; + name: String; +} + +export interface UserUpdateInput { + name?: Maybe; +} + +export interface UserUpdateManyMutationInput { + name?: Maybe; +} + +export interface UserSubscriptionWhereInput { + mutation_in?: Maybe; + updatedFields_contains?: Maybe; + updatedFields_contains_every?: Maybe; + updatedFields_contains_some?: Maybe; + node?: Maybe; + AND?: Maybe; + OR?: Maybe; + NOT?: Maybe; +} + +export interface NodeNode { + id: ID_Output; +} + +export interface User { + id: ID_Output; + name: String; +} + +export interface UserPromise extends Promise, Fragmentable { + id: () => Promise; + name: () => Promise; +} + +export interface UserSubscription + extends Promise>, + Fragmentable { + id: () => Promise>; + name: () => Promise>; +} + +export interface UserNullablePromise + extends Promise, + Fragmentable { + id: () => Promise; + name: () => Promise; +} + +export interface UserConnection { + pageInfo: PageInfo; + edges: UserEdge[]; +} + +export interface UserConnectionPromise + extends Promise, + Fragmentable { + pageInfo: () => T; + edges: >() => T; + aggregate: () => T; +} + +export interface UserConnectionSubscription + extends Promise>, + Fragmentable { + pageInfo: () => T; + edges: >>() => T; + aggregate: () => T; +} + +export interface PageInfo { + hasNextPage: Boolean; + hasPreviousPage: Boolean; + startCursor?: String; + endCursor?: String; +} + +export interface PageInfoPromise extends Promise, Fragmentable { + hasNextPage: () => Promise; + hasPreviousPage: () => Promise; + startCursor: () => Promise; + endCursor: () => Promise; +} + +export interface PageInfoSubscription + extends Promise>, + Fragmentable { + hasNextPage: () => Promise>; + hasPreviousPage: () => Promise>; + startCursor: () => Promise>; + endCursor: () => Promise>; +} + +export interface UserEdge { + node: User; + cursor: String; +} + +export interface UserEdgePromise extends Promise, Fragmentable { + node: () => T; + cursor: () => Promise; +} + +export interface UserEdgeSubscription + extends Promise>, + Fragmentable { + node: () => T; + cursor: () => Promise>; +} + +export interface AggregateUser { + count: Int; +} + +export interface AggregateUserPromise + extends Promise, + Fragmentable { + count: () => Promise; +} + +export interface AggregateUserSubscription + extends Promise>, + Fragmentable { + count: () => Promise>; +} + +export interface BatchPayload { + count: Long; +} + +export interface BatchPayloadPromise + extends Promise, + Fragmentable { + count: () => Promise; +} + +export interface BatchPayloadSubscription + extends Promise>, + Fragmentable { + count: () => Promise>; +} + +export interface UserSubscriptionPayload { + mutation: MutationType; + node: User; + updatedFields: String[]; + previousValues: UserPreviousValues; +} + +export interface UserSubscriptionPayloadPromise + extends Promise, + Fragmentable { + mutation: () => Promise; + node: () => T; + updatedFields: () => Promise; + previousValues: () => T; +} + +export interface UserSubscriptionPayloadSubscription + extends Promise>, + Fragmentable { + mutation: () => Promise>; + node: () => T; + updatedFields: () => Promise>; + previousValues: () => T; +} + +export interface UserPreviousValues { + id: ID_Output; + name: String; +} + +export interface UserPreviousValuesPromise + extends Promise, + Fragmentable { + id: () => Promise; + name: () => Promise; +} + +export interface UserPreviousValuesSubscription + extends Promise>, + Fragmentable { + id: () => Promise>; + name: () => Promise>; +} + +/* +The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. +*/ +export type ID_Input = string | number; +export type ID_Output = string; + +/* +The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. +*/ +export type String = string; + +/* +The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. +*/ +export type Int = number; + +/* +The `Boolean` scalar type represents `true` or `false`. +*/ +export type Boolean = boolean; + +export type Long = string; + +/** + * Model Metadata + */ + +export const models: Model[] = [ + { + name: "User", + embedded: false + } +]; + +/** + * Type Defs + */ + +export const prisma: Prisma; diff --git a/prisma_server/generated/prisma-client/index.js b/prisma_server/generated/prisma-client/index.js new file mode 100644 index 000000000..7d6a893c9 --- /dev/null +++ b/prisma_server/generated/prisma-client/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var prisma_lib_1 = require("prisma-client-lib"); +var typeDefs = require("./prisma-schema").typeDefs; + +var models = [ + { + name: "User", + embedded: false + } +]; +exports.Prisma = prisma_lib_1.makePrismaClientClass({ + typeDefs, + models, + endpoint: `http://localhost:4466` +}); +exports.prisma = new exports.Prisma(); diff --git a/prisma_server/generated/prisma-client/prisma-schema.js b/prisma_server/generated/prisma-client/prisma-schema.js new file mode 100644 index 000000000..ca0cc0a73 --- /dev/null +++ b/prisma_server/generated/prisma-client/prisma-schema.js @@ -0,0 +1,151 @@ +module.exports = { + typeDefs: // Code generated by Prisma (prisma@1.34.3). DO NOT EDIT. + // Please don't change this file manually but run `prisma generate` to update it. + // For more information, please read the docs: https://www.prisma.io/docs/prisma-client/ + +/* GraphQL */ `type AggregateUser { + count: Int! +} + +type BatchPayload { + count: Long! +} + +scalar Long + +type Mutation { + createUser(data: UserCreateInput!): User! + updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User + updateManyUsers(data: UserUpdateManyMutationInput!, where: UserWhereInput): BatchPayload! + upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User! + deleteUser(where: UserWhereUniqueInput!): User + deleteManyUsers(where: UserWhereInput): BatchPayload! +} + +enum MutationType { + CREATED + UPDATED + DELETED +} + +interface Node { + id: ID! +} + +type PageInfo { + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String + endCursor: String +} + +type Query { + user(where: UserWhereUniqueInput!): User + users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]! + usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection! + node(id: ID!): Node +} + +type Subscription { + user(where: UserSubscriptionWhereInput): UserSubscriptionPayload +} + +type User { + id: ID! + name: String! +} + +type UserConnection { + pageInfo: PageInfo! + edges: [UserEdge]! + aggregate: AggregateUser! +} + +input UserCreateInput { + id: ID + name: String! +} + +type UserEdge { + node: User! + cursor: String! +} + +enum UserOrderByInput { + id_ASC + id_DESC + name_ASC + name_DESC +} + +type UserPreviousValues { + id: ID! + name: String! +} + +type UserSubscriptionPayload { + mutation: MutationType! + node: User + updatedFields: [String!] + previousValues: UserPreviousValues +} + +input UserSubscriptionWhereInput { + mutation_in: [MutationType!] + updatedFields_contains: String + updatedFields_contains_every: [String!] + updatedFields_contains_some: [String!] + node: UserWhereInput + AND: [UserSubscriptionWhereInput!] + OR: [UserSubscriptionWhereInput!] + NOT: [UserSubscriptionWhereInput!] +} + +input UserUpdateInput { + name: String +} + +input UserUpdateManyMutationInput { + name: String +} + +input UserWhereInput { + id: ID + id_not: ID + id_in: [ID!] + id_not_in: [ID!] + id_lt: ID + id_lte: ID + id_gt: ID + id_gte: ID + id_contains: ID + id_not_contains: ID + id_starts_with: ID + id_not_starts_with: ID + id_ends_with: ID + id_not_ends_with: ID + name: String + name_not: String + name_in: [String!] + name_not_in: [String!] + name_lt: String + name_lte: String + name_gt: String + name_gte: String + name_contains: String + name_not_contains: String + name_starts_with: String + name_not_starts_with: String + name_ends_with: String + name_not_ends_with: String + AND: [UserWhereInput!] + OR: [UserWhereInput!] + NOT: [UserWhereInput!] +} + +input UserWhereUniqueInput { + id: ID +} +` + } + \ No newline at end of file diff --git a/prisma_server/prisma.yml b/prisma_server/prisma.yml new file mode 100644 index 000000000..64f59e58f --- /dev/null +++ b/prisma_server/prisma.yml @@ -0,0 +1,6 @@ +endpoint: http://localhost:4466 +datamodel: datamodel.prisma + +generate: + - generator: javascript-client + output: ./generated/prisma-client/ \ No newline at end of file From f67a2ff9ab8122693eb00c4ccd7b7ca770d3c311 Mon Sep 17 00:00:00 2001 From: Wei Du <30298322+chef27615@users.noreply.github.com> Date: Tue, 30 Jul 2019 10:58:27 -0400 Subject: [PATCH 05/38] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 035f606d7dbad880b8ac23be9039ab18fe6f17d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}(1u5S|SwY*Ha|Kq^OHxN%5Se$)e!73hImB_lYrRj{!ImW&<6P9jKC`8D8; z`UJcV-|TLX+O$2QQq4#+-*|RrZGUU+dWcB%$8nFSLqr zoT|9I%%Y;mma--AFEYSuw@R0kQA!E@vVQ9{q!9*6x}lH;zy#M5w$Zd4Mp+S|{6{p* z(z5DyA5~+e`DS%Z>$YyMx4#D0#WbkGYFzfi(PzH;6js-f^H1@SJo{mEmL}6dXY;7Y zt1!)zktt5&1Swz6(>yMw{bHQQrI{zN16sFqYtY%6&35-b?0CDqz4?weJ2>dVf4@JU zxAeR1-r>o`&F$Un+x+{zT>yn|)yRg!1w6p{%PUWUQJxj~6|xpHEGh+s0bxKGcwG#* zT};1yU5_nKD+~w&FTeor4<3}!cUW6ATL+A30f0?}jlkz#f@?g7zQfugMj*I7>rj-rJLdOHIw{|xSYbdI_?ZFj{U9Aa|3Ch@|2Iiu zgaKjT|71WlkAver-p!q@OK-_%tp~k;vT$B)@wo(!If{|XNAVWa2;v?)K;L0)5fO;| N2pAf~2m>$5z!RfrURnSE From 4bb4093581f37ae8ec97e0aa8e3d55fdbfd11960 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 11:17:48 -0400 Subject: [PATCH 06/38] app displaying and setting up Login --- client/package.json | 2 + client/src/App.js | 19 +- client/src/components/Header.js | 45 + client/src/components/Login.js | 65 + client/src/constants.js | 1 + client/src/index.js | 17 +- node_modules/.bin/loose-envify | 15 + node_modules/.bin/loose-envify.cmd | 7 + node_modules/.yarn-integrity | 55 + node_modules/@types/node/LICENSE | 21 + node_modules/@types/node/README.md | 16 + node_modules/@types/node/assert.d.ts | 52 + node_modules/@types/node/async_hooks.d.ts | 132 + node_modules/@types/node/base.d.ts | 41 + node_modules/@types/node/buffer.d.ts | 22 + node_modules/@types/node/child_process.d.ts | 370 ++ node_modules/@types/node/cluster.d.ts | 260 ++ node_modules/@types/node/console.d.ts | 3 + node_modules/@types/node/constants.d.ts | 278 ++ node_modules/@types/node/crypto.d.ts | 602 +++ node_modules/@types/node/dgram.d.ts | 102 + node_modules/@types/node/dns.d.ts | 366 ++ node_modules/@types/node/domain.d.ts | 16 + node_modules/@types/node/events.d.ts | 30 + node_modules/@types/node/fs.d.ts | 2297 ++++++++++++ node_modules/@types/node/globals.d.ts | 1180 ++++++ node_modules/@types/node/http.d.ts | 279 ++ node_modules/@types/node/http2.d.ts | 960 +++++ node_modules/@types/node/https.d.ts | 53 + node_modules/@types/node/index.d.ts | 99 + node_modules/@types/node/inspector.d.ts | 3257 +++++++++++++++++ node_modules/@types/node/module.d.ts | 3 + node_modules/@types/node/net.d.ts | 249 ++ node_modules/@types/node/os.d.ts | 201 + node_modules/@types/node/package.json | 206 ++ node_modules/@types/node/path.d.ts | 159 + node_modules/@types/node/perf_hooks.d.ts | 304 ++ node_modules/@types/node/process.d.ts | 3 + node_modules/@types/node/punycode.d.ts | 12 + node_modules/@types/node/querystring.d.ts | 32 + node_modules/@types/node/readline.d.ts | 136 + node_modules/@types/node/repl.d.ts | 382 ++ node_modules/@types/node/stream.d.ts | 307 ++ node_modules/@types/node/string_decoder.d.ts | 7 + node_modules/@types/node/timers.d.ts | 16 + node_modules/@types/node/tls.d.ts | 418 +++ node_modules/@types/node/trace_events.d.ts | 61 + node_modules/@types/node/ts3.2/globals.d.ts | 19 + node_modules/@types/node/ts3.2/index.d.ts | 20 + node_modules/@types/node/ts3.2/util.d.ts | 15 + node_modules/@types/node/tty.d.ts | 50 + node_modules/@types/node/url.d.ts | 104 + node_modules/@types/node/util.d.ts | 165 + node_modules/@types/node/v8.d.ts | 52 + node_modules/@types/node/vm.d.ts | 95 + node_modules/@types/node/worker_threads.d.ts | 153 + node_modules/@types/node/zlib.d.ts | 352 ++ node_modules/@types/zen-observable/LICENSE | 21 + node_modules/@types/zen-observable/README.md | 16 + node_modules/@types/zen-observable/index.d.ts | 65 + .../@types/zen-observable/package.json | 32 + node_modules/@wry/context/LICENSE | 21 + node_modules/@wry/context/README.md | 4 + node_modules/@wry/context/lib/context.d.ts | 8 + node_modules/@wry/context/lib/context.esm.js | 199 + .../@wry/context/lib/context.esm.js.map | 1 + node_modules/@wry/context/lib/context.js | 207 ++ node_modules/@wry/context/lib/context.js.map | 1 + node_modules/@wry/context/lib/slot.d.ts | 12 + node_modules/@wry/context/lib/slot.js | 139 + node_modules/@wry/context/lib/slot.js.map | 1 + node_modules/@wry/context/package.json | 33 + node_modules/@wry/context/rollup.config.js | 40 + node_modules/@wry/context/tsconfig.json | 7 + .../@wry/context/tsconfig.rollup.json | 6 + node_modules/@wry/equality/LICENSE | 21 + node_modules/@wry/equality/README.md | 4 + node_modules/@wry/equality/lib/equality.d.ts | 5 + .../@wry/equality/lib/equality.esm.js | 129 + .../@wry/equality/lib/equality.esm.js.map | 1 + node_modules/@wry/equality/lib/equality.js | 132 + .../@wry/equality/lib/equality.js.map | 1 + node_modules/@wry/equality/package.json | 32 + node_modules/@wry/equality/rollup.config.js | 40 + node_modules/@wry/equality/tsconfig.json | 7 + .../@wry/equality/tsconfig.rollup.json | 6 + node_modules/apollo-boost/CHANGELOG.md | 38 + node_modules/apollo-boost/LICENSE | 22 + node_modules/apollo-boost/README.md | 78 + node_modules/apollo-boost/jest.config.js | 3 + node_modules/apollo-boost/lib/bundle.cjs.js | 176 + .../apollo-boost/lib/bundle.cjs.js.map | 1 + .../apollo-boost/lib/bundle.cjs.min.js | 1 + node_modules/apollo-boost/lib/bundle.esm.js | 125 + .../apollo-boost/lib/bundle.esm.js.map | 1 + node_modules/apollo-boost/lib/bundle.umd.js | 172 + .../apollo-boost/lib/bundle.umd.js.map | 1 + node_modules/apollo-boost/lib/index.d.ts | 40 + node_modules/apollo-boost/lib/index.d.ts.map | 1 + node_modules/apollo-boost/lib/index.js | 126 + node_modules/apollo-boost/lib/index.js.map | 1 + node_modules/apollo-boost/package.json | 52 + .../__tests__/__snapshots__/config.ts.snap | 9 + .../apollo-boost/src/__tests__/config.ts | 225 ++ .../apollo-boost/src/__tests__/smoke.ts | 17 + node_modules/apollo-boost/src/index.ts | 201 + .../apollo-cache-inmemory/CHANGELOG.md | 153 + node_modules/apollo-cache-inmemory/LICENSE | 22 + node_modules/apollo-cache-inmemory/README.md | 321 ++ .../apollo-cache-inmemory/jest.config.js | 3 + .../lib/__tests__/cache.d.ts | 2 + .../lib/__tests__/cache.d.ts.map | 1 + .../lib/__tests__/cache.js | 627 ++++ .../lib/__tests__/cache.js.map | 1 + .../lib/__tests__/diffAgainstStore.d.ts | 2 + .../lib/__tests__/diffAgainstStore.d.ts.map | 1 + .../lib/__tests__/diffAgainstStore.js | 678 ++++ .../lib/__tests__/diffAgainstStore.js.map | 1 + .../lib/__tests__/fragmentMatcher.d.ts | 2 + .../lib/__tests__/fragmentMatcher.d.ts.map | 1 + .../lib/__tests__/fragmentMatcher.js | 79 + .../lib/__tests__/fragmentMatcher.js.map | 1 + .../lib/__tests__/mapCache.d.ts | 1 + .../lib/__tests__/mapCache.d.ts.map | 1 + .../lib/__tests__/mapCache.js | 18 + .../lib/__tests__/mapCache.js.map | 1 + .../lib/__tests__/objectCache.d.ts | 2 + .../lib/__tests__/objectCache.d.ts.map | 1 + .../lib/__tests__/objectCache.js | 33 + .../lib/__tests__/objectCache.js.map | 1 + .../lib/__tests__/readFromStore.d.ts | 2 + .../lib/__tests__/readFromStore.d.ts.map | 1 + .../lib/__tests__/readFromStore.js | 555 +++ .../lib/__tests__/readFromStore.js.map | 1 + .../lib/__tests__/recordingCache.d.ts | 2 + .../lib/__tests__/recordingCache.d.ts.map | 1 + .../lib/__tests__/recordingCache.js | 70 + .../lib/__tests__/recordingCache.js.map | 1 + .../lib/__tests__/roundtrip.d.ts | 2 + .../lib/__tests__/roundtrip.d.ts.map | 1 + .../lib/__tests__/roundtrip.js | 275 ++ .../lib/__tests__/roundtrip.js.map | 1 + .../lib/__tests__/writeToStore.d.ts | 2 + .../lib/__tests__/writeToStore.d.ts.map | 1 + .../lib/__tests__/writeToStore.js | 1523 ++++++++ .../lib/__tests__/writeToStore.js.map | 1 + .../apollo-cache-inmemory/lib/bundle.cjs.js | 1332 +++++++ .../lib/bundle.cjs.js.map | 1 + .../lib/bundle.cjs.min.js | 1 + .../apollo-cache-inmemory/lib/bundle.esm.js | 1022 ++++++ .../lib/bundle.esm.js.map | 1 + .../apollo-cache-inmemory/lib/bundle.umd.js | 1336 +++++++ .../lib/bundle.umd.js.map | 1 + .../lib/depTrackingCache.d.ts | 14 + .../lib/depTrackingCache.d.ts.map | 1 + .../lib/depTrackingCache.js | 65 + .../lib/depTrackingCache.js.map | 1 + .../lib/fixPolyfills.d.ts | 2 + .../lib/fixPolyfills.d.ts.map | 1 + .../apollo-cache-inmemory/lib/fixPolyfills.js | 49 + .../lib/fixPolyfills.js.map | 1 + .../lib/fragmentMatcher.d.ts | 18 + .../lib/fragmentMatcher.d.ts.map | 1 + .../lib/fragmentMatcher.js | 94 + .../lib/fragmentMatcher.js.map | 1 + .../fragmentMatcherIntrospectionQuery.d.ts | 3 + ...fragmentMatcherIntrospectionQuery.d.ts.map | 1 + .../lib/fragmentMatcherIntrospectionQuery.js | 99 + .../fragmentMatcherIntrospectionQuery.js.map | 1 + .../lib/inMemoryCache.d.ts | 46 + .../lib/inMemoryCache.d.ts.map | 1 + .../lib/inMemoryCache.js | 233 ++ .../lib/inMemoryCache.js.map | 1 + .../apollo-cache-inmemory/lib/index.d.ts | 7 + .../apollo-cache-inmemory/lib/index.d.ts.map | 1 + .../apollo-cache-inmemory/lib/index.js | 11 + .../apollo-cache-inmemory/lib/index.js.map | 1 + .../apollo-cache-inmemory/lib/mapCache.d.ts | 13 + .../lib/mapCache.d.ts.map | 1 + .../apollo-cache-inmemory/lib/mapCache.js | 42 + .../apollo-cache-inmemory/lib/mapCache.js.map | 1 + .../lib/objectCache.d.ts | 13 + .../lib/objectCache.d.ts.map | 1 + .../apollo-cache-inmemory/lib/objectCache.js | 33 + .../lib/objectCache.js.map | 1 + .../lib/readFromStore.d.ts | 34 + .../lib/readFromStore.d.ts.map | 1 + .../lib/readFromStore.js | 318 ++ .../lib/readFromStore.js.map | 1 + .../apollo-cache-inmemory/lib/types.d.ts | 80 + .../apollo-cache-inmemory/lib/types.d.ts.map | 1 + .../apollo-cache-inmemory/lib/types.js | 3 + .../apollo-cache-inmemory/lib/types.js.map | 1 + .../lib/writeToStore.d.ts | 46 + .../lib/writeToStore.d.ts.map | 1 + .../apollo-cache-inmemory/lib/writeToStore.js | 276 ++ .../lib/writeToStore.js.map | 1 + .../apollo-cache-inmemory/package.json | 52 + node_modules/apollo-cache/CHANGELOG.md | 72 + node_modules/apollo-cache/LICENSE | 22 + node_modules/apollo-cache/jest.config.js | 3 + node_modules/apollo-cache/lib/bundle.cjs.js | 194 + .../apollo-cache/lib/bundle.cjs.js.map | 1 + .../apollo-cache/lib/bundle.cjs.min.js | 1 + node_modules/apollo-cache/lib/bundle.esm.js | 175 + .../apollo-cache/lib/bundle.esm.js.map | 1 + node_modules/apollo-cache/lib/bundle.umd.js | 208 ++ .../apollo-cache/lib/bundle.umd.js.map | 1 + node_modules/apollo-cache/lib/cache.d.ts | 24 + node_modules/apollo-cache/lib/cache.d.ts.map | 1 + node_modules/apollo-cache/lib/cache.js | 75 + node_modules/apollo-cache/lib/cache.js.map | 1 + node_modules/apollo-cache/lib/index.d.ts | 3 + node_modules/apollo-cache/lib/index.d.ts.map | 1 + node_modules/apollo-cache/lib/index.js | 6 + node_modules/apollo-cache/lib/index.js.map | 1 + .../apollo-cache/lib/types/Cache.d.ts | 31 + .../apollo-cache/lib/types/Cache.d.ts.map | 1 + node_modules/apollo-cache/lib/types/Cache.js | 6 + .../apollo-cache/lib/types/Cache.js.map | 1 + .../apollo-cache/lib/types/DataProxy.d.ts | 35 + .../apollo-cache/lib/types/DataProxy.d.ts.map | 1 + .../apollo-cache/lib/types/DataProxy.js | 3 + .../apollo-cache/lib/types/DataProxy.js.map | 1 + .../apollo-cache/lib/types/index.d.ts | 3 + .../apollo-cache/lib/types/index.d.ts.map | 1 + node_modules/apollo-cache/lib/types/index.js | 5 + .../apollo-cache/lib/types/index.js.map | 1 + node_modules/apollo-cache/lib/utils.d.ts | 5 + node_modules/apollo-cache/lib/utils.d.ts.map | 1 + node_modules/apollo-cache/lib/utils.js | 101 + node_modules/apollo-cache/lib/utils.js.map | 1 + node_modules/apollo-cache/package.json | 43 + .../src/__tests__/__snapshots__/utils.ts.snap | 63 + .../apollo-cache/src/__tests__/cache.ts | 149 + .../apollo-cache/src/__tests__/utils.ts | 76 + node_modules/apollo-cache/src/cache.ts | 150 + node_modules/apollo-cache/src/index.ts | 2 + node_modules/apollo-cache/src/types/Cache.ts | 40 + .../apollo-cache/src/types/DataProxy.ts | 127 + node_modules/apollo-cache/src/types/index.ts | 2 + node_modules/apollo-cache/src/utils.ts | 123 + node_modules/apollo-client/ApolloClient.d.ts | 71 + .../apollo-client/ApolloClient.d.ts.map | 1 + node_modules/apollo-client/ApolloClient.js | 219 ++ .../apollo-client/ApolloClient.js.map | 1 + node_modules/apollo-client/LICENSE | 22 + node_modules/apollo-client/README.md | 127 + node_modules/apollo-client/bundle.cjs.js | 2722 ++++++++++++++ node_modules/apollo-client/bundle.cjs.js.map | 1 + node_modules/apollo-client/bundle.cjs.min.js | 1 + node_modules/apollo-client/bundle.esm.js | 2107 +++++++++++ node_modules/apollo-client/bundle.esm.js.map | 1 + node_modules/apollo-client/bundle.umd.js | 2726 ++++++++++++++ node_modules/apollo-client/bundle.umd.js.map | 1 + .../apollo-client/config/jest/setup.d.ts | 2 + .../apollo-client/config/jest/setup.d.ts.map | 1 + .../apollo-client/config/jest/setup.js | 6 + .../apollo-client/config/jest/setup.js.map | 1 + .../apollo-client/core/LocalState.d.ts | 65 + .../apollo-client/core/LocalState.d.ts.map | 1 + node_modules/apollo-client/core/LocalState.js | 276 ++ .../apollo-client/core/LocalState.js.map | 1 + .../apollo-client/core/ObservableQuery.d.ts | 75 + .../core/ObservableQuery.d.ts.map | 1 + .../apollo-client/core/ObservableQuery.js | 366 ++ .../apollo-client/core/ObservableQuery.js.map | 1 + .../apollo-client/core/QueryManager.d.ts | 102 + .../apollo-client/core/QueryManager.d.ts.map | 1 + .../apollo-client/core/QueryManager.js | 867 +++++ .../apollo-client/core/QueryManager.js.map | 1 + .../apollo-client/core/networkStatus.d.ts | 11 + .../apollo-client/core/networkStatus.d.ts.map | 1 + .../apollo-client/core/networkStatus.js | 17 + .../apollo-client/core/networkStatus.js.map | 1 + node_modules/apollo-client/core/types.d.ts | 43 + .../apollo-client/core/types.d.ts.map | 1 + node_modules/apollo-client/core/types.js | 9 + node_modules/apollo-client/core/types.js.map | 1 + .../apollo-client/core/watchQueryOptions.d.ts | 71 + .../core/watchQueryOptions.d.ts.map | 1 + .../apollo-client/core/watchQueryOptions.js | 3 + .../core/watchQueryOptions.js.map | 1 + .../apollo-client/data/mutations.d.ts | 19 + .../apollo-client/data/mutations.d.ts.map | 1 + node_modules/apollo-client/data/mutations.js | 41 + .../apollo-client/data/mutations.js.map | 1 + node_modules/apollo-client/data/queries.d.ts | 34 + .../apollo-client/data/queries.d.ts.map | 1 + node_modules/apollo-client/data/queries.js | 112 + .../apollo-client/data/queries.js.map | 1 + node_modules/apollo-client/data/store.d.ts | 49 + .../apollo-client/data/store.d.ts.map | 1 + node_modules/apollo-client/data/store.js | 132 + node_modules/apollo-client/data/store.js.map | 1 + .../apollo-client/errors/ApolloError.d.ts | 15 + .../apollo-client/errors/ApolloError.d.ts.map | 1 + .../apollo-client/errors/ApolloError.js | 45 + .../apollo-client/errors/ApolloError.js.map | 1 + node_modules/apollo-client/index.d.ts | 11 + node_modules/apollo-client/index.d.ts.map | 1 + node_modules/apollo-client/index.js | 15 + node_modules/apollo-client/index.js.map | 1 + node_modules/apollo-client/package.json | 38 + .../apollo-client/util/Observable.d.ts | 7 + .../apollo-client/util/Observable.d.ts.map | 1 + node_modules/apollo-client/util/Observable.js | 20 + .../apollo-client/util/Observable.js.map | 1 + node_modules/apollo-client/util/arrays.d.ts | 2 + .../apollo-client/util/arrays.d.ts.map | 1 + node_modules/apollo-client/util/arrays.js | 7 + node_modules/apollo-client/util/arrays.js.map | 1 + .../util/capitalizeFirstLetter.d.ts | 2 + .../util/capitalizeFirstLetter.d.ts.map | 1 + .../util/capitalizeFirstLetter.js | 7 + .../util/capitalizeFirstLetter.js.map | 1 + .../util/observableToPromise.d.ts | 16 + .../util/observableToPromise.d.ts.map | 1 + .../apollo-client/util/observableToPromise.js | 78 + .../util/observableToPromise.js.map | 1 + .../apollo-client/util/observables.d.ts | 4 + .../apollo-client/util/observables.d.ts.map | 1 + .../apollo-client/util/observables.js | 63 + .../apollo-client/util/observables.js.map | 1 + .../apollo-client/util/subscribeAndCount.d.ts | 6 + .../util/subscribeAndCount.d.ts.map | 1 + .../apollo-client/util/subscribeAndCount.js | 22 + .../util/subscribeAndCount.js.map | 1 + node_modules/apollo-client/util/wrap.d.ts | 6 + node_modules/apollo-client/util/wrap.d.ts.map | 1 + node_modules/apollo-client/util/wrap.js | 40 + node_modules/apollo-client/util/wrap.js.map | 1 + node_modules/apollo-client/version.d.ts | 2 + node_modules/apollo-client/version.d.ts.map | 1 + node_modules/apollo-client/version.js | 1 + node_modules/apollo-client/version.js.map | 1 + node_modules/apollo-link-error/CHANGELOG.md | 52 + node_modules/apollo-link-error/LICENSE | 21 + node_modules/apollo-link-error/README.md | 93 + .../apollo-link-error/lib/bundle.cjs.js | 89 + .../apollo-link-error/lib/bundle.cjs.js.map | 1 + .../apollo-link-error/lib/bundle.esm.js | 84 + .../apollo-link-error/lib/bundle.esm.js.map | 1 + .../apollo-link-error/lib/bundle.umd.js | 92 + .../apollo-link-error/lib/bundle.umd.js.map | 1 + node_modules/apollo-link-error/lib/index.d.ts | 23 + .../apollo-link-error/lib/index.d.ts.map | 1 + node_modules/apollo-link-error/lib/index.js | 85 + .../apollo-link-error/lib/index.js.map | 1 + node_modules/apollo-link-error/package.json | 61 + .../apollo-link-http-common/CHANGELOG.md | 31 + node_modules/apollo-link-http-common/LICENSE | 21 + .../apollo-link-http-common/README.md | 9 + .../apollo-link-http-common/lib/bundle.cjs.js | 136 + .../lib/bundle.cjs.js.map | 1 + .../apollo-link-http-common/lib/bundle.esm.js | 125 + .../lib/bundle.esm.js.map | 1 + .../apollo-link-http-common/lib/bundle.umd.js | 138 + .../lib/bundle.umd.js.map | 1 + .../apollo-link-http-common/lib/index.d.ts | 66 + .../lib/index.d.ts.map | 1 + .../apollo-link-http-common/lib/index.js | 124 + .../apollo-link-http-common/lib/index.js.map | 1 + .../apollo-link-http-common/package.json | 71 + node_modules/apollo-link-http/CHANGELOG.md | 85 + node_modules/apollo-link-http/LICENSE | 21 + node_modules/apollo-link-http/README.md | 315 ++ .../apollo-link-http/lib/bundle.cjs.js | 150 + .../apollo-link-http/lib/bundle.cjs.js.map | 1 + .../apollo-link-http/lib/bundle.esm.js | 145 + .../apollo-link-http/lib/bundle.esm.js.map | 1 + .../apollo-link-http/lib/bundle.umd.js | 152 + .../apollo-link-http/lib/bundle.umd.js.map | 1 + .../apollo-link-http/lib/httpLink.d.ts | 17 + .../apollo-link-http/lib/httpLink.d.ts.map | 1 + node_modules/apollo-link-http/lib/httpLink.js | 145 + .../apollo-link-http/lib/httpLink.js.map | 1 + node_modules/apollo-link-http/lib/index.d.ts | 2 + .../apollo-link-http/lib/index.d.ts.map | 1 + node_modules/apollo-link-http/lib/index.js | 5 + .../apollo-link-http/lib/index.js.map | 1 + node_modules/apollo-link-http/package.json | 78 + node_modules/apollo-link/CHANGELOG.md | 57 + node_modules/apollo-link/LICENSE | 21 + node_modules/apollo-link/README.md | 69 + .../apollo-link/apollo-link-1.2.8.tgz | Bin 0 -> 37346 bytes node_modules/apollo-link/lib/bundle.cjs.js | 212 ++ .../apollo-link/lib/bundle.cjs.js.map | 1 + node_modules/apollo-link/lib/bundle.esm.js | 191 + .../apollo-link/lib/bundle.esm.js.map | 1 + node_modules/apollo-link/lib/bundle.umd.js | 213 ++ .../apollo-link/lib/bundle.umd.js.map | 1 + node_modules/apollo-link/lib/index.d.ts | 6 + node_modules/apollo-link/lib/index.d.ts.map | 1 + node_modules/apollo-link/lib/index.js | 14 + node_modules/apollo-link/lib/index.js.map | 1 + node_modules/apollo-link/lib/link.d.ts | 18 + node_modules/apollo-link/lib/link.d.ts.map | 1 + node_modules/apollo-link/lib/link.js | 87 + node_modules/apollo-link/lib/link.js.map | 1 + node_modules/apollo-link/lib/linkUtils.d.ts | 19 + .../apollo-link/lib/linkUtils.d.ts.map | 1 + node_modules/apollo-link/lib/linkUtils.js | 122 + node_modules/apollo-link/lib/linkUtils.js.map | 1 + node_modules/apollo-link/lib/test-utils.d.ts | 5 + .../apollo-link/lib/test-utils.d.ts.map | 1 + node_modules/apollo-link/lib/test-utils.js | 9 + .../apollo-link/lib/test-utils.js.map | 1 + .../apollo-link/lib/test-utils/mockLink.d.ts | 8 + .../lib/test-utils/mockLink.d.ts.map | 1 + .../apollo-link/lib/test-utils/mockLink.js | 19 + .../lib/test-utils/mockLink.js.map | 1 + .../lib/test-utils/setContext.d.ts | 9 + .../lib/test-utils/setContext.d.ts.map | 1 + .../apollo-link/lib/test-utils/setContext.js | 20 + .../lib/test-utils/setContext.js.map | 1 + .../lib/test-utils/testingUtils.d.ts | 12 + .../lib/test-utils/testingUtils.d.ts.map | 1 + .../lib/test-utils/testingUtils.js | 38 + .../lib/test-utils/testingUtils.js.map | 1 + node_modules/apollo-link/lib/types.d.ts | 29 + node_modules/apollo-link/lib/types.d.ts.map | 1 + node_modules/apollo-link/lib/types.js | 3 + node_modules/apollo-link/lib/types.js.map | 1 + node_modules/apollo-link/package.json | 72 + node_modules/apollo-utilities/.flowconfig | 8 + node_modules/apollo-utilities/CHANGELOG.md | 106 + node_modules/apollo-utilities/LICENSE | 22 + node_modules/apollo-utilities/jest.config.js | 3 + .../apollo-utilities/lib/bundle.cjs.js | 1125 ++++++ .../apollo-utilities/lib/bundle.cjs.js.map | 1 + .../apollo-utilities/lib/bundle.cjs.min.js | 1 + .../apollo-utilities/lib/bundle.esm.js | 915 +++++ .../apollo-utilities/lib/bundle.esm.js.map | 1 + .../apollo-utilities/lib/bundle.umd.js | 1131 ++++++ .../apollo-utilities/lib/bundle.umd.js.map | 1 + .../apollo-utilities/lib/directives.d.ts | 19 + .../apollo-utilities/lib/directives.d.ts.map | 1 + .../apollo-utilities/lib/directives.js | 71 + .../apollo-utilities/lib/directives.js.map | 1 + .../apollo-utilities/lib/fragments.d.ts | 3 + .../apollo-utilities/lib/fragments.d.ts.map | 1 + .../apollo-utilities/lib/fragments.js | 42 + .../apollo-utilities/lib/fragments.js.map | 1 + .../apollo-utilities/lib/getFromAST.d.ts | 20 + .../apollo-utilities/lib/getFromAST.d.ts.map | 1 + .../apollo-utilities/lib/getFromAST.js | 130 + .../apollo-utilities/lib/getFromAST.js.map | 1 + node_modules/apollo-utilities/lib/index.d.ts | 17 + .../apollo-utilities/lib/index.d.ts.map | 1 + node_modules/apollo-utilities/lib/index.js | 20 + .../apollo-utilities/lib/index.js.map | 1 + .../apollo-utilities/lib/storeUtils.d.ts | 39 + .../apollo-utilities/lib/storeUtils.d.ts.map | 1 + .../apollo-utilities/lib/storeUtils.js | 225 ++ .../apollo-utilities/lib/storeUtils.js.map | 1 + .../apollo-utilities/lib/transform.d.ts | 26 + .../apollo-utilities/lib/transform.d.ts.map | 1 + .../apollo-utilities/lib/transform.js | 311 ++ .../apollo-utilities/lib/transform.js.map | 1 + .../apollo-utilities/lib/util/assign.d.ts | 6 + .../apollo-utilities/lib/util/assign.d.ts.map | 1 + .../apollo-utilities/lib/util/assign.js | 19 + .../apollo-utilities/lib/util/assign.js.map | 1 + .../apollo-utilities/lib/util/canUse.d.ts | 2 + .../apollo-utilities/lib/util/canUse.d.ts.map | 1 + .../apollo-utilities/lib/util/canUse.js | 5 + .../apollo-utilities/lib/util/canUse.js.map | 1 + .../apollo-utilities/lib/util/cloneDeep.d.ts | 2 + .../lib/util/cloneDeep.d.ts.map | 1 + .../apollo-utilities/lib/util/cloneDeep.js | 34 + .../lib/util/cloneDeep.js.map | 1 + .../lib/util/environment.d.ts | 6 + .../lib/util/environment.d.ts.map | 1 + .../apollo-utilities/lib/util/environment.js | 26 + .../lib/util/environment.js.map | 1 + .../lib/util/errorHandling.d.ts | 4 + .../lib/util/errorHandling.d.ts.map | 1 + .../lib/util/errorHandling.js | 18 + .../lib/util/errorHandling.js.map | 1 + .../lib/util/filterInPlace.d.ts | 2 + .../lib/util/filterInPlace.d.ts.map | 1 + .../lib/util/filterInPlace.js | 14 + .../lib/util/filterInPlace.js.map | 1 + .../apollo-utilities/lib/util/isEqual.d.ts | 2 + .../lib/util/isEqual.d.ts.map | 1 + .../apollo-utilities/lib/util/isEqual.js | 5 + .../apollo-utilities/lib/util/isEqual.js.map | 1 + .../lib/util/maybeDeepFreeze.d.ts | 2 + .../lib/util/maybeDeepFreeze.d.ts.map | 1 + .../lib/util/maybeDeepFreeze.js | 25 + .../lib/util/maybeDeepFreeze.js.map | 1 + .../apollo-utilities/lib/util/mergeDeep.d.ts | 4 + .../lib/util/mergeDeep.d.ts.map | 1 + .../apollo-utilities/lib/util/mergeDeep.js | 64 + .../lib/util/mergeDeep.js.map | 1 + .../lib/util/stripSymbols.d.ts | 2 + .../lib/util/stripSymbols.d.ts.map | 1 + .../apollo-utilities/lib/util/stripSymbols.js | 7 + .../lib/util/stripSymbols.js.map | 1 + .../apollo-utilities/lib/util/warnOnce.d.ts | 2 + .../lib/util/warnOnce.d.ts.map | 1 + .../apollo-utilities/lib/util/warnOnce.js | 20 + .../apollo-utilities/lib/util/warnOnce.js.map | 1 + node_modules/apollo-utilities/package.json | 48 + .../src/__tests__/directives.ts | 274 ++ .../src/__tests__/fragments.ts | 327 ++ .../src/__tests__/getFromAST.ts | 316 ++ .../src/__tests__/storeUtils.ts | 23 + .../src/__tests__/transform.ts | 1242 +++++++ .../apollo-utilities/src/declarations.d.ts | 1 + .../apollo-utilities/src/directives.ts | 127 + .../apollo-utilities/src/fragments.ts | 92 + .../apollo-utilities/src/getFromAST.ts | 233 ++ .../apollo-utilities/src/index.js.flow | 220 ++ node_modules/apollo-utilities/src/index.ts | 16 + .../apollo-utilities/src/storeUtils.ts | 340 ++ .../apollo-utilities/src/transform.ts | 542 +++ .../src/util/__tests__/assign.ts | 47 + .../src/util/__tests__/cloneDeep.ts | 70 + .../src/util/__tests__/environment.ts | 70 + .../src/util/__tests__/isEqual.ts | 174 + .../src/util/__tests__/maybeDeepFeeze.ts | 17 + .../src/util/__tests__/mergeDeep.ts | 139 + .../src/util/__tests__/stripSymbols.ts | 15 + .../src/util/__tests__/warnOnce.ts | 61 + .../apollo-utilities/src/util/assign.ts | 31 + .../apollo-utilities/src/util/canUse.ts | 4 + .../apollo-utilities/src/util/cloneDeep.ts | 37 + .../apollo-utilities/src/util/environment.ts | 24 + .../src/util/errorHandling.ts | 15 + .../src/util/filterInPlace.ts | 14 + .../apollo-utilities/src/util/isEqual.ts | 1 + .../src/util/maybeDeepFreeze.ts | 33 + .../apollo-utilities/src/util/mergeDeep.ts | 115 + .../apollo-utilities/src/util/stripSymbols.ts | 14 + .../apollo-utilities/src/util/warnOnce.ts | 24 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../fast-json-stable-stringify/.npmignore | 4 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 18 + .../fast-json-stable-stringify/README.md | 119 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 50 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + node_modules/graphql-tag/.tav.yml | 10 + node_modules/graphql-tag/CHANGELOG.md | 177 + node_modules/graphql-tag/CONTRIBUTING.md | 82 + node_modules/graphql-tag/LICENSE | 21 + node_modules/graphql-tag/README.md | 164 + node_modules/graphql-tag/index.d.ts | 3 + .../graphql-tag/lib/graphql-tag.umd.js | 189 + .../graphql-tag/lib/graphql-tag.umd.js.flow | 7 + .../graphql-tag/lib/graphql-tag.umd.js.map | 1 + node_modules/graphql-tag/loader.js | 190 + node_modules/graphql-tag/package.json | 36 + node_modules/graphql-tag/src/index.js | 180 + node_modules/graphql-tag/src/index.js.flow | 7 + .../graphql-tag/test/graphql-v0.11.js | 137 + .../graphql-tag/test/graphql-v0.12.js | 138 + node_modules/graphql-tag/test/graphql.js | 465 +++ node_modules/graphql-tag/test/mocha.opts | 1 + node_modules/graphql/LICENSE | 21 + node_modules/graphql/README.md | 145 + node_modules/graphql/error/GraphQLError.js | 214 ++ .../graphql/error/GraphQLError.js.flow | 241 ++ node_modules/graphql/error/GraphQLError.mjs | 207 ++ node_modules/graphql/error/formatError.js | 32 + .../graphql/error/formatError.js.flow | 28 + node_modules/graphql/error/formatError.mjs | 23 + node_modules/graphql/error/index.js | 43 + node_modules/graphql/error/index.js.flow | 10 + node_modules/graphql/error/index.mjs | 4 + node_modules/graphql/error/locatedError.js | 23 + .../graphql/error/locatedError.js.flow | 30 + node_modules/graphql/error/locatedError.mjs | 16 + node_modules/graphql/error/syntaxError.js | 16 + .../graphql/error/syntaxError.js.flow | 18 + node_modules/graphql/error/syntaxError.mjs | 9 + node_modules/graphql/execution/execute.js | 863 +++++ .../graphql/execution/execute.js.flow | 1258 +++++++ node_modules/graphql/execution/execute.mjs | 812 ++++ node_modules/graphql/execution/index.js | 39 + node_modules/graphql/execution/index.js.flow | 11 + node_modules/graphql/execution/index.mjs | 2 + node_modules/graphql/execution/values.js | 231 ++ node_modules/graphql/execution/values.js.flow | 238 ++ node_modules/graphql/execution/values.mjs | 208 ++ node_modules/graphql/graphql.js | 118 + node_modules/graphql/graphql.js.flow | 203 + node_modules/graphql/graphql.mjs | 102 + node_modules/graphql/index.js | 1139 ++++++ node_modules/graphql/index.js.flow | 444 +++ node_modules/graphql/index.mjs | 95 + node_modules/graphql/jsutils/ObjMap.js | 1 + node_modules/graphql/jsutils/ObjMap.js.flow | 3 + node_modules/graphql/jsutils/ObjMap.mjs | 1 + .../graphql/jsutils/PromiseOrValue.js | 1 + .../graphql/jsutils/PromiseOrValue.js.flow | 3 + .../graphql/jsutils/PromiseOrValue.mjs | 1 + node_modules/graphql/jsutils/dedent.js | 66 + node_modules/graphql/jsutils/dedent.js.flow | 41 + node_modules/graphql/jsutils/dedent.mjs | 59 + node_modules/graphql/jsutils/defineToJSON.js | 24 + .../graphql/jsutils/defineToJSON.js.flow | 18 + node_modules/graphql/jsutils/defineToJSON.mjs | 15 + .../graphql/jsutils/defineToStringTag.js | 29 + .../graphql/jsutils/defineToStringTag.js.flow | 24 + .../graphql/jsutils/defineToStringTag.mjs | 22 + node_modules/graphql/jsutils/didYouMean.js | 38 + .../graphql/jsutils/didYouMean.js.flow | 39 + node_modules/graphql/jsutils/didYouMean.mjs | 32 + node_modules/graphql/jsutils/identityFunc.js | 13 + .../graphql/jsutils/identityFunc.js.flow | 8 + node_modules/graphql/jsutils/identityFunc.mjs | 6 + node_modules/graphql/jsutils/inspect.js | 134 + node_modules/graphql/jsutils/inspect.js.flow | 126 + node_modules/graphql/jsutils/inspect.mjs | 124 + node_modules/graphql/jsutils/instanceOf.js | 35 + .../graphql/jsutils/instanceOf.js.flow | 45 + node_modules/graphql/jsutils/instanceOf.mjs | 26 + node_modules/graphql/jsutils/invariant.js | 15 + .../graphql/jsutils/invariant.js.flow | 9 + node_modules/graphql/jsutils/invariant.mjs | 8 + node_modules/graphql/jsutils/isInvalid.js | 13 + .../graphql/jsutils/isInvalid.js.flow | 8 + node_modules/graphql/jsutils/isInvalid.mjs | 6 + node_modules/graphql/jsutils/isNullish.js | 13 + .../graphql/jsutils/isNullish.js.flow | 8 + node_modules/graphql/jsutils/isNullish.mjs | 6 + node_modules/graphql/jsutils/isObjectLike.js | 16 + .../graphql/jsutils/isObjectLike.js.flow | 9 + node_modules/graphql/jsutils/isObjectLike.mjs | 9 + node_modules/graphql/jsutils/isPromise.js | 15 + .../graphql/jsutils/isPromise.js.flow | 13 + node_modules/graphql/jsutils/isPromise.mjs | 8 + node_modules/graphql/jsutils/keyMap.js | 36 + node_modules/graphql/jsutils/keyMap.js.flow | 36 + node_modules/graphql/jsutils/keyMap.mjs | 29 + node_modules/graphql/jsutils/keyValMap.js | 30 + .../graphql/jsutils/keyValMap.js.flow | 31 + node_modules/graphql/jsutils/keyValMap.mjs | 23 + node_modules/graphql/jsutils/mapValue.js | 45 + node_modules/graphql/jsutils/mapValue.js.flow | 20 + node_modules/graphql/jsutils/mapValue.mjs | 36 + node_modules/graphql/jsutils/memoize3.js | 48 + node_modules/graphql/jsutils/memoize3.js.flow | 42 + node_modules/graphql/jsutils/memoize3.mjs | 41 + .../jsutils/nodejsCustomInspectSymbol.js | 9 + .../jsutils/nodejsCustomInspectSymbol.js.flow | 8 + .../jsutils/nodejsCustomInspectSymbol.mjs | 2 + .../graphql/jsutils/promiseForObject.js | 26 + .../graphql/jsutils/promiseForObject.js.flow | 23 + .../graphql/jsutils/promiseForObject.mjs | 19 + node_modules/graphql/jsutils/promiseReduce.js | 25 + .../graphql/jsutils/promiseReduce.js.flow | 25 + .../graphql/jsutils/promiseReduce.mjs | 16 + .../graphql/jsutils/suggestionList.js | 105 + .../graphql/jsutils/suggestionList.js.flow | 86 + .../graphql/jsutils/suggestionList.mjs | 97 + node_modules/graphql/language/ast.js | 1 + node_modules/graphql/language/ast.js.flow | 622 ++++ node_modules/graphql/language/ast.mjs | 1 + node_modules/graphql/language/blockString.js | 105 + .../graphql/language/blockString.js.flow | 97 + node_modules/graphql/language/blockString.mjs | 95 + .../graphql/language/directiveLocation.js | 38 + .../language/directiveLocation.js.flow | 33 + .../graphql/language/directiveLocation.mjs | 29 + node_modules/graphql/language/index.js | 183 + node_modules/graphql/language/index.js.flow | 107 + node_modules/graphql/language/index.mjs | 11 + node_modules/graphql/language/kinds.js | 71 + node_modules/graphql/language/kinds.js.flow | 76 + node_modules/graphql/language/kinds.mjs | 62 + node_modules/graphql/language/lexer.js | 631 ++++ node_modules/graphql/language/lexer.js.flow | 736 ++++ node_modules/graphql/language/lexer.mjs | 615 ++++ node_modules/graphql/language/location.js | 31 + .../graphql/language/location.js.flow | 27 + node_modules/graphql/language/location.mjs | 24 + node_modules/graphql/language/parser.js | 1522 ++++++++ node_modules/graphql/language/parser.js.flow | 1570 ++++++++ node_modules/graphql/language/parser.mjs | 1499 ++++++++ node_modules/graphql/language/predicates.js | 52 + .../graphql/language/predicates.js.flow | 83 + node_modules/graphql/language/predicates.mjs | 28 + .../graphql/language/printLocation.js | 75 + .../graphql/language/printLocation.js.flow | 85 + .../graphql/language/printLocation.mjs | 66 + node_modules/graphql/language/printer.js | 309 ++ node_modules/graphql/language/printer.js.flow | 270 ++ node_modules/graphql/language/printer.mjs | 300 ++ node_modules/graphql/language/source.js | 35 + node_modules/graphql/language/source.js.flow | 40 + node_modules/graphql/language/source.mjs | 23 + node_modules/graphql/language/tokenKind.js | 40 + .../graphql/language/tokenKind.js.flow | 35 + node_modules/graphql/language/tokenKind.mjs | 31 + node_modules/graphql/language/visitor.js | 441 +++ node_modules/graphql/language/visitor.js.flow | 470 +++ node_modules/graphql/language/visitor.mjs | 422 +++ node_modules/graphql/package.json | 27 + node_modules/graphql/polyfills/find.js | 22 + node_modules/graphql/polyfills/find.js.flow | 22 + node_modules/graphql/polyfills/find.mjs | 14 + node_modules/graphql/polyfills/flatMap.js | 29 + .../graphql/polyfills/flatMap.js.flow | 27 + node_modules/graphql/polyfills/flatMap.mjs | 21 + node_modules/graphql/polyfills/isFinite.js | 15 + .../graphql/polyfills/isFinite.js.flow | 13 + node_modules/graphql/polyfills/isFinite.mjs | 7 + node_modules/graphql/polyfills/isInteger.js | 15 + .../graphql/polyfills/isInteger.js.flow | 17 + node_modules/graphql/polyfills/isInteger.mjs | 7 + .../graphql/polyfills/objectEntries.js | 17 + .../graphql/polyfills/objectEntries.js.flow | 12 + .../graphql/polyfills/objectEntries.mjs | 9 + .../graphql/polyfills/objectValues.js | 17 + .../graphql/polyfills/objectValues.js.flow | 11 + .../graphql/polyfills/objectValues.mjs | 9 + .../subscription/asyncIteratorReject.js | 45 + .../subscription/asyncIteratorReject.js.flow | 34 + .../subscription/asyncIteratorReject.mjs | 38 + node_modules/graphql/subscription/index.js | 19 + .../graphql/subscription/index.js.flow | 4 + node_modules/graphql/subscription/index.mjs | 1 + .../graphql/subscription/mapAsyncIterator.js | 85 + .../subscription/mapAsyncIterator.js.flow | 74 + .../graphql/subscription/mapAsyncIterator.mjs | 78 + .../graphql/subscription/subscribe.js | 160 + .../graphql/subscription/subscribe.js.flow | 278 ++ .../graphql/subscription/subscribe.mjs | 142 + node_modules/graphql/type/definition.js | 989 +++++ node_modules/graphql/type/definition.js.flow | 1415 +++++++ node_modules/graphql/type/definition.mjs | 875 +++++ node_modules/graphql/type/directives.js | 165 + node_modules/graphql/type/directives.js.flow | 191 + node_modules/graphql/type/directives.mjs | 137 + node_modules/graphql/type/index.js | 503 +++ node_modules/graphql/type/index.js.flow | 163 + node_modules/graphql/type/index.mjs | 27 + node_modules/graphql/type/introspection.js | 543 +++ .../graphql/type/introspection.js.flow | 472 +++ node_modules/graphql/type/introspection.mjs | 497 +++ node_modules/graphql/type/scalars.js | 256 ++ node_modules/graphql/type/scalars.js.flow | 246 ++ node_modules/graphql/type/scalars.mjs | 232 ++ node_modules/graphql/type/schema.js | 386 ++ node_modules/graphql/type/schema.js.flow | 384 ++ node_modules/graphql/type/schema.mjs | 361 ++ node_modules/graphql/type/validate.js | 782 ++++ node_modules/graphql/type/validate.js.flow | 607 +++ node_modules/graphql/type/validate.mjs | 760 ++++ node_modules/graphql/utilities/TypeInfo.js | 343 ++ .../graphql/utilities/TypeInfo.js.flow | 313 ++ node_modules/graphql/utilities/TypeInfo.mjs | 327 ++ .../graphql/utilities/assertValidName.js | 44 + .../graphql/utilities/assertValidName.js.flow | 40 + .../graphql/utilities/assertValidName.mjs | 31 + .../graphql/utilities/astFromValue.js | 207 ++ .../graphql/utilities/astFromValue.js.flow | 146 + .../graphql/utilities/astFromValue.mjs | 189 + .../graphql/utilities/buildASTSchema.js | 494 +++ .../graphql/utilities/buildASTSchema.js.flow | 489 +++ .../graphql/utilities/buildASTSchema.mjs | 461 +++ .../graphql/utilities/buildClientSchema.js | 307 ++ .../utilities/buildClientSchema.js.flow | 383 ++ .../graphql/utilities/buildClientSchema.mjs | 287 ++ node_modules/graphql/utilities/coerceValue.js | 224 ++ .../graphql/utilities/coerceValue.js.flow | 248 ++ .../graphql/utilities/coerceValue.mjs | 207 ++ node_modules/graphql/utilities/concatAST.js | 24 + .../graphql/utilities/concatAST.js.flow | 16 + node_modules/graphql/utilities/concatAST.mjs | 15 + .../graphql/utilities/extendSchema.js | 418 +++ .../graphql/utilities/extendSchema.js.flow | 404 ++ .../graphql/utilities/extendSchema.mjs | 395 ++ .../graphql/utilities/findBreakingChanges.js | 915 +++++ .../utilities/findBreakingChanges.js.flow | 552 +++ .../graphql/utilities/findBreakingChanges.mjs | 894 +++++ .../graphql/utilities/findDeprecatedUsages.js | 51 + .../utilities/findDeprecatedUsages.js.flow | 61 + .../utilities/findDeprecatedUsages.mjs | 41 + .../graphql/utilities/getOperationAST.js | 56 + .../graphql/utilities/getOperationAST.js.flow | 35 + .../graphql/utilities/getOperationAST.mjs | 49 + .../graphql/utilities/getOperationRootType.js | 45 + .../utilities/getOperationRootType.js.flow | 55 + .../utilities/getOperationRootType.mjs | 38 + node_modules/graphql/utilities/index.js | 263 ++ node_modules/graphql/utilities/index.js.flow | 127 + node_modules/graphql/utilities/index.mjs | 55 + .../utilities/introspectionFromSchema.js | 34 + .../utilities/introspectionFromSchema.js.flow | 31 + .../utilities/introspectionFromSchema.mjs | 21 + .../graphql/utilities/introspectionQuery.js | 21 + .../utilities/introspectionQuery.js.flow | 278 ++ .../graphql/utilities/introspectionQuery.mjs | 11 + .../graphql/utilities/isValidJSValue.js | 22 + .../graphql/utilities/isValidJSValue.js.flow | 18 + .../graphql/utilities/isValidJSValue.mjs | 14 + .../graphql/utilities/isValidLiteralValue.js | 38 + .../utilities/isValidLiteralValue.js.flow | 31 + .../graphql/utilities/isValidLiteralValue.mjs | 26 + .../utilities/lexicographicSortSchema.js | 180 + .../utilities/lexicographicSortSchema.js.flow | 165 + .../utilities/lexicographicSortSchema.mjs | 165 + .../graphql/utilities/schemaPrinter.js | 327 ++ .../graphql/utilities/schemaPrinter.js.flow | 368 ++ .../graphql/utilities/schemaPrinter.mjs | 306 ++ .../graphql/utilities/separateOperations.js | 90 + .../utilities/separateOperations.js.flow | 96 + .../graphql/utilities/separateOperations.mjs | 83 + .../utilities/stripIgnoredCharacters.js | 133 + .../utilities/stripIgnoredCharacters.js.flow | 123 + .../utilities/stripIgnoredCharacters.mjs | 120 + .../graphql/utilities/typeComparators.js | 120 + .../graphql/utilities/typeComparators.js.flow | 126 + .../graphql/utilities/typeComparators.mjs | 109 + node_modules/graphql/utilities/typeFromAST.js | 38 + .../graphql/utilities/typeFromAST.js.flow | 55 + .../graphql/utilities/typeFromAST.mjs | 26 + .../graphql/utilities/valueFromAST.js | 237 ++ .../graphql/utilities/valueFromAST.js.flow | 171 + .../graphql/utilities/valueFromAST.mjs | 222 ++ .../graphql/utilities/valueFromASTUntyped.js | 73 + .../utilities/valueFromASTUntyped.js.flow | 60 + .../graphql/utilities/valueFromASTUntyped.mjs | 61 + .../graphql/validation/ValidationContext.js | 301 ++ .../validation/ValidationContext.js.flow | 243 ++ .../graphql/validation/ValidationContext.mjs | 284 ++ node_modules/graphql/validation/index.js | 229 ++ node_modules/graphql/validation/index.js.flow | 130 + node_modules/graphql/validation/index.mjs | 54 + .../validation/rules/ExecutableDefinitions.js | 59 + .../rules/ExecutableDefinitions.js.flow | 42 + .../rules/ExecutableDefinitions.mjs | 47 + .../validation/rules/FieldsOnCorrectType.js | 154 + .../rules/FieldsOnCorrectType.js.flow | 135 + .../validation/rules/FieldsOnCorrectType.mjs | 138 + .../rules/FragmentsOnCompositeTypes.js | 55 + .../rules/FragmentsOnCompositeTypes.js.flow | 61 + .../rules/FragmentsOnCompositeTypes.mjs | 40 + .../validation/rules/KnownArgumentNames.js | 164 + .../rules/KnownArgumentNames.js.flow | 116 + .../validation/rules/KnownArgumentNames.mjs | 144 + .../validation/rules/KnownDirectives.js | 185 + .../validation/rules/KnownDirectives.js.flow | 131 + .../validation/rules/KnownDirectives.mjs | 170 + .../validation/rules/KnownFragmentNames.js | 33 + .../rules/KnownFragmentNames.js.flow | 29 + .../validation/rules/KnownFragmentNames.mjs | 23 + .../validation/rules/KnownTypeNames.js | 95 + .../validation/rules/KnownTypeNames.js.flow | 85 + .../validation/rules/KnownTypeNames.mjs | 78 + .../rules/LoneAnonymousOperation.js | 38 + .../rules/LoneAnonymousOperation.js.flow | 36 + .../rules/LoneAnonymousOperation.mjs | 27 + .../validation/rules/LoneSchemaDefinition.js | 44 + .../rules/LoneSchemaDefinition.js.flow | 49 + .../validation/rules/LoneSchemaDefinition.mjs | 32 + .../validation/rules/NoFragmentCycles.js | 94 + .../validation/rules/NoFragmentCycles.js.flow | 78 + .../validation/rules/NoFragmentCycles.mjs | 84 + .../validation/rules/NoUndefinedVariables.js | 65 + .../rules/NoUndefinedVariables.js.flow | 50 + .../validation/rules/NoUndefinedVariables.mjs | 55 + .../validation/rules/NoUnusedFragments.js | 76 + .../rules/NoUnusedFragments.js.flow | 52 + .../validation/rules/NoUnusedFragments.mjs | 66 + .../validation/rules/NoUnusedVariables.js | 72 + .../rules/NoUnusedVariables.js.flow | 56 + .../validation/rules/NoUnusedVariables.mjs | 62 + .../rules/OverlappingFieldsCanBeMerged.js | 614 ++++ .../OverlappingFieldsCanBeMerged.js.flow | 840 +++++ .../rules/OverlappingFieldsCanBeMerged.mjs | 596 +++ .../rules/PossibleFragmentSpreads.js | 70 + .../rules/PossibleFragmentSpreads.js.flow | 88 + .../rules/PossibleFragmentSpreads.mjs | 52 + .../rules/PossibleTypeExtensions.js | 154 + .../rules/PossibleTypeExtensions.js.flow | 152 + .../rules/PossibleTypeExtensions.mjs | 134 + .../rules/ProvidedRequiredArguments.js | 183 + .../rules/ProvidedRequiredArguments.js.flow | 132 + .../rules/ProvidedRequiredArguments.mjs | 161 + .../graphql/validation/rules/ScalarLeafs.js | 50 + .../validation/rules/ScalarLeafs.js.flow | 56 + .../graphql/validation/rules/ScalarLeafs.mjs | 34 + .../rules/SingleFieldSubscriptions.js | 31 + .../rules/SingleFieldSubscriptions.js.flow | 36 + .../rules/SingleFieldSubscriptions.mjs | 21 + .../validation/rules/UniqueArgumentNames.js | 43 + .../rules/UniqueArgumentNames.js.flow | 41 + .../validation/rules/UniqueArgumentNames.mjs | 33 + .../validation/rules/UniqueDirectiveNames.js | 47 + .../rules/UniqueDirectiveNames.js.flow | 54 + .../validation/rules/UniqueDirectiveNames.mjs | 35 + .../rules/UniqueDirectivesPerLocation.js | 127 + .../rules/UniqueDirectivesPerLocation.js.flow | 72 + .../rules/UniqueDirectivesPerLocation.mjs | 115 + .../validation/rules/UniqueEnumValueNames.js | 82 + .../rules/UniqueEnumValueNames.js.flow | 75 + .../validation/rules/UniqueEnumValueNames.mjs | 69 + .../rules/UniqueFieldDefinitionNames.js | 93 + .../rules/UniqueFieldDefinitionNames.js.flow | 89 + .../rules/UniqueFieldDefinitionNames.mjs | 80 + .../validation/rules/UniqueFragmentNames.js | 39 + .../rules/UniqueFragmentNames.js.flow | 35 + .../validation/rules/UniqueFragmentNames.mjs | 29 + .../validation/rules/UniqueInputFieldNames.js | 45 + .../rules/UniqueInputFieldNames.js.flow | 47 + .../rules/UniqueInputFieldNames.mjs | 35 + .../validation/rules/UniqueOperationNames.js | 41 + .../rules/UniqueOperationNames.js.flow | 39 + .../validation/rules/UniqueOperationNames.mjs | 31 + .../validation/rules/UniqueOperationTypes.js | 77 + .../rules/UniqueOperationTypes.js.flow | 66 + .../validation/rules/UniqueOperationTypes.mjs | 65 + .../validation/rules/UniqueTypeNames.js | 54 + .../validation/rules/UniqueTypeNames.js.flow | 57 + .../validation/rules/UniqueTypeNames.mjs | 42 + .../validation/rules/UniqueVariableNames.js | 37 + .../rules/UniqueVariableNames.js.flow | 37 + .../validation/rules/UniqueVariableNames.mjs | 27 + .../validation/rules/ValuesOfCorrectType.js | 190 + .../rules/ValuesOfCorrectType.js.flow | 207 ++ .../validation/rules/ValuesOfCorrectType.mjs | 163 + .../rules/VariablesAreInputTypes.js | 39 + .../rules/VariablesAreInputTypes.js.flow | 41 + .../rules/VariablesAreInputTypes.mjs | 26 + .../rules/VariablesInAllowedPosition.js | 109 + .../rules/VariablesInAllowedPosition.js.flow | 99 + .../rules/VariablesInAllowedPosition.mjs | 91 + .../graphql/validation/specifiedRules.js | 111 + .../graphql/validation/specifiedRules.js.flow | 146 + .../graphql/validation/specifiedRules.mjs | 71 + node_modules/graphql/validation/validate.js | 101 + .../graphql/validation/validate.js.flow | 92 + node_modules/graphql/validation/validate.mjs | 81 + node_modules/graphql/version.js | 28 + node_modules/graphql/version.js.flow | 21 + node_modules/graphql/version.mjs | 19 + .../hoist-non-react-statics/CHANGELOG.md | 30 + .../hoist-non-react-statics/LICENSE.md | 29 + .../hoist-non-react-statics/README.md | 55 + .../dist/hoist-non-react-statics.cjs.js | 103 + .../dist/hoist-non-react-statics.js | 109 + .../dist/hoist-non-react-statics.min.js | 1 + .../hoist-non-react-statics/package.json | 59 + .../hoist-non-react-statics/src/index.js | 101 + node_modules/iterall/LICENSE | 18 + node_modules/iterall/README.md | 808 ++++ node_modules/iterall/index.d.ts | 90 + node_modules/iterall/index.js | 180 + node_modules/iterall/index.js.flow | 702 ++++ node_modules/iterall/index.mjs | 702 ++++ node_modules/iterall/package.json | 20 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 ++ node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 30 + node_modules/lodash.isequal/LICENSE | 47 + node_modules/lodash.isequal/README.md | 18 + node_modules/lodash.isequal/index.js | 1848 ++++++++++ node_modules/lodash.isequal/package.json | 16 + node_modules/loose-envify/LICENSE | 21 + node_modules/loose-envify/README.md | 45 + node_modules/loose-envify/cli.js | 16 + node_modules/loose-envify/custom.js | 4 + node_modules/loose-envify/index.js | 3 + node_modules/loose-envify/loose-envify.js | 36 + node_modules/loose-envify/package.json | 36 + node_modules/loose-envify/replace.js | 65 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/optimism/LICENSE | 21 + node_modules/optimism/README.md | 3 + node_modules/optimism/lib/bundle.cjs.js | 512 +++ node_modules/optimism/lib/bundle.cjs.js.map | 1 + node_modules/optimism/lib/bundle.esm.js | 483 +++ node_modules/optimism/lib/bundle.esm.js.map | 1 + node_modules/optimism/lib/cache.d.ts | 14 + node_modules/optimism/lib/context.d.ts | 7 + node_modules/optimism/lib/entry.d.ts | 20 + node_modules/optimism/lib/index.d.ts | 15 + node_modules/optimism/lib/key-trie.d.ts | 10 + node_modules/optimism/package.json | 52 + node_modules/optimism/test.js | 8 + node_modules/prop-types/CHANGELOG.md | 92 + node_modules/prop-types/LICENSE | 21 + node_modules/prop-types/README.md | 296 ++ node_modules/prop-types/checkPropTypes.js | 102 + node_modules/prop-types/factory.js | 19 + .../prop-types/factoryWithThrowingShims.js | 64 + .../prop-types/factoryWithTypeCheckers.js | 591 +++ node_modules/prop-types/index.js | 19 + .../prop-types/lib/ReactPropTypesSecret.js | 12 + .../prop-types/node_modules/.bin/loose-envify | 15 + .../node_modules/.bin/loose-envify.cmd | 7 + node_modules/prop-types/package.json | 58 + node_modules/prop-types/prop-types.js | 1337 +++++++ node_modules/prop-types/prop-types.min.js | 1 + node_modules/react-apollo/ApolloConsumer.d.ts | 7 + node_modules/react-apollo/ApolloConsumer.js | 25 + .../react-apollo/ApolloConsumer.js.map | 1 + node_modules/react-apollo/ApolloContext.d.ts | 11 + node_modules/react-apollo/ApolloContext.js | 7 + .../react-apollo/ApolloContext.js.map | 1 + node_modules/react-apollo/ApolloProvider.d.ts | 25 + node_modules/react-apollo/ApolloProvider.js | 41 + .../react-apollo/ApolloProvider.js.map | 1 + node_modules/react-apollo/LICENSE | 22 + node_modules/react-apollo/Mutation.d.ts | 98 + node_modules/react-apollo/Mutation.js | 161 + node_modules/react-apollo/Mutation.js.map | 1 + node_modules/react-apollo/Query.d.ts | 80 + node_modules/react-apollo/Query.js | 289 ++ node_modules/react-apollo/Query.js.map | 1 + node_modules/react-apollo/README.md | 167 + node_modules/react-apollo/Subscriptions.d.ts | 61 + node_modules/react-apollo/Subscriptions.js | 123 + .../react-apollo/Subscriptions.js.map | 1 + .../react-apollo/component-utils.d.ts | 8 + node_modules/react-apollo/component-utils.js | 12 + .../react-apollo/component-utils.js.map | 1 + .../react-apollo/getDataFromTree.d.ts | 24 + node_modules/react-apollo/getDataFromTree.js | 101 + .../react-apollo/getDataFromTree.js.map | 1 + node_modules/react-apollo/graphql.d.ts | 4 + node_modules/react-apollo/graphql.js | 20 + node_modules/react-apollo/graphql.js.map | 1 + node_modules/react-apollo/hoc-utils.d.ts | 16 + node_modules/react-apollo/hoc-utils.js | 50 + node_modules/react-apollo/hoc-utils.js.map | 1 + node_modules/react-apollo/index.d.ts | 22 + node_modules/react-apollo/index.js | 39 + node_modules/react-apollo/index.js.map | 1 + node_modules/react-apollo/mutation-hoc.d.ts | 4 + node_modules/react-apollo/mutation-hoc.js | 61 + node_modules/react-apollo/mutation-hoc.js.map | 1 + node_modules/react-apollo/package.json | 51 + node_modules/react-apollo/parser.d.ts | 12 + node_modules/react-apollo/parser.js | 49 + node_modules/react-apollo/parser.js.map | 1 + node_modules/react-apollo/query-hoc.d.ts | 4 + node_modules/react-apollo/query-hoc.js | 71 + node_modules/react-apollo/query-hoc.js.map | 1 + node_modules/react-apollo/queryRecycler.d.ts | 7 + node_modules/react-apollo/queryRecycler.js | 40 + .../react-apollo/queryRecycler.js.map | 1 + .../react-apollo/react-apollo.cjs.d.ts | 1 + node_modules/react-apollo/react-apollo.cjs.js | 1097 ++++++ .../react-apollo/react-apollo.cjs.js.map | 1 + node_modules/react-apollo/react-apollo.esm.js | 1077 ++++++ .../react-apollo/react-apollo.esm.js.map | 1 + node_modules/react-apollo/react-apollo.umd.js | 1096 ++++++ .../react-apollo/renderToStringWithData.d.ts | 2 + .../react-apollo/renderToStringWithData.js | 11 + .../renderToStringWithData.js.map | 1 + .../react-apollo/subscription-hoc.d.ts | 4 + node_modules/react-apollo/subscription-hoc.js | 78 + .../react-apollo/subscription-hoc.js.map | 1 + node_modules/react-apollo/test-links.d.ts | 40 + node_modules/react-apollo/test-links.js | 155 + node_modules/react-apollo/test-links.js.map | 1 + node_modules/react-apollo/test-utils.d.ts | 24 + node_modules/react-apollo/test-utils.js | 39 + node_modules/react-apollo/test-utils.js.map | 1 + node_modules/react-apollo/types.d.ts | 76 + node_modules/react-apollo/types.js | 4 + node_modules/react-apollo/types.js.map | 1 + .../react-apollo/utils/flowRight.d.ts | 1 + node_modules/react-apollo/utils/flowRight.js | 23 + .../react-apollo/utils/flowRight.js.map | 1 + .../react-apollo/utils/shallowEqual.d.ts | 1 + .../react-apollo/utils/shallowEqual.js | 27 + .../react-apollo/utils/shallowEqual.js.map | 1 + node_modules/react-apollo/walkTree.d.ts | 3 + node_modules/react-apollo/walkTree.js | 125 + node_modules/react-apollo/walkTree.js.map | 1 + node_modules/react-apollo/withApollo.d.ts | 7 + node_modules/react-apollo/withApollo.js | 45 + node_modules/react-apollo/withApollo.js.map | 1 + node_modules/react-is/LICENSE | 21 + node_modules/react-is/README.md | 114 + node_modules/react-is/build-info.json | 8 + .../react-is/cjs/react-is.development.js | 227 ++ .../react-is/cjs/react-is.production.min.js | 15 + node_modules/react-is/index.js | 7 + node_modules/react-is/package.json | 27 + .../react-is/umd/react-is.development.js | 227 ++ .../react-is/umd/react-is.production.min.js | 13 + node_modules/symbol-observable/CHANGELOG.md | 136 + node_modules/symbol-observable/es/index.js | 19 + node_modules/symbol-observable/es/ponyfill.js | 17 + node_modules/symbol-observable/index.d.ts | 12 + node_modules/symbol-observable/index.js | 1 + node_modules/symbol-observable/lib/index.js | 29 + .../symbol-observable/lib/ponyfill.js | 23 + node_modules/symbol-observable/license | 22 + node_modules/symbol-observable/package.json | 49 + node_modules/symbol-observable/readme.md | 31 + node_modules/ts-invariant/LICENSE | 21 + node_modules/ts-invariant/README.md | 4 + node_modules/ts-invariant/lib/invariant.d.ts | 14 + .../ts-invariant/lib/invariant.esm.js | 62 + .../ts-invariant/lib/invariant.esm.js.map | 1 + node_modules/ts-invariant/lib/invariant.js | 67 + .../ts-invariant/lib/invariant.js.map | 1 + node_modules/ts-invariant/package.json | 41 + node_modules/ts-invariant/rollup.config.js | 40 + node_modules/ts-invariant/tsconfig.json | 7 + .../ts-invariant/tsconfig.rollup.json | 6 + node_modules/tslib/CopyrightNotice.txt | 15 + node_modules/tslib/LICENSE.txt | 55 + node_modules/tslib/README.md | 134 + node_modules/tslib/package.json | 28 + node_modules/tslib/tslib.d.ts | 34 + node_modules/tslib/tslib.es6.html | 1 + node_modules/tslib/tslib.es6.js | 196 + node_modules/tslib/tslib.html | 1 + node_modules/tslib/tslib.js | 255 ++ node_modules/zen-observable-ts/CHANGELOG.md | 28 + node_modules/zen-observable-ts/LICENSE | 21 + .../zen-observable-ts/lib/bundle.cjs.js | 13 + .../zen-observable-ts/lib/bundle.cjs.js.map | 1 + .../zen-observable-ts/lib/bundle.esm.js | 7 + .../zen-observable-ts/lib/bundle.esm.js.map | 1 + .../zen-observable-ts/lib/bundle.umd.js | 17 + .../zen-observable-ts/lib/bundle.umd.js.map | 1 + node_modules/zen-observable-ts/lib/index.d.ts | 4 + .../zen-observable-ts/lib/index.d.ts.map | 1 + node_modules/zen-observable-ts/lib/index.js | 7 + .../zen-observable-ts/lib/index.js.map | 1 + node_modules/zen-observable-ts/lib/types.d.ts | 23 + .../zen-observable-ts/lib/types.d.ts.map | 1 + node_modules/zen-observable-ts/lib/types.js | 3 + .../zen-observable-ts/lib/types.js.map | 1 + .../zen-observable-ts/lib/zenObservable.d.ts | 21 + .../lib/zenObservable.d.ts.map | 1 + .../zen-observable-ts/lib/zenObservable.js | 6 + .../lib/zenObservable.js.map | 1 + node_modules/zen-observable-ts/package.json | 58 + node_modules/zen-observable/.editorconfig | 7 + node_modules/zen-observable/.eslintrc.js | 47 + node_modules/zen-observable/LICENSE | 18 + node_modules/zen-observable/README.md | 176 + node_modules/zen-observable/extras.js | 1 + node_modules/zen-observable/index.js | 1 + node_modules/zen-observable/lib/Observable.js | 610 +++ node_modules/zen-observable/lib/extras.js | 140 + node_modules/zen-observable/package.json | 21 + .../zen-observable/scripts/babel-plugins.js | 16 + node_modules/zen-observable/scripts/build.js | 7 + .../zen-observable/scripts/mocha-require.js | 3 + node_modules/zen-observable/src/Observable.js | 476 +++ node_modules/zen-observable/src/extras.js | 99 + node_modules/zen-observable/test/concat.js | 30 + .../zen-observable/test/constructor.js | 36 + .../test/extras/combine-latest.js | 43 + .../zen-observable/test/extras/merge.js | 16 + .../zen-observable/test/extras/parse.js | 11 + .../zen-observable/test/extras/zip.js | 21 + node_modules/zen-observable/test/filter.js | 14 + node_modules/zen-observable/test/flat-map.js | 23 + node_modules/zen-observable/test/for-each.js | 70 + node_modules/zen-observable/test/from.js | 95 + node_modules/zen-observable/test/map.js | 13 + .../zen-observable/test/observer-closed.js | 35 + .../zen-observable/test/observer-complete.js | 143 + .../zen-observable/test/observer-error.js | 145 + .../zen-observable/test/observer-next.js | 137 + node_modules/zen-observable/test/of.js | 32 + .../zen-observable/test/properties.js | 31 + node_modules/zen-observable/test/reduce.js | 38 + node_modules/zen-observable/test/setup.js | 9 + node_modules/zen-observable/test/species.js | 28 + node_modules/zen-observable/test/subscribe.js | 137 + .../zen-observable/test/subscription.js | 41 + package.json | 7 + yarn.lock | 238 ++ 1194 files changed, 130148 insertions(+), 19 deletions(-) create mode 100644 client/src/components/Header.js create mode 100644 client/src/components/Login.js create mode 100644 client/src/constants.js create mode 100644 node_modules/.bin/loose-envify create mode 100644 node_modules/.bin/loose-envify.cmd create mode 100644 node_modules/.yarn-integrity create mode 100644 node_modules/@types/node/LICENSE create mode 100644 node_modules/@types/node/README.md create mode 100644 node_modules/@types/node/assert.d.ts create mode 100644 node_modules/@types/node/async_hooks.d.ts create mode 100644 node_modules/@types/node/base.d.ts create mode 100644 node_modules/@types/node/buffer.d.ts create mode 100644 node_modules/@types/node/child_process.d.ts create mode 100644 node_modules/@types/node/cluster.d.ts create mode 100644 node_modules/@types/node/console.d.ts create mode 100644 node_modules/@types/node/constants.d.ts create mode 100644 node_modules/@types/node/crypto.d.ts create mode 100644 node_modules/@types/node/dgram.d.ts create mode 100644 node_modules/@types/node/dns.d.ts create mode 100644 node_modules/@types/node/domain.d.ts create mode 100644 node_modules/@types/node/events.d.ts create mode 100644 node_modules/@types/node/fs.d.ts create mode 100644 node_modules/@types/node/globals.d.ts create mode 100644 node_modules/@types/node/http.d.ts create mode 100644 node_modules/@types/node/http2.d.ts create mode 100644 node_modules/@types/node/https.d.ts create mode 100644 node_modules/@types/node/index.d.ts create mode 100644 node_modules/@types/node/inspector.d.ts create mode 100644 node_modules/@types/node/module.d.ts create mode 100644 node_modules/@types/node/net.d.ts create mode 100644 node_modules/@types/node/os.d.ts create mode 100644 node_modules/@types/node/package.json create mode 100644 node_modules/@types/node/path.d.ts create mode 100644 node_modules/@types/node/perf_hooks.d.ts create mode 100644 node_modules/@types/node/process.d.ts create mode 100644 node_modules/@types/node/punycode.d.ts create mode 100644 node_modules/@types/node/querystring.d.ts create mode 100644 node_modules/@types/node/readline.d.ts create mode 100644 node_modules/@types/node/repl.d.ts create mode 100644 node_modules/@types/node/stream.d.ts create mode 100644 node_modules/@types/node/string_decoder.d.ts create mode 100644 node_modules/@types/node/timers.d.ts create mode 100644 node_modules/@types/node/tls.d.ts create mode 100644 node_modules/@types/node/trace_events.d.ts create mode 100644 node_modules/@types/node/ts3.2/globals.d.ts create mode 100644 node_modules/@types/node/ts3.2/index.d.ts create mode 100644 node_modules/@types/node/ts3.2/util.d.ts create mode 100644 node_modules/@types/node/tty.d.ts create mode 100644 node_modules/@types/node/url.d.ts create mode 100644 node_modules/@types/node/util.d.ts create mode 100644 node_modules/@types/node/v8.d.ts create mode 100644 node_modules/@types/node/vm.d.ts create mode 100644 node_modules/@types/node/worker_threads.d.ts create mode 100644 node_modules/@types/node/zlib.d.ts create mode 100644 node_modules/@types/zen-observable/LICENSE create mode 100644 node_modules/@types/zen-observable/README.md create mode 100644 node_modules/@types/zen-observable/index.d.ts create mode 100644 node_modules/@types/zen-observable/package.json create mode 100644 node_modules/@wry/context/LICENSE create mode 100644 node_modules/@wry/context/README.md create mode 100644 node_modules/@wry/context/lib/context.d.ts create mode 100644 node_modules/@wry/context/lib/context.esm.js create mode 100644 node_modules/@wry/context/lib/context.esm.js.map create mode 100644 node_modules/@wry/context/lib/context.js create mode 100644 node_modules/@wry/context/lib/context.js.map create mode 100644 node_modules/@wry/context/lib/slot.d.ts create mode 100644 node_modules/@wry/context/lib/slot.js create mode 100644 node_modules/@wry/context/lib/slot.js.map create mode 100644 node_modules/@wry/context/package.json create mode 100644 node_modules/@wry/context/rollup.config.js create mode 100644 node_modules/@wry/context/tsconfig.json create mode 100644 node_modules/@wry/context/tsconfig.rollup.json create mode 100644 node_modules/@wry/equality/LICENSE create mode 100644 node_modules/@wry/equality/README.md create mode 100644 node_modules/@wry/equality/lib/equality.d.ts create mode 100644 node_modules/@wry/equality/lib/equality.esm.js create mode 100644 node_modules/@wry/equality/lib/equality.esm.js.map create mode 100644 node_modules/@wry/equality/lib/equality.js create mode 100644 node_modules/@wry/equality/lib/equality.js.map create mode 100644 node_modules/@wry/equality/package.json create mode 100644 node_modules/@wry/equality/rollup.config.js create mode 100644 node_modules/@wry/equality/tsconfig.json create mode 100644 node_modules/@wry/equality/tsconfig.rollup.json create mode 100644 node_modules/apollo-boost/CHANGELOG.md create mode 100644 node_modules/apollo-boost/LICENSE create mode 100644 node_modules/apollo-boost/README.md create mode 100644 node_modules/apollo-boost/jest.config.js create mode 100644 node_modules/apollo-boost/lib/bundle.cjs.js create mode 100644 node_modules/apollo-boost/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-boost/lib/bundle.cjs.min.js create mode 100644 node_modules/apollo-boost/lib/bundle.esm.js create mode 100644 node_modules/apollo-boost/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-boost/lib/bundle.umd.js create mode 100644 node_modules/apollo-boost/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-boost/lib/index.d.ts create mode 100644 node_modules/apollo-boost/lib/index.d.ts.map create mode 100644 node_modules/apollo-boost/lib/index.js create mode 100644 node_modules/apollo-boost/lib/index.js.map create mode 100644 node_modules/apollo-boost/package.json create mode 100644 node_modules/apollo-boost/src/__tests__/__snapshots__/config.ts.snap create mode 100644 node_modules/apollo-boost/src/__tests__/config.ts create mode 100644 node_modules/apollo-boost/src/__tests__/smoke.ts create mode 100644 node_modules/apollo-boost/src/index.ts create mode 100644 node_modules/apollo-cache-inmemory/CHANGELOG.md create mode 100644 node_modules/apollo-cache-inmemory/LICENSE create mode 100644 node_modules/apollo-cache-inmemory/README.md create mode 100644 node_modules/apollo-cache-inmemory/jest.config.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/cache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js create mode 100644 node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.cjs.js create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.esm.js create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.umd.js create mode 100644 node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/depTrackingCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fixPolyfills.js create mode 100644 node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js create mode 100644 node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/inMemoryCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/index.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/index.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/index.js create mode 100644 node_modules/apollo-cache-inmemory/lib/index.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/mapCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/mapCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/mapCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/objectCache.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/objectCache.js create mode 100644 node_modules/apollo-cache-inmemory/lib/objectCache.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/readFromStore.js create mode 100644 node_modules/apollo-cache-inmemory/lib/readFromStore.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/types.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/types.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/types.js create mode 100644 node_modules/apollo-cache-inmemory/lib/types.js.map create mode 100644 node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts create mode 100644 node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map create mode 100644 node_modules/apollo-cache-inmemory/lib/writeToStore.js create mode 100644 node_modules/apollo-cache-inmemory/lib/writeToStore.js.map create mode 100644 node_modules/apollo-cache-inmemory/package.json create mode 100644 node_modules/apollo-cache/CHANGELOG.md create mode 100644 node_modules/apollo-cache/LICENSE create mode 100644 node_modules/apollo-cache/jest.config.js create mode 100644 node_modules/apollo-cache/lib/bundle.cjs.js create mode 100644 node_modules/apollo-cache/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-cache/lib/bundle.cjs.min.js create mode 100644 node_modules/apollo-cache/lib/bundle.esm.js create mode 100644 node_modules/apollo-cache/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-cache/lib/bundle.umd.js create mode 100644 node_modules/apollo-cache/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-cache/lib/cache.d.ts create mode 100644 node_modules/apollo-cache/lib/cache.d.ts.map create mode 100644 node_modules/apollo-cache/lib/cache.js create mode 100644 node_modules/apollo-cache/lib/cache.js.map create mode 100644 node_modules/apollo-cache/lib/index.d.ts create mode 100644 node_modules/apollo-cache/lib/index.d.ts.map create mode 100644 node_modules/apollo-cache/lib/index.js create mode 100644 node_modules/apollo-cache/lib/index.js.map create mode 100644 node_modules/apollo-cache/lib/types/Cache.d.ts create mode 100644 node_modules/apollo-cache/lib/types/Cache.d.ts.map create mode 100644 node_modules/apollo-cache/lib/types/Cache.js create mode 100644 node_modules/apollo-cache/lib/types/Cache.js.map create mode 100644 node_modules/apollo-cache/lib/types/DataProxy.d.ts create mode 100644 node_modules/apollo-cache/lib/types/DataProxy.d.ts.map create mode 100644 node_modules/apollo-cache/lib/types/DataProxy.js create mode 100644 node_modules/apollo-cache/lib/types/DataProxy.js.map create mode 100644 node_modules/apollo-cache/lib/types/index.d.ts create mode 100644 node_modules/apollo-cache/lib/types/index.d.ts.map create mode 100644 node_modules/apollo-cache/lib/types/index.js create mode 100644 node_modules/apollo-cache/lib/types/index.js.map create mode 100644 node_modules/apollo-cache/lib/utils.d.ts create mode 100644 node_modules/apollo-cache/lib/utils.d.ts.map create mode 100644 node_modules/apollo-cache/lib/utils.js create mode 100644 node_modules/apollo-cache/lib/utils.js.map create mode 100644 node_modules/apollo-cache/package.json create mode 100644 node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap create mode 100644 node_modules/apollo-cache/src/__tests__/cache.ts create mode 100644 node_modules/apollo-cache/src/__tests__/utils.ts create mode 100644 node_modules/apollo-cache/src/cache.ts create mode 100644 node_modules/apollo-cache/src/index.ts create mode 100644 node_modules/apollo-cache/src/types/Cache.ts create mode 100644 node_modules/apollo-cache/src/types/DataProxy.ts create mode 100644 node_modules/apollo-cache/src/types/index.ts create mode 100644 node_modules/apollo-cache/src/utils.ts create mode 100644 node_modules/apollo-client/ApolloClient.d.ts create mode 100644 node_modules/apollo-client/ApolloClient.d.ts.map create mode 100644 node_modules/apollo-client/ApolloClient.js create mode 100644 node_modules/apollo-client/ApolloClient.js.map create mode 100644 node_modules/apollo-client/LICENSE create mode 100644 node_modules/apollo-client/README.md create mode 100644 node_modules/apollo-client/bundle.cjs.js create mode 100644 node_modules/apollo-client/bundle.cjs.js.map create mode 100644 node_modules/apollo-client/bundle.cjs.min.js create mode 100644 node_modules/apollo-client/bundle.esm.js create mode 100644 node_modules/apollo-client/bundle.esm.js.map create mode 100644 node_modules/apollo-client/bundle.umd.js create mode 100644 node_modules/apollo-client/bundle.umd.js.map create mode 100644 node_modules/apollo-client/config/jest/setup.d.ts create mode 100644 node_modules/apollo-client/config/jest/setup.d.ts.map create mode 100644 node_modules/apollo-client/config/jest/setup.js create mode 100644 node_modules/apollo-client/config/jest/setup.js.map create mode 100644 node_modules/apollo-client/core/LocalState.d.ts create mode 100644 node_modules/apollo-client/core/LocalState.d.ts.map create mode 100644 node_modules/apollo-client/core/LocalState.js create mode 100644 node_modules/apollo-client/core/LocalState.js.map create mode 100644 node_modules/apollo-client/core/ObservableQuery.d.ts create mode 100644 node_modules/apollo-client/core/ObservableQuery.d.ts.map create mode 100644 node_modules/apollo-client/core/ObservableQuery.js create mode 100644 node_modules/apollo-client/core/ObservableQuery.js.map create mode 100644 node_modules/apollo-client/core/QueryManager.d.ts create mode 100644 node_modules/apollo-client/core/QueryManager.d.ts.map create mode 100644 node_modules/apollo-client/core/QueryManager.js create mode 100644 node_modules/apollo-client/core/QueryManager.js.map create mode 100644 node_modules/apollo-client/core/networkStatus.d.ts create mode 100644 node_modules/apollo-client/core/networkStatus.d.ts.map create mode 100644 node_modules/apollo-client/core/networkStatus.js create mode 100644 node_modules/apollo-client/core/networkStatus.js.map create mode 100644 node_modules/apollo-client/core/types.d.ts create mode 100644 node_modules/apollo-client/core/types.d.ts.map create mode 100644 node_modules/apollo-client/core/types.js create mode 100644 node_modules/apollo-client/core/types.js.map create mode 100644 node_modules/apollo-client/core/watchQueryOptions.d.ts create mode 100644 node_modules/apollo-client/core/watchQueryOptions.d.ts.map create mode 100644 node_modules/apollo-client/core/watchQueryOptions.js create mode 100644 node_modules/apollo-client/core/watchQueryOptions.js.map create mode 100644 node_modules/apollo-client/data/mutations.d.ts create mode 100644 node_modules/apollo-client/data/mutations.d.ts.map create mode 100644 node_modules/apollo-client/data/mutations.js create mode 100644 node_modules/apollo-client/data/mutations.js.map create mode 100644 node_modules/apollo-client/data/queries.d.ts create mode 100644 node_modules/apollo-client/data/queries.d.ts.map create mode 100644 node_modules/apollo-client/data/queries.js create mode 100644 node_modules/apollo-client/data/queries.js.map create mode 100644 node_modules/apollo-client/data/store.d.ts create mode 100644 node_modules/apollo-client/data/store.d.ts.map create mode 100644 node_modules/apollo-client/data/store.js create mode 100644 node_modules/apollo-client/data/store.js.map create mode 100644 node_modules/apollo-client/errors/ApolloError.d.ts create mode 100644 node_modules/apollo-client/errors/ApolloError.d.ts.map create mode 100644 node_modules/apollo-client/errors/ApolloError.js create mode 100644 node_modules/apollo-client/errors/ApolloError.js.map create mode 100644 node_modules/apollo-client/index.d.ts create mode 100644 node_modules/apollo-client/index.d.ts.map create mode 100644 node_modules/apollo-client/index.js create mode 100644 node_modules/apollo-client/index.js.map create mode 100644 node_modules/apollo-client/package.json create mode 100644 node_modules/apollo-client/util/Observable.d.ts create mode 100644 node_modules/apollo-client/util/Observable.d.ts.map create mode 100644 node_modules/apollo-client/util/Observable.js create mode 100644 node_modules/apollo-client/util/Observable.js.map create mode 100644 node_modules/apollo-client/util/arrays.d.ts create mode 100644 node_modules/apollo-client/util/arrays.d.ts.map create mode 100644 node_modules/apollo-client/util/arrays.js create mode 100644 node_modules/apollo-client/util/arrays.js.map create mode 100644 node_modules/apollo-client/util/capitalizeFirstLetter.d.ts create mode 100644 node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map create mode 100644 node_modules/apollo-client/util/capitalizeFirstLetter.js create mode 100644 node_modules/apollo-client/util/capitalizeFirstLetter.js.map create mode 100644 node_modules/apollo-client/util/observableToPromise.d.ts create mode 100644 node_modules/apollo-client/util/observableToPromise.d.ts.map create mode 100644 node_modules/apollo-client/util/observableToPromise.js create mode 100644 node_modules/apollo-client/util/observableToPromise.js.map create mode 100644 node_modules/apollo-client/util/observables.d.ts create mode 100644 node_modules/apollo-client/util/observables.d.ts.map create mode 100644 node_modules/apollo-client/util/observables.js create mode 100644 node_modules/apollo-client/util/observables.js.map create mode 100644 node_modules/apollo-client/util/subscribeAndCount.d.ts create mode 100644 node_modules/apollo-client/util/subscribeAndCount.d.ts.map create mode 100644 node_modules/apollo-client/util/subscribeAndCount.js create mode 100644 node_modules/apollo-client/util/subscribeAndCount.js.map create mode 100644 node_modules/apollo-client/util/wrap.d.ts create mode 100644 node_modules/apollo-client/util/wrap.d.ts.map create mode 100644 node_modules/apollo-client/util/wrap.js create mode 100644 node_modules/apollo-client/util/wrap.js.map create mode 100644 node_modules/apollo-client/version.d.ts create mode 100644 node_modules/apollo-client/version.d.ts.map create mode 100644 node_modules/apollo-client/version.js create mode 100644 node_modules/apollo-client/version.js.map create mode 100644 node_modules/apollo-link-error/CHANGELOG.md create mode 100644 node_modules/apollo-link-error/LICENSE create mode 100644 node_modules/apollo-link-error/README.md create mode 100644 node_modules/apollo-link-error/lib/bundle.cjs.js create mode 100644 node_modules/apollo-link-error/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-link-error/lib/bundle.esm.js create mode 100644 node_modules/apollo-link-error/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-link-error/lib/bundle.umd.js create mode 100644 node_modules/apollo-link-error/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-link-error/lib/index.d.ts create mode 100644 node_modules/apollo-link-error/lib/index.d.ts.map create mode 100644 node_modules/apollo-link-error/lib/index.js create mode 100644 node_modules/apollo-link-error/lib/index.js.map create mode 100644 node_modules/apollo-link-error/package.json create mode 100644 node_modules/apollo-link-http-common/CHANGELOG.md create mode 100644 node_modules/apollo-link-http-common/LICENSE create mode 100644 node_modules/apollo-link-http-common/README.md create mode 100644 node_modules/apollo-link-http-common/lib/bundle.cjs.js create mode 100644 node_modules/apollo-link-http-common/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-link-http-common/lib/bundle.esm.js create mode 100644 node_modules/apollo-link-http-common/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-link-http-common/lib/bundle.umd.js create mode 100644 node_modules/apollo-link-http-common/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-link-http-common/lib/index.d.ts create mode 100644 node_modules/apollo-link-http-common/lib/index.d.ts.map create mode 100644 node_modules/apollo-link-http-common/lib/index.js create mode 100644 node_modules/apollo-link-http-common/lib/index.js.map create mode 100644 node_modules/apollo-link-http-common/package.json create mode 100644 node_modules/apollo-link-http/CHANGELOG.md create mode 100644 node_modules/apollo-link-http/LICENSE create mode 100644 node_modules/apollo-link-http/README.md create mode 100644 node_modules/apollo-link-http/lib/bundle.cjs.js create mode 100644 node_modules/apollo-link-http/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-link-http/lib/bundle.esm.js create mode 100644 node_modules/apollo-link-http/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-link-http/lib/bundle.umd.js create mode 100644 node_modules/apollo-link-http/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-link-http/lib/httpLink.d.ts create mode 100644 node_modules/apollo-link-http/lib/httpLink.d.ts.map create mode 100644 node_modules/apollo-link-http/lib/httpLink.js create mode 100644 node_modules/apollo-link-http/lib/httpLink.js.map create mode 100644 node_modules/apollo-link-http/lib/index.d.ts create mode 100644 node_modules/apollo-link-http/lib/index.d.ts.map create mode 100644 node_modules/apollo-link-http/lib/index.js create mode 100644 node_modules/apollo-link-http/lib/index.js.map create mode 100644 node_modules/apollo-link-http/package.json create mode 100644 node_modules/apollo-link/CHANGELOG.md create mode 100644 node_modules/apollo-link/LICENSE create mode 100644 node_modules/apollo-link/README.md create mode 100644 node_modules/apollo-link/apollo-link-1.2.8.tgz create mode 100644 node_modules/apollo-link/lib/bundle.cjs.js create mode 100644 node_modules/apollo-link/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-link/lib/bundle.esm.js create mode 100644 node_modules/apollo-link/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-link/lib/bundle.umd.js create mode 100644 node_modules/apollo-link/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-link/lib/index.d.ts create mode 100644 node_modules/apollo-link/lib/index.d.ts.map create mode 100644 node_modules/apollo-link/lib/index.js create mode 100644 node_modules/apollo-link/lib/index.js.map create mode 100644 node_modules/apollo-link/lib/link.d.ts create mode 100644 node_modules/apollo-link/lib/link.d.ts.map create mode 100644 node_modules/apollo-link/lib/link.js create mode 100644 node_modules/apollo-link/lib/link.js.map create mode 100644 node_modules/apollo-link/lib/linkUtils.d.ts create mode 100644 node_modules/apollo-link/lib/linkUtils.d.ts.map create mode 100644 node_modules/apollo-link/lib/linkUtils.js create mode 100644 node_modules/apollo-link/lib/linkUtils.js.map create mode 100644 node_modules/apollo-link/lib/test-utils.d.ts create mode 100644 node_modules/apollo-link/lib/test-utils.d.ts.map create mode 100644 node_modules/apollo-link/lib/test-utils.js create mode 100644 node_modules/apollo-link/lib/test-utils.js.map create mode 100644 node_modules/apollo-link/lib/test-utils/mockLink.d.ts create mode 100644 node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map create mode 100644 node_modules/apollo-link/lib/test-utils/mockLink.js create mode 100644 node_modules/apollo-link/lib/test-utils/mockLink.js.map create mode 100644 node_modules/apollo-link/lib/test-utils/setContext.d.ts create mode 100644 node_modules/apollo-link/lib/test-utils/setContext.d.ts.map create mode 100644 node_modules/apollo-link/lib/test-utils/setContext.js create mode 100644 node_modules/apollo-link/lib/test-utils/setContext.js.map create mode 100644 node_modules/apollo-link/lib/test-utils/testingUtils.d.ts create mode 100644 node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map create mode 100644 node_modules/apollo-link/lib/test-utils/testingUtils.js create mode 100644 node_modules/apollo-link/lib/test-utils/testingUtils.js.map create mode 100644 node_modules/apollo-link/lib/types.d.ts create mode 100644 node_modules/apollo-link/lib/types.d.ts.map create mode 100644 node_modules/apollo-link/lib/types.js create mode 100644 node_modules/apollo-link/lib/types.js.map create mode 100644 node_modules/apollo-link/package.json create mode 100644 node_modules/apollo-utilities/.flowconfig create mode 100644 node_modules/apollo-utilities/CHANGELOG.md create mode 100644 node_modules/apollo-utilities/LICENSE create mode 100644 node_modules/apollo-utilities/jest.config.js create mode 100644 node_modules/apollo-utilities/lib/bundle.cjs.js create mode 100644 node_modules/apollo-utilities/lib/bundle.cjs.js.map create mode 100644 node_modules/apollo-utilities/lib/bundle.cjs.min.js create mode 100644 node_modules/apollo-utilities/lib/bundle.esm.js create mode 100644 node_modules/apollo-utilities/lib/bundle.esm.js.map create mode 100644 node_modules/apollo-utilities/lib/bundle.umd.js create mode 100644 node_modules/apollo-utilities/lib/bundle.umd.js.map create mode 100644 node_modules/apollo-utilities/lib/directives.d.ts create mode 100644 node_modules/apollo-utilities/lib/directives.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/directives.js create mode 100644 node_modules/apollo-utilities/lib/directives.js.map create mode 100644 node_modules/apollo-utilities/lib/fragments.d.ts create mode 100644 node_modules/apollo-utilities/lib/fragments.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/fragments.js create mode 100644 node_modules/apollo-utilities/lib/fragments.js.map create mode 100644 node_modules/apollo-utilities/lib/getFromAST.d.ts create mode 100644 node_modules/apollo-utilities/lib/getFromAST.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/getFromAST.js create mode 100644 node_modules/apollo-utilities/lib/getFromAST.js.map create mode 100644 node_modules/apollo-utilities/lib/index.d.ts create mode 100644 node_modules/apollo-utilities/lib/index.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/index.js create mode 100644 node_modules/apollo-utilities/lib/index.js.map create mode 100644 node_modules/apollo-utilities/lib/storeUtils.d.ts create mode 100644 node_modules/apollo-utilities/lib/storeUtils.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/storeUtils.js create mode 100644 node_modules/apollo-utilities/lib/storeUtils.js.map create mode 100644 node_modules/apollo-utilities/lib/transform.d.ts create mode 100644 node_modules/apollo-utilities/lib/transform.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/transform.js create mode 100644 node_modules/apollo-utilities/lib/transform.js.map create mode 100644 node_modules/apollo-utilities/lib/util/assign.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/assign.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/assign.js create mode 100644 node_modules/apollo-utilities/lib/util/assign.js.map create mode 100644 node_modules/apollo-utilities/lib/util/canUse.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/canUse.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/canUse.js create mode 100644 node_modules/apollo-utilities/lib/util/canUse.js.map create mode 100644 node_modules/apollo-utilities/lib/util/cloneDeep.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/cloneDeep.js create mode 100644 node_modules/apollo-utilities/lib/util/cloneDeep.js.map create mode 100644 node_modules/apollo-utilities/lib/util/environment.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/environment.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/environment.js create mode 100644 node_modules/apollo-utilities/lib/util/environment.js.map create mode 100644 node_modules/apollo-utilities/lib/util/errorHandling.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/errorHandling.js create mode 100644 node_modules/apollo-utilities/lib/util/errorHandling.js.map create mode 100644 node_modules/apollo-utilities/lib/util/filterInPlace.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/filterInPlace.js create mode 100644 node_modules/apollo-utilities/lib/util/filterInPlace.js.map create mode 100644 node_modules/apollo-utilities/lib/util/isEqual.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/isEqual.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/isEqual.js create mode 100644 node_modules/apollo-utilities/lib/util/isEqual.js.map create mode 100644 node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js create mode 100644 node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map create mode 100644 node_modules/apollo-utilities/lib/util/mergeDeep.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/mergeDeep.js create mode 100644 node_modules/apollo-utilities/lib/util/mergeDeep.js.map create mode 100644 node_modules/apollo-utilities/lib/util/stripSymbols.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/stripSymbols.js create mode 100644 node_modules/apollo-utilities/lib/util/stripSymbols.js.map create mode 100644 node_modules/apollo-utilities/lib/util/warnOnce.d.ts create mode 100644 node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map create mode 100644 node_modules/apollo-utilities/lib/util/warnOnce.js create mode 100644 node_modules/apollo-utilities/lib/util/warnOnce.js.map create mode 100644 node_modules/apollo-utilities/package.json create mode 100644 node_modules/apollo-utilities/src/__tests__/directives.ts create mode 100644 node_modules/apollo-utilities/src/__tests__/fragments.ts create mode 100644 node_modules/apollo-utilities/src/__tests__/getFromAST.ts create mode 100644 node_modules/apollo-utilities/src/__tests__/storeUtils.ts create mode 100644 node_modules/apollo-utilities/src/__tests__/transform.ts create mode 100644 node_modules/apollo-utilities/src/declarations.d.ts create mode 100644 node_modules/apollo-utilities/src/directives.ts create mode 100644 node_modules/apollo-utilities/src/fragments.ts create mode 100644 node_modules/apollo-utilities/src/getFromAST.ts create mode 100644 node_modules/apollo-utilities/src/index.js.flow create mode 100644 node_modules/apollo-utilities/src/index.ts create mode 100644 node_modules/apollo-utilities/src/storeUtils.ts create mode 100644 node_modules/apollo-utilities/src/transform.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/assign.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/environment.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/isEqual.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts create mode 100644 node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts create mode 100644 node_modules/apollo-utilities/src/util/assign.ts create mode 100644 node_modules/apollo-utilities/src/util/canUse.ts create mode 100644 node_modules/apollo-utilities/src/util/cloneDeep.ts create mode 100644 node_modules/apollo-utilities/src/util/environment.ts create mode 100644 node_modules/apollo-utilities/src/util/errorHandling.ts create mode 100644 node_modules/apollo-utilities/src/util/filterInPlace.ts create mode 100644 node_modules/apollo-utilities/src/util/isEqual.ts create mode 100644 node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts create mode 100644 node_modules/apollo-utilities/src/util/mergeDeep.ts create mode 100644 node_modules/apollo-utilities/src/util/stripSymbols.ts create mode 100644 node_modules/apollo-utilities/src/util/warnOnce.ts create mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 node_modules/fast-json-stable-stringify/.npmignore create mode 100644 node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 node_modules/fast-json-stable-stringify/LICENSE create mode 100644 node_modules/fast-json-stable-stringify/README.md create mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 node_modules/fast-json-stable-stringify/example/str.js create mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/index.js create mode 100644 node_modules/fast-json-stable-stringify/package.json create mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 node_modules/fast-json-stable-stringify/test/str.js create mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 node_modules/graphql-tag/.tav.yml create mode 100644 node_modules/graphql-tag/CHANGELOG.md create mode 100644 node_modules/graphql-tag/CONTRIBUTING.md create mode 100644 node_modules/graphql-tag/LICENSE create mode 100644 node_modules/graphql-tag/README.md create mode 100644 node_modules/graphql-tag/index.d.ts create mode 100644 node_modules/graphql-tag/lib/graphql-tag.umd.js create mode 100644 node_modules/graphql-tag/lib/graphql-tag.umd.js.flow create mode 100644 node_modules/graphql-tag/lib/graphql-tag.umd.js.map create mode 100644 node_modules/graphql-tag/loader.js create mode 100644 node_modules/graphql-tag/package.json create mode 100644 node_modules/graphql-tag/src/index.js create mode 100644 node_modules/graphql-tag/src/index.js.flow create mode 100644 node_modules/graphql-tag/test/graphql-v0.11.js create mode 100644 node_modules/graphql-tag/test/graphql-v0.12.js create mode 100644 node_modules/graphql-tag/test/graphql.js create mode 100644 node_modules/graphql-tag/test/mocha.opts create mode 100644 node_modules/graphql/LICENSE create mode 100644 node_modules/graphql/README.md create mode 100644 node_modules/graphql/error/GraphQLError.js create mode 100644 node_modules/graphql/error/GraphQLError.js.flow create mode 100644 node_modules/graphql/error/GraphQLError.mjs create mode 100644 node_modules/graphql/error/formatError.js create mode 100644 node_modules/graphql/error/formatError.js.flow create mode 100644 node_modules/graphql/error/formatError.mjs create mode 100644 node_modules/graphql/error/index.js create mode 100644 node_modules/graphql/error/index.js.flow create mode 100644 node_modules/graphql/error/index.mjs create mode 100644 node_modules/graphql/error/locatedError.js create mode 100644 node_modules/graphql/error/locatedError.js.flow create mode 100644 node_modules/graphql/error/locatedError.mjs create mode 100644 node_modules/graphql/error/syntaxError.js create mode 100644 node_modules/graphql/error/syntaxError.js.flow create mode 100644 node_modules/graphql/error/syntaxError.mjs create mode 100644 node_modules/graphql/execution/execute.js create mode 100644 node_modules/graphql/execution/execute.js.flow create mode 100644 node_modules/graphql/execution/execute.mjs create mode 100644 node_modules/graphql/execution/index.js create mode 100644 node_modules/graphql/execution/index.js.flow create mode 100644 node_modules/graphql/execution/index.mjs create mode 100644 node_modules/graphql/execution/values.js create mode 100644 node_modules/graphql/execution/values.js.flow create mode 100644 node_modules/graphql/execution/values.mjs create mode 100644 node_modules/graphql/graphql.js create mode 100644 node_modules/graphql/graphql.js.flow create mode 100644 node_modules/graphql/graphql.mjs create mode 100644 node_modules/graphql/index.js create mode 100644 node_modules/graphql/index.js.flow create mode 100644 node_modules/graphql/index.mjs create mode 100644 node_modules/graphql/jsutils/ObjMap.js create mode 100644 node_modules/graphql/jsutils/ObjMap.js.flow create mode 100644 node_modules/graphql/jsutils/ObjMap.mjs create mode 100644 node_modules/graphql/jsutils/PromiseOrValue.js create mode 100644 node_modules/graphql/jsutils/PromiseOrValue.js.flow create mode 100644 node_modules/graphql/jsutils/PromiseOrValue.mjs create mode 100644 node_modules/graphql/jsutils/dedent.js create mode 100644 node_modules/graphql/jsutils/dedent.js.flow create mode 100644 node_modules/graphql/jsutils/dedent.mjs create mode 100644 node_modules/graphql/jsutils/defineToJSON.js create mode 100644 node_modules/graphql/jsutils/defineToJSON.js.flow create mode 100644 node_modules/graphql/jsutils/defineToJSON.mjs create mode 100644 node_modules/graphql/jsutils/defineToStringTag.js create mode 100644 node_modules/graphql/jsutils/defineToStringTag.js.flow create mode 100644 node_modules/graphql/jsutils/defineToStringTag.mjs create mode 100644 node_modules/graphql/jsutils/didYouMean.js create mode 100644 node_modules/graphql/jsutils/didYouMean.js.flow create mode 100644 node_modules/graphql/jsutils/didYouMean.mjs create mode 100644 node_modules/graphql/jsutils/identityFunc.js create mode 100644 node_modules/graphql/jsutils/identityFunc.js.flow create mode 100644 node_modules/graphql/jsutils/identityFunc.mjs create mode 100644 node_modules/graphql/jsutils/inspect.js create mode 100644 node_modules/graphql/jsutils/inspect.js.flow create mode 100644 node_modules/graphql/jsutils/inspect.mjs create mode 100644 node_modules/graphql/jsutils/instanceOf.js create mode 100644 node_modules/graphql/jsutils/instanceOf.js.flow create mode 100644 node_modules/graphql/jsutils/instanceOf.mjs create mode 100644 node_modules/graphql/jsutils/invariant.js create mode 100644 node_modules/graphql/jsutils/invariant.js.flow create mode 100644 node_modules/graphql/jsutils/invariant.mjs create mode 100644 node_modules/graphql/jsutils/isInvalid.js create mode 100644 node_modules/graphql/jsutils/isInvalid.js.flow create mode 100644 node_modules/graphql/jsutils/isInvalid.mjs create mode 100644 node_modules/graphql/jsutils/isNullish.js create mode 100644 node_modules/graphql/jsutils/isNullish.js.flow create mode 100644 node_modules/graphql/jsutils/isNullish.mjs create mode 100644 node_modules/graphql/jsutils/isObjectLike.js create mode 100644 node_modules/graphql/jsutils/isObjectLike.js.flow create mode 100644 node_modules/graphql/jsutils/isObjectLike.mjs create mode 100644 node_modules/graphql/jsutils/isPromise.js create mode 100644 node_modules/graphql/jsutils/isPromise.js.flow create mode 100644 node_modules/graphql/jsutils/isPromise.mjs create mode 100644 node_modules/graphql/jsutils/keyMap.js create mode 100644 node_modules/graphql/jsutils/keyMap.js.flow create mode 100644 node_modules/graphql/jsutils/keyMap.mjs create mode 100644 node_modules/graphql/jsutils/keyValMap.js create mode 100644 node_modules/graphql/jsutils/keyValMap.js.flow create mode 100644 node_modules/graphql/jsutils/keyValMap.mjs create mode 100644 node_modules/graphql/jsutils/mapValue.js create mode 100644 node_modules/graphql/jsutils/mapValue.js.flow create mode 100644 node_modules/graphql/jsutils/mapValue.mjs create mode 100644 node_modules/graphql/jsutils/memoize3.js create mode 100644 node_modules/graphql/jsutils/memoize3.js.flow create mode 100644 node_modules/graphql/jsutils/memoize3.mjs create mode 100644 node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js create mode 100644 node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow create mode 100644 node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs create mode 100644 node_modules/graphql/jsutils/promiseForObject.js create mode 100644 node_modules/graphql/jsutils/promiseForObject.js.flow create mode 100644 node_modules/graphql/jsutils/promiseForObject.mjs create mode 100644 node_modules/graphql/jsutils/promiseReduce.js create mode 100644 node_modules/graphql/jsutils/promiseReduce.js.flow create mode 100644 node_modules/graphql/jsutils/promiseReduce.mjs create mode 100644 node_modules/graphql/jsutils/suggestionList.js create mode 100644 node_modules/graphql/jsutils/suggestionList.js.flow create mode 100644 node_modules/graphql/jsutils/suggestionList.mjs create mode 100644 node_modules/graphql/language/ast.js create mode 100644 node_modules/graphql/language/ast.js.flow create mode 100644 node_modules/graphql/language/ast.mjs create mode 100644 node_modules/graphql/language/blockString.js create mode 100644 node_modules/graphql/language/blockString.js.flow create mode 100644 node_modules/graphql/language/blockString.mjs create mode 100644 node_modules/graphql/language/directiveLocation.js create mode 100644 node_modules/graphql/language/directiveLocation.js.flow create mode 100644 node_modules/graphql/language/directiveLocation.mjs create mode 100644 node_modules/graphql/language/index.js create mode 100644 node_modules/graphql/language/index.js.flow create mode 100644 node_modules/graphql/language/index.mjs create mode 100644 node_modules/graphql/language/kinds.js create mode 100644 node_modules/graphql/language/kinds.js.flow create mode 100644 node_modules/graphql/language/kinds.mjs create mode 100644 node_modules/graphql/language/lexer.js create mode 100644 node_modules/graphql/language/lexer.js.flow create mode 100644 node_modules/graphql/language/lexer.mjs create mode 100644 node_modules/graphql/language/location.js create mode 100644 node_modules/graphql/language/location.js.flow create mode 100644 node_modules/graphql/language/location.mjs create mode 100644 node_modules/graphql/language/parser.js create mode 100644 node_modules/graphql/language/parser.js.flow create mode 100644 node_modules/graphql/language/parser.mjs create mode 100644 node_modules/graphql/language/predicates.js create mode 100644 node_modules/graphql/language/predicates.js.flow create mode 100644 node_modules/graphql/language/predicates.mjs create mode 100644 node_modules/graphql/language/printLocation.js create mode 100644 node_modules/graphql/language/printLocation.js.flow create mode 100644 node_modules/graphql/language/printLocation.mjs create mode 100644 node_modules/graphql/language/printer.js create mode 100644 node_modules/graphql/language/printer.js.flow create mode 100644 node_modules/graphql/language/printer.mjs create mode 100644 node_modules/graphql/language/source.js create mode 100644 node_modules/graphql/language/source.js.flow create mode 100644 node_modules/graphql/language/source.mjs create mode 100644 node_modules/graphql/language/tokenKind.js create mode 100644 node_modules/graphql/language/tokenKind.js.flow create mode 100644 node_modules/graphql/language/tokenKind.mjs create mode 100644 node_modules/graphql/language/visitor.js create mode 100644 node_modules/graphql/language/visitor.js.flow create mode 100644 node_modules/graphql/language/visitor.mjs create mode 100644 node_modules/graphql/package.json create mode 100644 node_modules/graphql/polyfills/find.js create mode 100644 node_modules/graphql/polyfills/find.js.flow create mode 100644 node_modules/graphql/polyfills/find.mjs create mode 100644 node_modules/graphql/polyfills/flatMap.js create mode 100644 node_modules/graphql/polyfills/flatMap.js.flow create mode 100644 node_modules/graphql/polyfills/flatMap.mjs create mode 100644 node_modules/graphql/polyfills/isFinite.js create mode 100644 node_modules/graphql/polyfills/isFinite.js.flow create mode 100644 node_modules/graphql/polyfills/isFinite.mjs create mode 100644 node_modules/graphql/polyfills/isInteger.js create mode 100644 node_modules/graphql/polyfills/isInteger.js.flow create mode 100644 node_modules/graphql/polyfills/isInteger.mjs create mode 100644 node_modules/graphql/polyfills/objectEntries.js create mode 100644 node_modules/graphql/polyfills/objectEntries.js.flow create mode 100644 node_modules/graphql/polyfills/objectEntries.mjs create mode 100644 node_modules/graphql/polyfills/objectValues.js create mode 100644 node_modules/graphql/polyfills/objectValues.js.flow create mode 100644 node_modules/graphql/polyfills/objectValues.mjs create mode 100644 node_modules/graphql/subscription/asyncIteratorReject.js create mode 100644 node_modules/graphql/subscription/asyncIteratorReject.js.flow create mode 100644 node_modules/graphql/subscription/asyncIteratorReject.mjs create mode 100644 node_modules/graphql/subscription/index.js create mode 100644 node_modules/graphql/subscription/index.js.flow create mode 100644 node_modules/graphql/subscription/index.mjs create mode 100644 node_modules/graphql/subscription/mapAsyncIterator.js create mode 100644 node_modules/graphql/subscription/mapAsyncIterator.js.flow create mode 100644 node_modules/graphql/subscription/mapAsyncIterator.mjs create mode 100644 node_modules/graphql/subscription/subscribe.js create mode 100644 node_modules/graphql/subscription/subscribe.js.flow create mode 100644 node_modules/graphql/subscription/subscribe.mjs create mode 100644 node_modules/graphql/type/definition.js create mode 100644 node_modules/graphql/type/definition.js.flow create mode 100644 node_modules/graphql/type/definition.mjs create mode 100644 node_modules/graphql/type/directives.js create mode 100644 node_modules/graphql/type/directives.js.flow create mode 100644 node_modules/graphql/type/directives.mjs create mode 100644 node_modules/graphql/type/index.js create mode 100644 node_modules/graphql/type/index.js.flow create mode 100644 node_modules/graphql/type/index.mjs create mode 100644 node_modules/graphql/type/introspection.js create mode 100644 node_modules/graphql/type/introspection.js.flow create mode 100644 node_modules/graphql/type/introspection.mjs create mode 100644 node_modules/graphql/type/scalars.js create mode 100644 node_modules/graphql/type/scalars.js.flow create mode 100644 node_modules/graphql/type/scalars.mjs create mode 100644 node_modules/graphql/type/schema.js create mode 100644 node_modules/graphql/type/schema.js.flow create mode 100644 node_modules/graphql/type/schema.mjs create mode 100644 node_modules/graphql/type/validate.js create mode 100644 node_modules/graphql/type/validate.js.flow create mode 100644 node_modules/graphql/type/validate.mjs create mode 100644 node_modules/graphql/utilities/TypeInfo.js create mode 100644 node_modules/graphql/utilities/TypeInfo.js.flow create mode 100644 node_modules/graphql/utilities/TypeInfo.mjs create mode 100644 node_modules/graphql/utilities/assertValidName.js create mode 100644 node_modules/graphql/utilities/assertValidName.js.flow create mode 100644 node_modules/graphql/utilities/assertValidName.mjs create mode 100644 node_modules/graphql/utilities/astFromValue.js create mode 100644 node_modules/graphql/utilities/astFromValue.js.flow create mode 100644 node_modules/graphql/utilities/astFromValue.mjs create mode 100644 node_modules/graphql/utilities/buildASTSchema.js create mode 100644 node_modules/graphql/utilities/buildASTSchema.js.flow create mode 100644 node_modules/graphql/utilities/buildASTSchema.mjs create mode 100644 node_modules/graphql/utilities/buildClientSchema.js create mode 100644 node_modules/graphql/utilities/buildClientSchema.js.flow create mode 100644 node_modules/graphql/utilities/buildClientSchema.mjs create mode 100644 node_modules/graphql/utilities/coerceValue.js create mode 100644 node_modules/graphql/utilities/coerceValue.js.flow create mode 100644 node_modules/graphql/utilities/coerceValue.mjs create mode 100644 node_modules/graphql/utilities/concatAST.js create mode 100644 node_modules/graphql/utilities/concatAST.js.flow create mode 100644 node_modules/graphql/utilities/concatAST.mjs create mode 100644 node_modules/graphql/utilities/extendSchema.js create mode 100644 node_modules/graphql/utilities/extendSchema.js.flow create mode 100644 node_modules/graphql/utilities/extendSchema.mjs create mode 100644 node_modules/graphql/utilities/findBreakingChanges.js create mode 100644 node_modules/graphql/utilities/findBreakingChanges.js.flow create mode 100644 node_modules/graphql/utilities/findBreakingChanges.mjs create mode 100644 node_modules/graphql/utilities/findDeprecatedUsages.js create mode 100644 node_modules/graphql/utilities/findDeprecatedUsages.js.flow create mode 100644 node_modules/graphql/utilities/findDeprecatedUsages.mjs create mode 100644 node_modules/graphql/utilities/getOperationAST.js create mode 100644 node_modules/graphql/utilities/getOperationAST.js.flow create mode 100644 node_modules/graphql/utilities/getOperationAST.mjs create mode 100644 node_modules/graphql/utilities/getOperationRootType.js create mode 100644 node_modules/graphql/utilities/getOperationRootType.js.flow create mode 100644 node_modules/graphql/utilities/getOperationRootType.mjs create mode 100644 node_modules/graphql/utilities/index.js create mode 100644 node_modules/graphql/utilities/index.js.flow create mode 100644 node_modules/graphql/utilities/index.mjs create mode 100644 node_modules/graphql/utilities/introspectionFromSchema.js create mode 100644 node_modules/graphql/utilities/introspectionFromSchema.js.flow create mode 100644 node_modules/graphql/utilities/introspectionFromSchema.mjs create mode 100644 node_modules/graphql/utilities/introspectionQuery.js create mode 100644 node_modules/graphql/utilities/introspectionQuery.js.flow create mode 100644 node_modules/graphql/utilities/introspectionQuery.mjs create mode 100644 node_modules/graphql/utilities/isValidJSValue.js create mode 100644 node_modules/graphql/utilities/isValidJSValue.js.flow create mode 100644 node_modules/graphql/utilities/isValidJSValue.mjs create mode 100644 node_modules/graphql/utilities/isValidLiteralValue.js create mode 100644 node_modules/graphql/utilities/isValidLiteralValue.js.flow create mode 100644 node_modules/graphql/utilities/isValidLiteralValue.mjs create mode 100644 node_modules/graphql/utilities/lexicographicSortSchema.js create mode 100644 node_modules/graphql/utilities/lexicographicSortSchema.js.flow create mode 100644 node_modules/graphql/utilities/lexicographicSortSchema.mjs create mode 100644 node_modules/graphql/utilities/schemaPrinter.js create mode 100644 node_modules/graphql/utilities/schemaPrinter.js.flow create mode 100644 node_modules/graphql/utilities/schemaPrinter.mjs create mode 100644 node_modules/graphql/utilities/separateOperations.js create mode 100644 node_modules/graphql/utilities/separateOperations.js.flow create mode 100644 node_modules/graphql/utilities/separateOperations.mjs create mode 100644 node_modules/graphql/utilities/stripIgnoredCharacters.js create mode 100644 node_modules/graphql/utilities/stripIgnoredCharacters.js.flow create mode 100644 node_modules/graphql/utilities/stripIgnoredCharacters.mjs create mode 100644 node_modules/graphql/utilities/typeComparators.js create mode 100644 node_modules/graphql/utilities/typeComparators.js.flow create mode 100644 node_modules/graphql/utilities/typeComparators.mjs create mode 100644 node_modules/graphql/utilities/typeFromAST.js create mode 100644 node_modules/graphql/utilities/typeFromAST.js.flow create mode 100644 node_modules/graphql/utilities/typeFromAST.mjs create mode 100644 node_modules/graphql/utilities/valueFromAST.js create mode 100644 node_modules/graphql/utilities/valueFromAST.js.flow create mode 100644 node_modules/graphql/utilities/valueFromAST.mjs create mode 100644 node_modules/graphql/utilities/valueFromASTUntyped.js create mode 100644 node_modules/graphql/utilities/valueFromASTUntyped.js.flow create mode 100644 node_modules/graphql/utilities/valueFromASTUntyped.mjs create mode 100644 node_modules/graphql/validation/ValidationContext.js create mode 100644 node_modules/graphql/validation/ValidationContext.js.flow create mode 100644 node_modules/graphql/validation/ValidationContext.mjs create mode 100644 node_modules/graphql/validation/index.js create mode 100644 node_modules/graphql/validation/index.js.flow create mode 100644 node_modules/graphql/validation/index.mjs create mode 100644 node_modules/graphql/validation/rules/ExecutableDefinitions.js create mode 100644 node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow create mode 100644 node_modules/graphql/validation/rules/ExecutableDefinitions.mjs create mode 100644 node_modules/graphql/validation/rules/FieldsOnCorrectType.js create mode 100644 node_modules/graphql/validation/rules/FieldsOnCorrectType.js.flow create mode 100644 node_modules/graphql/validation/rules/FieldsOnCorrectType.mjs create mode 100644 node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js create mode 100644 node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js.flow create mode 100644 node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.mjs create mode 100644 node_modules/graphql/validation/rules/KnownArgumentNames.js create mode 100644 node_modules/graphql/validation/rules/KnownArgumentNames.js.flow create mode 100644 node_modules/graphql/validation/rules/KnownArgumentNames.mjs create mode 100644 node_modules/graphql/validation/rules/KnownDirectives.js create mode 100644 node_modules/graphql/validation/rules/KnownDirectives.js.flow create mode 100644 node_modules/graphql/validation/rules/KnownDirectives.mjs create mode 100644 node_modules/graphql/validation/rules/KnownFragmentNames.js create mode 100644 node_modules/graphql/validation/rules/KnownFragmentNames.js.flow create mode 100644 node_modules/graphql/validation/rules/KnownFragmentNames.mjs create mode 100644 node_modules/graphql/validation/rules/KnownTypeNames.js create mode 100644 node_modules/graphql/validation/rules/KnownTypeNames.js.flow create mode 100644 node_modules/graphql/validation/rules/KnownTypeNames.mjs create mode 100644 node_modules/graphql/validation/rules/LoneAnonymousOperation.js create mode 100644 node_modules/graphql/validation/rules/LoneAnonymousOperation.js.flow create mode 100644 node_modules/graphql/validation/rules/LoneAnonymousOperation.mjs create mode 100644 node_modules/graphql/validation/rules/LoneSchemaDefinition.js create mode 100644 node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow create mode 100644 node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs create mode 100644 node_modules/graphql/validation/rules/NoFragmentCycles.js create mode 100644 node_modules/graphql/validation/rules/NoFragmentCycles.js.flow create mode 100644 node_modules/graphql/validation/rules/NoFragmentCycles.mjs create mode 100644 node_modules/graphql/validation/rules/NoUndefinedVariables.js create mode 100644 node_modules/graphql/validation/rules/NoUndefinedVariables.js.flow create mode 100644 node_modules/graphql/validation/rules/NoUndefinedVariables.mjs create mode 100644 node_modules/graphql/validation/rules/NoUnusedFragments.js create mode 100644 node_modules/graphql/validation/rules/NoUnusedFragments.js.flow create mode 100644 node_modules/graphql/validation/rules/NoUnusedFragments.mjs create mode 100644 node_modules/graphql/validation/rules/NoUnusedVariables.js create mode 100644 node_modules/graphql/validation/rules/NoUnusedVariables.js.flow create mode 100644 node_modules/graphql/validation/rules/NoUnusedVariables.mjs create mode 100644 node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js create mode 100644 node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js.flow create mode 100644 node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.mjs create mode 100644 node_modules/graphql/validation/rules/PossibleFragmentSpreads.js create mode 100644 node_modules/graphql/validation/rules/PossibleFragmentSpreads.js.flow create mode 100644 node_modules/graphql/validation/rules/PossibleFragmentSpreads.mjs create mode 100644 node_modules/graphql/validation/rules/PossibleTypeExtensions.js create mode 100644 node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow create mode 100644 node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs create mode 100644 node_modules/graphql/validation/rules/ProvidedRequiredArguments.js create mode 100644 node_modules/graphql/validation/rules/ProvidedRequiredArguments.js.flow create mode 100644 node_modules/graphql/validation/rules/ProvidedRequiredArguments.mjs create mode 100644 node_modules/graphql/validation/rules/ScalarLeafs.js create mode 100644 node_modules/graphql/validation/rules/ScalarLeafs.js.flow create mode 100644 node_modules/graphql/validation/rules/ScalarLeafs.mjs create mode 100644 node_modules/graphql/validation/rules/SingleFieldSubscriptions.js create mode 100644 node_modules/graphql/validation/rules/SingleFieldSubscriptions.js.flow create mode 100644 node_modules/graphql/validation/rules/SingleFieldSubscriptions.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueArgumentNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueArgumentNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueArgumentNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueDirectiveNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js create mode 100644 node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueEnumValueNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueFragmentNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueFragmentNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueFragmentNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueInputFieldNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueInputFieldNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueInputFieldNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueOperationNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueOperationNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueOperationNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueOperationTypes.js create mode 100644 node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueOperationTypes.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueTypeNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueTypeNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueTypeNames.mjs create mode 100644 node_modules/graphql/validation/rules/UniqueVariableNames.js create mode 100644 node_modules/graphql/validation/rules/UniqueVariableNames.js.flow create mode 100644 node_modules/graphql/validation/rules/UniqueVariableNames.mjs create mode 100644 node_modules/graphql/validation/rules/ValuesOfCorrectType.js create mode 100644 node_modules/graphql/validation/rules/ValuesOfCorrectType.js.flow create mode 100644 node_modules/graphql/validation/rules/ValuesOfCorrectType.mjs create mode 100644 node_modules/graphql/validation/rules/VariablesAreInputTypes.js create mode 100644 node_modules/graphql/validation/rules/VariablesAreInputTypes.js.flow create mode 100644 node_modules/graphql/validation/rules/VariablesAreInputTypes.mjs create mode 100644 node_modules/graphql/validation/rules/VariablesInAllowedPosition.js create mode 100644 node_modules/graphql/validation/rules/VariablesInAllowedPosition.js.flow create mode 100644 node_modules/graphql/validation/rules/VariablesInAllowedPosition.mjs create mode 100644 node_modules/graphql/validation/specifiedRules.js create mode 100644 node_modules/graphql/validation/specifiedRules.js.flow create mode 100644 node_modules/graphql/validation/specifiedRules.mjs create mode 100644 node_modules/graphql/validation/validate.js create mode 100644 node_modules/graphql/validation/validate.js.flow create mode 100644 node_modules/graphql/validation/validate.mjs create mode 100644 node_modules/graphql/version.js create mode 100644 node_modules/graphql/version.js.flow create mode 100644 node_modules/graphql/version.mjs create mode 100644 node_modules/hoist-non-react-statics/CHANGELOG.md create mode 100644 node_modules/hoist-non-react-statics/LICENSE.md create mode 100644 node_modules/hoist-non-react-statics/README.md create mode 100644 node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js create mode 100644 node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js create mode 100644 node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js create mode 100644 node_modules/hoist-non-react-statics/package.json create mode 100644 node_modules/hoist-non-react-statics/src/index.js create mode 100644 node_modules/iterall/LICENSE create mode 100644 node_modules/iterall/README.md create mode 100644 node_modules/iterall/index.d.ts create mode 100644 node_modules/iterall/index.js create mode 100644 node_modules/iterall/index.js.flow create mode 100644 node_modules/iterall/index.mjs create mode 100644 node_modules/iterall/package.json create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/lodash.isequal/LICENSE create mode 100644 node_modules/lodash.isequal/README.md create mode 100644 node_modules/lodash.isequal/index.js create mode 100644 node_modules/lodash.isequal/package.json create mode 100644 node_modules/loose-envify/LICENSE create mode 100644 node_modules/loose-envify/README.md create mode 100644 node_modules/loose-envify/cli.js create mode 100644 node_modules/loose-envify/custom.js create mode 100644 node_modules/loose-envify/index.js create mode 100644 node_modules/loose-envify/loose-envify.js create mode 100644 node_modules/loose-envify/package.json create mode 100644 node_modules/loose-envify/replace.js create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/optimism/LICENSE create mode 100644 node_modules/optimism/README.md create mode 100644 node_modules/optimism/lib/bundle.cjs.js create mode 100644 node_modules/optimism/lib/bundle.cjs.js.map create mode 100644 node_modules/optimism/lib/bundle.esm.js create mode 100644 node_modules/optimism/lib/bundle.esm.js.map create mode 100644 node_modules/optimism/lib/cache.d.ts create mode 100644 node_modules/optimism/lib/context.d.ts create mode 100644 node_modules/optimism/lib/entry.d.ts create mode 100644 node_modules/optimism/lib/index.d.ts create mode 100644 node_modules/optimism/lib/key-trie.d.ts create mode 100644 node_modules/optimism/package.json create mode 100644 node_modules/optimism/test.js create mode 100644 node_modules/prop-types/CHANGELOG.md create mode 100644 node_modules/prop-types/LICENSE create mode 100644 node_modules/prop-types/README.md create mode 100644 node_modules/prop-types/checkPropTypes.js create mode 100644 node_modules/prop-types/factory.js create mode 100644 node_modules/prop-types/factoryWithThrowingShims.js create mode 100644 node_modules/prop-types/factoryWithTypeCheckers.js create mode 100644 node_modules/prop-types/index.js create mode 100644 node_modules/prop-types/lib/ReactPropTypesSecret.js create mode 100644 node_modules/prop-types/node_modules/.bin/loose-envify create mode 100644 node_modules/prop-types/node_modules/.bin/loose-envify.cmd create mode 100644 node_modules/prop-types/package.json create mode 100644 node_modules/prop-types/prop-types.js create mode 100644 node_modules/prop-types/prop-types.min.js create mode 100644 node_modules/react-apollo/ApolloConsumer.d.ts create mode 100644 node_modules/react-apollo/ApolloConsumer.js create mode 100644 node_modules/react-apollo/ApolloConsumer.js.map create mode 100644 node_modules/react-apollo/ApolloContext.d.ts create mode 100644 node_modules/react-apollo/ApolloContext.js create mode 100644 node_modules/react-apollo/ApolloContext.js.map create mode 100644 node_modules/react-apollo/ApolloProvider.d.ts create mode 100644 node_modules/react-apollo/ApolloProvider.js create mode 100644 node_modules/react-apollo/ApolloProvider.js.map create mode 100644 node_modules/react-apollo/LICENSE create mode 100644 node_modules/react-apollo/Mutation.d.ts create mode 100644 node_modules/react-apollo/Mutation.js create mode 100644 node_modules/react-apollo/Mutation.js.map create mode 100644 node_modules/react-apollo/Query.d.ts create mode 100644 node_modules/react-apollo/Query.js create mode 100644 node_modules/react-apollo/Query.js.map create mode 100644 node_modules/react-apollo/README.md create mode 100644 node_modules/react-apollo/Subscriptions.d.ts create mode 100644 node_modules/react-apollo/Subscriptions.js create mode 100644 node_modules/react-apollo/Subscriptions.js.map create mode 100644 node_modules/react-apollo/component-utils.d.ts create mode 100644 node_modules/react-apollo/component-utils.js create mode 100644 node_modules/react-apollo/component-utils.js.map create mode 100644 node_modules/react-apollo/getDataFromTree.d.ts create mode 100644 node_modules/react-apollo/getDataFromTree.js create mode 100644 node_modules/react-apollo/getDataFromTree.js.map create mode 100644 node_modules/react-apollo/graphql.d.ts create mode 100644 node_modules/react-apollo/graphql.js create mode 100644 node_modules/react-apollo/graphql.js.map create mode 100644 node_modules/react-apollo/hoc-utils.d.ts create mode 100644 node_modules/react-apollo/hoc-utils.js create mode 100644 node_modules/react-apollo/hoc-utils.js.map create mode 100644 node_modules/react-apollo/index.d.ts create mode 100644 node_modules/react-apollo/index.js create mode 100644 node_modules/react-apollo/index.js.map create mode 100644 node_modules/react-apollo/mutation-hoc.d.ts create mode 100644 node_modules/react-apollo/mutation-hoc.js create mode 100644 node_modules/react-apollo/mutation-hoc.js.map create mode 100644 node_modules/react-apollo/package.json create mode 100644 node_modules/react-apollo/parser.d.ts create mode 100644 node_modules/react-apollo/parser.js create mode 100644 node_modules/react-apollo/parser.js.map create mode 100644 node_modules/react-apollo/query-hoc.d.ts create mode 100644 node_modules/react-apollo/query-hoc.js create mode 100644 node_modules/react-apollo/query-hoc.js.map create mode 100644 node_modules/react-apollo/queryRecycler.d.ts create mode 100644 node_modules/react-apollo/queryRecycler.js create mode 100644 node_modules/react-apollo/queryRecycler.js.map create mode 100644 node_modules/react-apollo/react-apollo.cjs.d.ts create mode 100644 node_modules/react-apollo/react-apollo.cjs.js create mode 100644 node_modules/react-apollo/react-apollo.cjs.js.map create mode 100644 node_modules/react-apollo/react-apollo.esm.js create mode 100644 node_modules/react-apollo/react-apollo.esm.js.map create mode 100644 node_modules/react-apollo/react-apollo.umd.js create mode 100644 node_modules/react-apollo/renderToStringWithData.d.ts create mode 100644 node_modules/react-apollo/renderToStringWithData.js create mode 100644 node_modules/react-apollo/renderToStringWithData.js.map create mode 100644 node_modules/react-apollo/subscription-hoc.d.ts create mode 100644 node_modules/react-apollo/subscription-hoc.js create mode 100644 node_modules/react-apollo/subscription-hoc.js.map create mode 100644 node_modules/react-apollo/test-links.d.ts create mode 100644 node_modules/react-apollo/test-links.js create mode 100644 node_modules/react-apollo/test-links.js.map create mode 100644 node_modules/react-apollo/test-utils.d.ts create mode 100644 node_modules/react-apollo/test-utils.js create mode 100644 node_modules/react-apollo/test-utils.js.map create mode 100644 node_modules/react-apollo/types.d.ts create mode 100644 node_modules/react-apollo/types.js create mode 100644 node_modules/react-apollo/types.js.map create mode 100644 node_modules/react-apollo/utils/flowRight.d.ts create mode 100644 node_modules/react-apollo/utils/flowRight.js create mode 100644 node_modules/react-apollo/utils/flowRight.js.map create mode 100644 node_modules/react-apollo/utils/shallowEqual.d.ts create mode 100644 node_modules/react-apollo/utils/shallowEqual.js create mode 100644 node_modules/react-apollo/utils/shallowEqual.js.map create mode 100644 node_modules/react-apollo/walkTree.d.ts create mode 100644 node_modules/react-apollo/walkTree.js create mode 100644 node_modules/react-apollo/walkTree.js.map create mode 100644 node_modules/react-apollo/withApollo.d.ts create mode 100644 node_modules/react-apollo/withApollo.js create mode 100644 node_modules/react-apollo/withApollo.js.map create mode 100644 node_modules/react-is/LICENSE create mode 100644 node_modules/react-is/README.md create mode 100644 node_modules/react-is/build-info.json create mode 100644 node_modules/react-is/cjs/react-is.development.js create mode 100644 node_modules/react-is/cjs/react-is.production.min.js create mode 100644 node_modules/react-is/index.js create mode 100644 node_modules/react-is/package.json create mode 100644 node_modules/react-is/umd/react-is.development.js create mode 100644 node_modules/react-is/umd/react-is.production.min.js create mode 100644 node_modules/symbol-observable/CHANGELOG.md create mode 100644 node_modules/symbol-observable/es/index.js create mode 100644 node_modules/symbol-observable/es/ponyfill.js create mode 100644 node_modules/symbol-observable/index.d.ts create mode 100644 node_modules/symbol-observable/index.js create mode 100644 node_modules/symbol-observable/lib/index.js create mode 100644 node_modules/symbol-observable/lib/ponyfill.js create mode 100644 node_modules/symbol-observable/license create mode 100644 node_modules/symbol-observable/package.json create mode 100644 node_modules/symbol-observable/readme.md create mode 100644 node_modules/ts-invariant/LICENSE create mode 100644 node_modules/ts-invariant/README.md create mode 100644 node_modules/ts-invariant/lib/invariant.d.ts create mode 100644 node_modules/ts-invariant/lib/invariant.esm.js create mode 100644 node_modules/ts-invariant/lib/invariant.esm.js.map create mode 100644 node_modules/ts-invariant/lib/invariant.js create mode 100644 node_modules/ts-invariant/lib/invariant.js.map create mode 100644 node_modules/ts-invariant/package.json create mode 100644 node_modules/ts-invariant/rollup.config.js create mode 100644 node_modules/ts-invariant/tsconfig.json create mode 100644 node_modules/ts-invariant/tsconfig.rollup.json create mode 100644 node_modules/tslib/CopyrightNotice.txt create mode 100644 node_modules/tslib/LICENSE.txt create mode 100644 node_modules/tslib/README.md create mode 100644 node_modules/tslib/package.json create mode 100644 node_modules/tslib/tslib.d.ts create mode 100644 node_modules/tslib/tslib.es6.html create mode 100644 node_modules/tslib/tslib.es6.js create mode 100644 node_modules/tslib/tslib.html create mode 100644 node_modules/tslib/tslib.js create mode 100644 node_modules/zen-observable-ts/CHANGELOG.md create mode 100644 node_modules/zen-observable-ts/LICENSE create mode 100644 node_modules/zen-observable-ts/lib/bundle.cjs.js create mode 100644 node_modules/zen-observable-ts/lib/bundle.cjs.js.map create mode 100644 node_modules/zen-observable-ts/lib/bundle.esm.js create mode 100644 node_modules/zen-observable-ts/lib/bundle.esm.js.map create mode 100644 node_modules/zen-observable-ts/lib/bundle.umd.js create mode 100644 node_modules/zen-observable-ts/lib/bundle.umd.js.map create mode 100644 node_modules/zen-observable-ts/lib/index.d.ts create mode 100644 node_modules/zen-observable-ts/lib/index.d.ts.map create mode 100644 node_modules/zen-observable-ts/lib/index.js create mode 100644 node_modules/zen-observable-ts/lib/index.js.map create mode 100644 node_modules/zen-observable-ts/lib/types.d.ts create mode 100644 node_modules/zen-observable-ts/lib/types.d.ts.map create mode 100644 node_modules/zen-observable-ts/lib/types.js create mode 100644 node_modules/zen-observable-ts/lib/types.js.map create mode 100644 node_modules/zen-observable-ts/lib/zenObservable.d.ts create mode 100644 node_modules/zen-observable-ts/lib/zenObservable.d.ts.map create mode 100644 node_modules/zen-observable-ts/lib/zenObservable.js create mode 100644 node_modules/zen-observable-ts/lib/zenObservable.js.map create mode 100644 node_modules/zen-observable-ts/package.json create mode 100644 node_modules/zen-observable/.editorconfig create mode 100644 node_modules/zen-observable/.eslintrc.js create mode 100644 node_modules/zen-observable/LICENSE create mode 100644 node_modules/zen-observable/README.md create mode 100644 node_modules/zen-observable/extras.js create mode 100644 node_modules/zen-observable/index.js create mode 100644 node_modules/zen-observable/lib/Observable.js create mode 100644 node_modules/zen-observable/lib/extras.js create mode 100644 node_modules/zen-observable/package.json create mode 100644 node_modules/zen-observable/scripts/babel-plugins.js create mode 100644 node_modules/zen-observable/scripts/build.js create mode 100644 node_modules/zen-observable/scripts/mocha-require.js create mode 100644 node_modules/zen-observable/src/Observable.js create mode 100644 node_modules/zen-observable/src/extras.js create mode 100644 node_modules/zen-observable/test/concat.js create mode 100644 node_modules/zen-observable/test/constructor.js create mode 100644 node_modules/zen-observable/test/extras/combine-latest.js create mode 100644 node_modules/zen-observable/test/extras/merge.js create mode 100644 node_modules/zen-observable/test/extras/parse.js create mode 100644 node_modules/zen-observable/test/extras/zip.js create mode 100644 node_modules/zen-observable/test/filter.js create mode 100644 node_modules/zen-observable/test/flat-map.js create mode 100644 node_modules/zen-observable/test/for-each.js create mode 100644 node_modules/zen-observable/test/from.js create mode 100644 node_modules/zen-observable/test/map.js create mode 100644 node_modules/zen-observable/test/observer-closed.js create mode 100644 node_modules/zen-observable/test/observer-complete.js create mode 100644 node_modules/zen-observable/test/observer-error.js create mode 100644 node_modules/zen-observable/test/observer-next.js create mode 100644 node_modules/zen-observable/test/of.js create mode 100644 node_modules/zen-observable/test/properties.js create mode 100644 node_modules/zen-observable/test/reduce.js create mode 100644 node_modules/zen-observable/test/setup.js create mode 100644 node_modules/zen-observable/test/species.js create mode 100644 node_modules/zen-observable/test/subscribe.js create mode 100644 node_modules/zen-observable/test/subscription.js create mode 100644 package.json create mode 100644 yarn.lock diff --git a/client/package.json b/client/package.json index d2e475a57..4a48fe48e 100644 --- a/client/package.json +++ b/client/package.json @@ -5,6 +5,8 @@ "dependencies": { "react": "^16.8.6", "react-dom": "^16.8.6", + "react-router": "^5.0.1", + "react-router-dom": "^5.0.1", "react-scripts": "3.0.1" }, "scripts": { diff --git a/client/src/App.js b/client/src/App.js index ce9cbd294..dd9b8cd3e 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,23 +1,16 @@ import React from 'react'; -import logo from './logo.svg'; +import { Switch, Route } from 'react-router-dom' +import Login from './components/Login' import './App.css'; function App() { return (
+

Hello from the APP!!

- logo -

- Edit src/App.js and save to reload. -

- - Learn React - + + +
); diff --git a/client/src/components/Header.js b/client/src/components/Header.js new file mode 100644 index 000000000..93cb4bf7f --- /dev/null +++ b/client/src/components/Header.js @@ -0,0 +1,45 @@ +import React, { Component } from 'react' +import { Link } from 'react-router-dom' +import { withRouter } from 'react-router' +import { AUTH_TOKEN } from '../constants' + +class Header extends Component { + render() { + const authToken = localStorage.getItem(AUTH_TOKEN) + return ( +
+
+
Treasure Hunt
+ + {authToken && ( +
+
|
+ + Enter Rooms -> + +
+ )} +
+
+ {authToken ? ( +
{ + localStorage.removeItem(AUTH_TOKEN) + this.props.history.push(`/`) + }} + > + logout +
+ ) : ( + + login + + )} +
+
+ ) + } +} + +export default withRouter(Header) \ No newline at end of file diff --git a/client/src/components/Login.js b/client/src/components/Login.js new file mode 100644 index 000000000..720919785 --- /dev/null +++ b/client/src/components/Login.js @@ -0,0 +1,65 @@ +import React, { Component } from "react"; +import { AUTH_TOKEN } from "../constants"; + +class Login extends Component { + state = { + login: true, // switch between Login and SignUp + email: "", + password: "", + name: "" + }; + + render() { + const { login, email, password, name } = this.state; + return ( +
+

{login ? "Login" : "Sign Up"}

+
+ {!login && ( + this.setState({ name: e.target.value })} + type="text" + placeholder="Your name" + /> + )} + this.setState({ email: e.target.value })} + type="text" + placeholder="Your email address" + /> + this.setState({ password: e.target.value })} + type="password" + placeholder="Choose a safe password" + /> +
+
+
this._confirm()}> + {login ? "login" : "create account"} +
+
this.setState({ login: !login })} + > + {login ? "need to create an account?" : "already have an account?"} +
+
+
+ ); + } + + _confirm = async () => { + // const { token } = this.state.login ? data.login : data.signup; + // this._saveUserData(token); + // this.props.history.push(`/`); + }; + + _saveUserData = token => { + localStorage.setItem(AUTH_TOKEN, token); + }; +} + +export default Login; diff --git a/client/src/constants.js b/client/src/constants.js new file mode 100644 index 000000000..cf47ddd08 --- /dev/null +++ b/client/src/constants.js @@ -0,0 +1 @@ +export const AUTH_TOKEN = 'auth-token' \ No newline at end of file diff --git a/client/src/index.js b/client/src/index.js index 87d1be551..4e594fed3 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -2,11 +2,16 @@ import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; -import * as serviceWorker from './serviceWorker'; -ReactDOM.render(, document.getElementById('root')); -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://bit.ly/CRA-PWA -serviceWorker.unregister(); +import { BrowserRouter } from 'react-router-dom' + + +ReactDOM.render( + + + + + , + document.getElementById('root'), +) diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 100644 index 000000000..0939216fc --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../loose-envify/cli.js" "$@" + ret=$? +else + node "$basedir/../loose-envify/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/loose-envify.cmd b/node_modules/.bin/loose-envify.cmd new file mode 100644 index 000000000..6238bbb20 --- /dev/null +++ b/node_modules/.bin/loose-envify.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\loose-envify\cli.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\loose-envify\cli.js" %* +) \ No newline at end of file diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity new file mode 100644 index 000000000..04c3cc03e --- /dev/null +++ b/node_modules/.yarn-integrity @@ -0,0 +1,55 @@ +{ + "systemParams": "win32-x64-64", + "modulesFolders": [ + "node_modules" + ], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [ + "apollo-boost@^0.4.3", + "graphql@^14.4.2", + "react-apollo@^2.5.8" + ], + "lockfileEntries": { + "@types/node@>=6": "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c", + "@types/zen-observable@^0.8.0": "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d", + "@wry/context@^0.4.0": "https://registry.yarnpkg.com/@wry/context/-/context-0.4.4.tgz#e50f5fa1d6cfaabf2977d1fda5ae91717f8815f8", + "@wry/equality@^0.1.2": "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.9.tgz#b13e18b7a8053c6858aa6c85b54911fb31e3a909", + "apollo-boost@^0.4.3": "https://registry.yarnpkg.com/apollo-boost/-/apollo-boost-0.4.3.tgz#107bd1dd0d349d8e363174ded69612a4aa823c8a", + "apollo-cache-inmemory@^1.6.2": "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.2.tgz#bbf2e4e1eacdf82b2d526f5c2f3b37e5acee3c5e", + "apollo-cache@1.3.2": "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.2.tgz#df4dce56240d6c95c613510d7e409f7214e6d26a", + "apollo-cache@^1.3.2": "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.2.tgz#df4dce56240d6c95c613510d7e409f7214e6d26a", + "apollo-client@^2.6.3": "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.6.3.tgz#9bb2d42fb59f1572e51417f341c5f743798d22db", + "apollo-link-error@^1.0.3": "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.11.tgz#7cd363179616fb90da7866cee85cb00ee45d2f3b", + "apollo-link-http-common@^0.2.14": "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.14.tgz#d3a195c12e00f4e311c417f121181dcc31f7d0c8", + "apollo-link-http@^1.3.1": "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.15.tgz#106ab23bb8997bd55965d05855736d33119652cf", + "apollo-link@^1.0.0": "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429", + "apollo-link@^1.0.6": "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429", + "apollo-link@^1.2.12": "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429", + "apollo-utilities@1.3.2": "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9", + "apollo-utilities@^1.3.0": "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9", + "apollo-utilities@^1.3.2": "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9", + "fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2", + "graphql-tag@^2.4.2": "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.1.tgz#10aa41f1cd8fae5373eaf11f1f67260a3cad5e02", + "graphql@^14.4.2": "https://registry.yarnpkg.com/graphql/-/graphql-14.4.2.tgz#553a7d546d524663eda49ed6df77577be3203ae3", + "hoist-non-react-statics@^3.3.0": "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b", + "iterall@^1.2.2": "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7", + "js-tokens@^3.0.0 || ^4.0.0": "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499", + "lodash.isequal@^4.5.0": "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0", + "loose-envify@^1.4.0": "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf", + "object-assign@^4.1.1": "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863", + "optimism@^0.9.0": "https://registry.yarnpkg.com/optimism/-/optimism-0.9.6.tgz#5621195486b294c3bfc518d17ac47767234b029f", + "prop-types@^15.7.2": "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5", + "react-apollo@^2.5.8": "https://registry.yarnpkg.com/react-apollo/-/react-apollo-2.5.8.tgz#c7a593b027efeefdd8399885e0ac6bec3b32623c", + "react-is@^16.7.0": "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16", + "react-is@^16.8.1": "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16", + "symbol-observable@^1.0.2": "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804", + "ts-invariant@^0.4.0": "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86", + "ts-invariant@^0.4.2": "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86", + "tslib@^1.9.3": "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a", + "zen-observable-ts@^0.8.19": "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.19.tgz#c094cd20e83ddb02a11144a6e2a89706946b5694", + "zen-observable@^0.8.0": "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.14.tgz#d33058359d335bc0db1f0af66158b32872af3bf7" + }, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE new file mode 100644 index 000000000..21071075c --- /dev/null +++ b/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md new file mode 100644 index 000000000..b05af4fd2 --- /dev/null +++ b/node_modules/@types/node/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (http://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node + +Additional Details + * Last updated: Wed, 17 Jul 2019 19:14:44 GMT + * Dependencies: none + * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout + +# Credits +These definitions were written by Microsoft TypeScript , DefinitelyTyped , Alberto Schiabel , Alexander T. , Alvis HT Tang , Andrew Makarov , Benjamin Toueg , Bruno Scheufler , Chigozirim C. , Christian Vaagland Tellnes , David Junger , Deividas Bakanas , Eugene Y. Q. Shen , Flarna , Hannes Magnusson , Hoàng Văn Khải , Huw , Kelvin Jin , Klaus Meinhardt , Lishude , Mariusz Wiktorczyk , Matthieu Sieben , Mohsen Azimi , Nicolas Even , Nicolas Voigt , Parambir Singh , Sebastian Silbermann , Simon Schick , Thomas den Hollander , Wilco Bakker , wwwy3y3 , Zane Hannan AU , Samuel Ainsworth , Kyle Uehlein , Jordi Oliveras Rovira , and Thanik Bhongbhibhat . diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts new file mode 100644 index 000000000..319e5b4d4 --- /dev/null +++ b/node_modules/@types/node/assert.d.ts @@ -0,0 +1,52 @@ +declare module "assert" { + function internal(value: any, message?: string | Error): void; + namespace internal { + class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + code: 'ERR_ASSERTION'; + + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFn?: Function + }); + } + + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never; + function ok(value: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use strictEqual() instead. */ + function equal(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */ + function notEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */ + function deepEqual(actual: any, expected: any, message?: string | Error): void; + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */ + function notDeepEqual(actual: any, expected: any, message?: string | Error): void; + function strictEqual(actual: any, expected: any, message?: string | Error): void; + function notStrictEqual(actual: any, expected: any, message?: string | Error): void; + function deepStrictEqual(actual: any, expected: any, message?: string | Error): void; + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; + + function throws(block: () => any, message?: string | Error): void; + function throws(block: () => any, error: RegExp | Function | Object | Error, message?: string | Error): void; + function doesNotThrow(block: () => any, message?: string | Error): void; + function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void; + + function ifError(value: any): void; + + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects(block: (() => Promise) | Promise, error: RegExp | Function | Object | Error, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, error: RegExp | Function, message?: string | Error): Promise; + + const strict: typeof internal; + } + + export = internal; +} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts new file mode 100644 index 000000000..cca992ec3 --- /dev/null +++ b/node_modules/@types/node/async_hooks.d.ts @@ -0,0 +1,132 @@ +/** + * Async Hooks module: https://nodejs.org/api/async_hooks.html + */ +declare module "async_hooks" { + /** + * Returns the asyncId of the current execution context. + */ + function executionAsyncId(): number; + + /** + * Returns the ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void; + + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + + /** + * Registers functions to be called for different lifetime events of each async operation. + * @param options the callbacks to register + * @return an AsyncHooks instance used for disabling and enabling hooks + */ + function createHook(options: HookCallbacks): AsyncHook; + + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * Default: `executionAsyncId()` + */ + triggerAsyncId?: number; + + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * Default: `false` + */ + requireManualDestroy?: boolean; + } + + /** + * The class AsyncResource was designed to be extended by the embedder's async resources. + * Using this users can easily trigger the lifetime events of their own resources. + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since 9.3) + */ + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions); + + /** + * Call the provided function with the provided arguments in the + * execution context of the async resource. This will establish the + * context, trigger the AsyncHooks before callbacks, call the function, + * trigger the AsyncHooks after callbacks, and then restore the original + * execution context. + * @param fn The function to call in the execution context of this + * async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + + /** + * Call AsyncHooks destroy callbacks. + */ + emitDestroy(): void; + + /** + * @return the unique ID assigned to this AsyncResource instance. + */ + asyncId(): number; + + /** + * @return the trigger ID for this AsyncResource instance. + */ + triggerAsyncId(): number; + } +} diff --git a/node_modules/@types/node/base.d.ts b/node_modules/@types/node/base.d.ts new file mode 100644 index 000000000..70983d951 --- /dev/null +++ b/node_modules/@types/node/base.d.ts @@ -0,0 +1,41 @@ +// base definnitions for all NodeJS modules that are not specific to any version of TypeScript +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts new file mode 100644 index 000000000..7eb1061b5 --- /dev/null +++ b/node_modules/@types/node/buffer.d.ts @@ -0,0 +1,22 @@ +declare module "buffer" { + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + const BuffType: typeof Buffer; + + export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary"; + + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + + export const SlowBuffer: { + /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */ + new(size: number): Buffer; + prototype: Buffer; + }; + + export { BuffType as Buffer }; +} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts new file mode 100644 index 000000000..412258d8b --- /dev/null +++ b/node_modules/@types/node/child_process.d.ts @@ -0,0 +1,370 @@ +declare module "child_process" { + import * as events from "events"; + import * as net from "net"; + import { Writable, Readable, Stream, Pipe } from "stream"; + + interface ChildProcess extends events.EventEmitter { + stdin: Writable | null; + stdout: Readable | null; + stderr: Readable | null; + readonly channel?: Pipe | null; + readonly stdio: [ + Writable | null, // stdin + Readable | null, // stdout + Readable | null, // stderr + Readable | Writable | null | undefined, // extra + Readable | Writable | null | undefined // extra + ]; + readonly killed: boolean; + readonly pid: number; + readonly connected: boolean; + kill(signal?: string): void; + send(message: any, callback?: (error: Error | null) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error | null) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (code: number, signal: string) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", code: number, signal: string): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number | null, signal: string | null): boolean; + emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (code: number, signal: string) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number | null, signal: string | null) => void): this; + on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (code: number, signal: string) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number | null, signal: string | null) => void): this; + once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (code: number, signal: string) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + } + + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, // stdin + Readable, // stdout + Readable, // stderr + Readable | Writable | null | undefined, // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + + interface MessageOptions { + keepOpen?: boolean; + } + + type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>; + + interface ProcessEnvOptions { + uid?: number; + gid?: number; + cwd?: string; + env?: NodeJS.ProcessEnv; + } + + interface CommonOptions extends ProcessEnvOptions { + /** + * @default true + */ + windowsHide?: boolean; + /** + * @default 0 + */ + timeout?: number; + } + + interface SpawnOptions extends CommonOptions { + argv0?: string; + stdio?: StdioOptions; + detached?: boolean; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + } + + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: 'pipe' | Array; + } + + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, options: SpawnOptions): ChildProcess; + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + + interface ExecOptions extends CommonOptions { + shell?: string; + maxBuffer?: number; + killSignal?: string; + } + + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string | null; // specify `null`. + } + + interface ExecException extends Error { + cmd?: string; + killed?: boolean; + code?: number; + signal?: string; + } + + // no `options` definitely means stdout/stderr are `string`. + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: ({ encoding?: string | null } & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + interface ExecFileOptions extends CommonOptions { + maxBuffer?: number; + killSignal?: string; + windowsVerbatimArguments?: boolean; + shell?: boolean | string; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: string; + } + + function execFile(file: string): ChildProcess; + function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void, + ): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: Error | null, stdout: string, stderr: string) => void, + ): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile( + file: string, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void, + ): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, + callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, + callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, + ): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: string[] | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; + function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; + function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + function __promisify__( + file: string, + args: string[] | undefined | null, + options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, + ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + interface ForkOptions extends ProcessEnvOptions { + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: StdioOptions; + detached?: boolean; + windowsVerbatimArguments?: boolean; + } + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + + interface SpawnSyncOptions extends CommonOptions { + argv0?: string; // Not specified in the docs + input?: string | NodeJS.TypedArray | DataView; + stdio?: StdioOptions; + killSignal?: string | number; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number | null; + signal: string | null; + error?: Error; + } + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + + interface ExecSyncOptions extends CommonOptions { + input?: string | Uint8Array; + stdio?: StdioOptions; + shell?: string; + killSignal?: string | number; + maxBuffer?: number; + encoding?: string; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + function execSync(command: string): Buffer; + function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): Buffer; + + interface ExecFileSyncOptions extends CommonOptions { + input?: string | NodeJS.TypedArray | DataView; + stdio?: StdioOptions; + killSignal?: string | number; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + function execFileSync(command: string): Buffer; + function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; +} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts new file mode 100644 index 000000000..43340ff80 --- /dev/null +++ b/node_modules/@types/node/cluster.d.ts @@ -0,0 +1,260 @@ +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + import * as net from "net"; + + // interfaces + interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + inspectPort?: number | (() => number); + } + + interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + class Worker extends events.EventEmitter { + id: number; + process: child.ChildProcess; + send(message: any, sendHandle?: any, callback?: (error: Error | null) => void): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "listening", address: Address): boolean; + emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + interface Cluster extends events.EventEmitter { + Worker: Worker; + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + // TODO: cluster.schedulingPolicy + settings: ClusterSettings; + setupMaster(settings?: ClusterSettings): void; + worker?: Worker; + workers?: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect", worker: Worker): boolean; + emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + emit(event: "fork", worker: Worker): boolean; + emit(event: "listening", worker: Worker, address: Address): boolean; + emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online", worker: Worker): boolean; + emit(event: "setup", settings: ClusterSettings): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: ClusterSettings) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: ClusterSettings) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; + } + + function disconnect(callback?: () => void): void; + function fork(env?: any): Worker; + const isMaster: boolean; + const isWorker: boolean; + // TODO: cluster.schedulingPolicy + const settings: ClusterSettings; + function setupMaster(settings?: ClusterSettings): void; + const worker: Worker; + const workers: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + function addListener(event: string, listener: (...args: any[]) => void): Cluster; + function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function emit(event: string | symbol, ...args: any[]): boolean; + function emit(event: "disconnect", worker: Worker): boolean; + function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + function emit(event: "fork", worker: Worker): boolean; + function emit(event: "listening", worker: Worker, address: Address): boolean; + function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + function emit(event: "online", worker: Worker): boolean; + function emit(event: "setup", settings: ClusterSettings): boolean; + + function on(event: string, listener: (...args: any[]) => void): Cluster; + function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function on(event: "fork", listener: (worker: Worker) => void): Cluster; + function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + function on(event: "online", listener: (worker: Worker) => void): Cluster; + function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function once(event: string, listener: (...args: any[]) => void): Cluster; + function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function once(event: "fork", listener: (worker: Worker) => void): Cluster; + function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + function once(event: "online", listener: (worker: Worker) => void): Cluster; + function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function removeListener(event: string, listener: (...args: any[]) => void): Cluster; + function removeAllListeners(event?: string): Cluster; + function setMaxListeners(n: number): Cluster; + function getMaxListeners(): number; + function listeners(event: string): Function[]; + function listenerCount(type: string): number; + + function prependListener(event: string, listener: (...args: any[]) => void): Cluster; + function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; + function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + // the handle is a net.Socket or net.Server object, or undefined. + function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; + function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; + + function eventNames(): string[]; +} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts new file mode 100644 index 000000000..d30d13f87 --- /dev/null +++ b/node_modules/@types/node/console.d.ts @@ -0,0 +1,3 @@ +declare module "console" { + export = console; +} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts new file mode 100644 index 000000000..577860f38 --- /dev/null +++ b/node_modules/@types/node/constants.d.ts @@ -0,0 +1,278 @@ +declare module "constants" { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + const SIGHUP: number; + const SIGINT: number; + const SIGILL: number; + const SIGABRT: number; + const SIGFPE: number; + const SIGKILL: number; + const SIGSEGV: number; + const SIGTERM: number; + const SIGBREAK: number; + const SIGWINCH: number; + const SSL_OP_ALL: number; + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + const SSL_OP_CISCO_ANYCONNECT: number; + const SSL_OP_COOKIE_EXCHANGE: number; + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + const SSL_OP_EPHEMERAL_RSA: number; + const SSL_OP_LEGACY_SERVER_CONNECT: number; + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + const SSL_OP_MICROSOFT_SESS_ID_BUG: number; + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + const SSL_OP_NETSCAPE_CA_DN_BUG: number; + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + const SSL_OP_PKCS1_CHECK_1: number; + const SSL_OP_PKCS1_CHECK_2: number; + const SSL_OP_SINGLE_DH_USE: number; + const SSL_OP_SINGLE_ECDH_USE: number; + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + const SSL_OP_TLS_BLOCK_PADDING_BUG: number; + const SSL_OP_TLS_D5_BUG: number; + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_ECDH: number; + const ENGINE_METHOD_ECDSA: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_STORE: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + const O_RDONLY: number; + const O_WRONLY: number; + const O_RDWR: number; + const S_IFMT: number; + const S_IFREG: number; + const S_IFDIR: number; + const S_IFCHR: number; + const S_IFBLK: number; + const S_IFIFO: number; + const S_IFSOCK: number; + const S_IRWXU: number; + const S_IRUSR: number; + const S_IWUSR: number; + const S_IXUSR: number; + const S_IRWXG: number; + const S_IRGRP: number; + const S_IWGRP: number; + const S_IXGRP: number; + const S_IRWXO: number; + const S_IROTH: number; + const S_IWOTH: number; + const S_IXOTH: number; + const S_IFLNK: number; + const O_CREAT: number; + const O_EXCL: number; + const O_NOCTTY: number; + const O_DIRECTORY: number; + const O_NOATIME: number; + const O_NOFOLLOW: number; + const O_SYNC: number; + const O_DSYNC: number; + const O_SYMLINK: number; + const O_DIRECT: number; + const O_NONBLOCK: number; + const O_TRUNC: number; + const O_APPEND: number; + const F_OK: number; + const R_OK: number; + const W_OK: number; + const X_OK: number; + const COPYFILE_EXCL: number; + const COPYFILE_FICLONE: number; + const COPYFILE_FICLONE_FORCE: number; + const UV_UDP_REUSEADDR: number; + const SIGQUIT: number; + const SIGTRAP: number; + const SIGIOT: number; + const SIGBUS: number; + const SIGUSR1: number; + const SIGUSR2: number; + const SIGPIPE: number; + const SIGALRM: number; + const SIGCHLD: number; + const SIGSTKFLT: number; + const SIGCONT: number; + const SIGSTOP: number; + const SIGTSTP: number; + const SIGTTIN: number; + const SIGTTOU: number; + const SIGURG: number; + const SIGXCPU: number; + const SIGXFSZ: number; + const SIGVTALRM: number; + const SIGPROF: number; + const SIGIO: number; + const SIGPOLL: number; + const SIGPWR: number; + const SIGSYS: number; + const SIGUNUSED: number; + const defaultCoreCipherList: string; + const defaultCipherList: string; + const ENGINE_METHOD_RSA: number; + const ALPN_ENABLED: number; +} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts new file mode 100644 index 000000000..3394d43a2 --- /dev/null +++ b/node_modules/@types/node/crypto.d.ts @@ -0,0 +1,602 @@ +declare module "crypto" { + import * as stream from "stream"; + + interface Certificate { + exportChallenge(spkac: BinaryLike): Buffer; + exportPublicKey(spkac: BinaryLike): Buffer; + verifySpkac(spkac: Binary): boolean; + } + const Certificate: { + new(): Certificate; + (): Certificate; + }; + + namespace constants { // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants + const OPENSSL_VERSION_NUMBER: number; + + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ + const SSL_OP_EPHEMERAL_RSA: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + const SSL_OP_MICROSOFT_SESS_ID_BUG: number; + /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ + const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + const SSL_OP_NETSCAPE_CA_DN_BUG: number; + const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + const SSL_OP_PKCS1_CHECK_1: number; + const SSL_OP_PKCS1_CHECK_2: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ + const SSL_OP_SINGLE_DH_USE: number; + /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ + const SSL_OP_SINGLE_ECDH_USE: number; + const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + const SSL_OP_TLS_BLOCK_PADDING_BUG: number; + const SSL_OP_TLS_D5_BUG: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + + const ALPN_ENABLED: number; + + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + + /** @deprecated since v10.0.0 */ + const fips: boolean; + + function createHash(algorithm: string, options?: stream.TransformOptions): Hash; + function createHmac(algorithm: string, key: BinaryLike, options?: stream.TransformOptions): Hmac; + + type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; + type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; + type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; + type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + + class Hash extends stream.Duplex { + private constructor(); + update(data: BinaryLike): Hash; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + class Hmac extends stream.Duplex { + private constructor(); + update(data: BinaryLike): Hmac; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + + export type KeyObjectType = 'secret' | 'public' | 'private'; + + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string; + passphrase?: string | Buffer; + } + + class KeyObject { + private constructor(); + asymmetricKeyType?: KeyType; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number; + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + symmetricSize?: number; + type: KeyObjectType; + } + + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + + type Binary = NodeJS.TypedArray | DataView; + type BinaryLike = string | Binary; + + type CipherKey = BinaryLike | KeyObject; + + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number; + } + /** @deprecated since v10.0.0 use createCipheriv() */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + + function createCipheriv( + algorithm: CipherCCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options: CipherCCMOptions + ): CipherCCM; + function createCipheriv( + algorithm: CipherGCMTypes, + key: CipherKey, + iv: BinaryLike | null, + options?: CipherGCMOptions + ): CipherGCM; + function createCipheriv( + algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions + ): Cipher; + + class Cipher extends stream.Duplex { + private constructor(); + update(data: BinaryLike): Buffer; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; + update(data: Binary, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + // getAuthTag(): Buffer; + // setAAD(buffer: Buffer): this; // docs only say buffer + } + interface CipherCCM extends Cipher { + setAAD(buffer: Buffer, options: { plaintextLength: number }): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD(buffer: Buffer, options?: { plaintextLength: number }): this; + getAuthTag(): Buffer; + } + /** @deprecated since v10.0.0 use createCipheriv() */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use createCipheriv() */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + + function createDecipheriv( + algorithm: CipherCCMTypes, + key: BinaryLike, + iv: BinaryLike | null, + options: CipherCCMOptions, + ): DecipherCCM; + function createDecipheriv( + algorithm: CipherGCMTypes, + key: BinaryLike, + iv: BinaryLike | null, + options?: CipherGCMOptions, + ): DecipherGCM; + function createDecipheriv(algorithm: string, key: BinaryLike, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; + + class Decipher extends stream.Duplex { + private constructor(); + update(data: Binary): Buffer; + update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; + update(data: Binary, input_encoding: undefined, output_encoding: Utf8AsciiBinaryEncoding): string; + update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + // setAuthTag(tag: Binary): this; + // setAAD(buffer: Binary): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: Binary): this; + setAAD(buffer: Binary, options: { plaintextLength: number }): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: Binary): this; + setAAD(buffer: Binary, options?: { plaintextLength: number }): this; + } + + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat; + type?: 'pkcs1' | 'pkcs8' | 'sec1'; + passphrase?: string | Buffer; + } + + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat; + type?: 'pkcs1' | 'spki'; + } + + function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject; + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject; + function createSecretKey(key: Buffer): KeyObject; + + function createSign(algorithm: string, options?: stream.WritableOptions): Signer; + + interface SigningOptions { + /** + * @See crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number; + saltLength?: number; + } + + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions { + } + + type KeyLike = string | Buffer | KeyObject; + + class Signer extends stream.Writable { + private constructor(); + + update(data: BinaryLike): Signer; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer; + sign(private_key: SignPrivateKeyInput | KeyLike): Buffer; + sign(private_key: SignPrivateKeyInput | KeyLike, output_format: HexBase64Latin1Encoding): string; + } + + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + class Verify extends stream.Writable { + private constructor(); + + update(data: BinaryLike): Verify; + update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify; + verify(object: Object | KeyLike, signature: Binary): boolean; + verify(object: Object | KeyLike, signature: string, signature_format?: HexBase64Latin1Encoding): boolean; + // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format + // The signature field accepts a TypedArray type, but it is only available starting ES2017 + } + function createDiffieHellman(prime_length: number, generator?: number | Binary): DiffieHellman; + function createDiffieHellman(prime: Binary): DiffieHellman; + function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; + function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Binary): DiffieHellman; + function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; + class DiffieHellman { + private constructor(); + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: Binary): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: Binary, output_encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrime(): Buffer; + getPrime(encoding: HexBase64Latin1Encoding): string; + getGenerator(): Buffer; + getGenerator(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + setPublicKey(public_key: Binary): void; + setPublicKey(public_key: string, encoding: string): void; + setPrivateKey(private_key: Binary): void; + setPrivateKey(private_key: string, encoding: string): void; + verifyError: number; + } + function getDiffieHellman(group_name: string): DiffieHellman; + function pbkdf2( + password: BinaryLike, + salt: BinaryLike, + iterations: number, + keylen: number, + digest: string, + callback: (err: Error | null, derivedKey: Buffer) => any, + ): void; + function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; + + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + + function randomFillSync(buffer: T, offset?: number, size?: number): T; + function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + + interface ScryptOptions { + N?: number; + r?: number; + p?: number; + maxmem?: number; + } + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void, + ): void; + function scrypt( + password: BinaryLike, + salt: BinaryLike, + keylen: number, + options: ScryptOptions, + callback: (err: Error | null, derivedKey: Buffer) => void, + ): void; + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + + interface RsaPublicKey { + key: KeyLike; + padding?: number; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string; + padding?: number; + } + function publicEncrypt(public_key: RsaPublicKey | KeyLike, buffer: Binary): Buffer; + function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: Binary): Buffer; + function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: Binary): Buffer; + function publicDecrypt(public_key: RsaPublicKey | KeyLike, buffer: Binary): Buffer; + function getCiphers(): string[]; + function getCurves(): string[]; + function getHashes(): string[]; + class ECDH { + private constructor(); + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: HexBase64Latin1Encoding, + outputEncoding?: "latin1" | "hex" | "base64", + format?: "uncompressed" | "compressed" | "hybrid", + ): Buffer | string; + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; + computeSecret(other_public_key: Binary): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: Binary, output_encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; + setPrivateKey(private_key: Binary): void; + setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; + } + function createECDH(curve_name: string): ECDH; + function timingSafeEqual(a: Binary, b: Binary): boolean; + /** @deprecated since v10.0.0 */ + const DEFAULT_ENCODING: string; + + export type KeyType = 'rsa' | 'dsa' | 'ec'; + export type KeyFormat = 'pem' | 'der'; + + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string; + passphrase?: string; + } + + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + } + + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + + /** + * @default 0x10001 + */ + publicExponent?: number; + } + + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + + /** + * Size of q in bits + */ + divisorLength: number; + } + + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * @default 0x10001 + */ + publicExponent?: number; + + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + + namespace generateKeyPair { + function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; + function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; + function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; + function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; + function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; + + function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; + function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; + function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; + function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; + function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; + + function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; + function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; + function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; + function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; + function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; + } + + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been + * passed to [`crypto.createPrivateKey()`][]. + */ + function sign(algorithm: string | null | undefined, data: Binary, key: KeyLike | SignPrivateKeyInput): Buffer; + + interface VerifyKeyWithOptions extends KeyObject, SigningOptions { + } + + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been + * passed to [`crypto.createPublicKey()`][]. + */ + function verify(algorithm: string | null | undefined, data: Binary, key: KeyLike | VerifyKeyWithOptions, signature: Binary): Buffer; +} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts new file mode 100644 index 000000000..c42acdfa7 --- /dev/null +++ b/node_modules/@types/node/dgram.d.ts @@ -0,0 +1,102 @@ +declare module "dgram" { + import { AddressInfo } from "net"; + import * as dns from "dns"; + import * as events from "events"; + + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + + interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + type SocketType = "udp4" | "udp6"; + + interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + /** + * @default false + */ + ipv6Only?: boolean; + recvBufferSize?: number; + sendBufferSize?: number; + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + } + + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + class Socket extends events.EventEmitter { + send(msg: string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; + bind(port?: number, callback?: () => void): void; + bind(callback?: () => void): void; + bind(options: BindOptions, callback?: () => void): void; + close(callback?: () => void): void; + address(): AddressInfo | string; + setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; + setMulticastTTL(ttl: number): void; + setMulticastInterface(multicastInterface: string): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): this; + unref(): this; + setRecvBufferSize(size: number): void; + setSendBufferSize(size: number): void; + getRecvBufferSize(): number; + getSendBufferSize(): number; + + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + } +} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts new file mode 100644 index 000000000..879d69053 --- /dev/null +++ b/node_modules/@types/node/dns.d.ts @@ -0,0 +1,366 @@ +declare module "dns" { + // Supported getaddrinfo flags. + const ADDRCONFIG: number; + const V4MAPPED: number; + + interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + verbatim?: boolean; + } + + interface LookupOneOptions extends LookupOptions { + all?: false; + } + + interface LookupAllOptions extends LookupOptions { + all: true; + } + + interface LookupAddress { + address: string; + family: number; + } + + function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>; + function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>; + } + + function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + + namespace lookupService { + function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>; + } + + interface ResolveOptions { + ttl: boolean; + } + + interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + interface RecordWithTtl { + address: string; + ttl: number; + } + + /** @deprecated Use AnyARecord or AnyAaaaRecord instead. */ + type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + + interface AnyARecord extends RecordWithTtl { + type: "A"; + } + + interface AnyAaaaRecord extends RecordWithTtl { + type: "AAAA"; + } + + interface MxRecord { + priority: number; + exchange: string; + } + + interface AnyMxRecord extends MxRecord { + type: "MX"; + } + + interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + interface AnyNaptrRecord extends NaptrRecord { + type: "NAPTR"; + } + + interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + interface AnySoaRecord extends SoaRecord { + type: "SOA"; + } + + interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + interface AnySrvRecord extends SrvRecord { + type: "SRV"; + } + + interface AnyTxtRecord { + type: "TXT"; + entries: string[]; + } + + interface AnyNsRecord { + type: "NS"; + value: string; + } + + interface AnyPtrRecord { + type: "PTR"; + value: string; + } + + interface AnyCnameRecord { + type: "CNAME"; + value: string; + } + + type AnyRecord = AnyARecord | + AnyAaaaRecord | + AnyCnameRecord | + AnyMxRecord | + AnyNaptrRecord | + AnyNsRecord | + AnyPtrRecord | + AnySoaRecord | + AnySrvRecord | + AnyTxtRecord; + + function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void, + ): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace resolve { + function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + function __promisify__(hostname: string, rrtype: "ANY"): Promise; + function __promisify__(hostname: string, rrtype: "MX"): Promise; + function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + function __promisify__(hostname: string, rrtype: "SOA"): Promise; + function __promisify__(hostname: string, rrtype: "SRV"): Promise; + function __promisify__(hostname: string, rrtype: "TXT"): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + + function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + + function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + + function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + + function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + + function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + + function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + + function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + + function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + + function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + + function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + function setServers(servers: ReadonlyArray): void; + function getServers(): string[]; + + // Error codes + const NODATA: string; + const FORMERR: string; + const SERVFAIL: string; + const NOTFOUND: string; + const NOTIMP: string; + const REFUSED: string; + const BADQUERY: string; + const BADNAME: string; + const BADFAMILY: string; + const BADRESP: string; + const CONNREFUSED: string; + const TIMEOUT: string; + const EOF: string; + const FILE: string; + const NOMEM: string; + const DESTRUCTION: string; + const BADSTR: string; + const BADFLAGS: string; + const NONAME: string; + const BADHINTS: string; + const NOTINITIALIZED: string; + const LOADIPHLPAPI: string; + const ADDRGETNETWORKPARAMS: string; + const CANCELLED: string; + + class Resolver { + getServers: typeof getServers; + setServers: typeof setServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + cancel(): void; + } + + namespace promises { + function getServers(): string[]; + + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + + function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>; + + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: "A"): Promise; + function resolve(hostname: string, rrtype: "AAAA"): Promise; + function resolve(hostname: string, rrtype: "ANY"): Promise; + function resolve(hostname: string, rrtype: "CNAME"): Promise; + function resolve(hostname: string, rrtype: "MX"): Promise; + function resolve(hostname: string, rrtype: "NAPTR"): Promise; + function resolve(hostname: string, rrtype: "NS"): Promise; + function resolve(hostname: string, rrtype: "PTR"): Promise; + function resolve(hostname: string, rrtype: "SOA"): Promise; + function resolve(hostname: string, rrtype: "SRV"): Promise; + function resolve(hostname: string, rrtype: "TXT"): Promise; + function resolve(hostname: string, rrtype: string): Promise; + + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + + function resolveAny(hostname: string): Promise; + + function resolveCname(hostname: string): Promise; + + function resolveMx(hostname: string): Promise; + + function resolveNaptr(hostname: string): Promise; + + function resolveNs(hostname: string): Promise; + + function resolvePtr(hostname: string): Promise; + + function resolveSoa(hostname: string): Promise; + + function resolveSrv(hostname: string): Promise; + + function resolveTxt(hostname: string): Promise; + + function reverse(ip: string): Promise; + + function setServers(servers: ReadonlyArray): void; + + class Resolver { + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setServers: typeof setServers; + } + } +} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts new file mode 100644 index 000000000..45e388c46 --- /dev/null +++ b/node_modules/@types/node/domain.d.ts @@ -0,0 +1,16 @@ +declare module "domain" { + import * as events from "events"; + + class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: (...args: any[]) => T, ...args: any[]): T; + add(emitter: events.EventEmitter | NodeJS.Timer): void; + remove(emitter: events.EventEmitter | NodeJS.Timer): void; + bind(cb: T): T; + intercept(cb: T): T; + members: Array; + enter(): void; + exit(): void; + } + + function create(): Domain; +} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts new file mode 100644 index 000000000..f86102101 --- /dev/null +++ b/node_modules/@types/node/events.d.ts @@ -0,0 +1,30 @@ +declare module "events" { + class internal extends NodeJS.EventEmitter { } + + namespace internal { + function once(emitter: EventEmitter, event: string | symbol): Promise; + class EventEmitter extends internal { + /** @deprecated since v4.0.0 */ + static listenerCount(emitter: EventEmitter, event: string | symbol): number; + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + } + } + + export = internal; +} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts new file mode 100644 index 000000000..bc015cec0 --- /dev/null +++ b/node_modules/@types/node/fs.d.ts @@ -0,0 +1,2297 @@ +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + import { URL } from "url"; + + /** + * Valid types for path values in "fs". + */ + type PathLike = string | Buffer | URL; + + type BinaryData = DataView | NodeJS.TypedArray; + class Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + class Dirent { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + name: string; + } + + interface FSWatcher extends events.EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (error: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (error: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + } + + class ReadStream extends stream.Readable { + close(): void; + bytesRead: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + class WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function renameSync(oldPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + + /** + * Synchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncateSync(path: PathLike, len?: number | null): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + + /** + * Synchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function ftruncateSync(fd: number, len?: number | null): void; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + + /** + * Synchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function fchownSync(fd: number, uid: number, gid: number): void; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: string | number): Promise; + } + + /** + * Synchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmodSync(fd: number, mode: string | number): void; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function statSync(path: PathLike): Stats; + + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function fstatSync(fd: number): Stats; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstatSync(path: PathLike): Stats; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function linkSync(existingPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + + type Type = "dir" | "file" | "junction"; + } + + /** + * Synchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink( + path: PathLike, + options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, linkString: string) => void + ): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath( + path: PathLike, + options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void + ): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + function native( + path: PathLike, + options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void + ): void; + function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + namespace realpathSync { + function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + } + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlinkSync(path: PathLike): void; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdirSync(path: PathLike): void; + + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * @default false + */ + recursive?: boolean; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777. + */ + mode?: number; + } + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise; + } + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdirSync(path: PathLike, options?: number | string | MakeDirectoryOptions | null): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, + ): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer", callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: { encoding?: string | null; withFileTypes?: false } | string | undefined | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, + ): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise; + } + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdirSync(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): string[] | Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdirSync(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Dirent[]; + + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function close(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function closeSync(fd: number): void; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise; + } + + /** + * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function fsync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function fsyncSync(fd: number): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write( + fd: number, + string: any, + position: number | undefined | null, + encoding: string | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, + ): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + */ + function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null, + ): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + } + + /** + * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function writeSync(fd: number, buffer: BinaryData, offset?: number | null, length?: number | null, position?: number | null): number; + + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number; + + /** + * Asynchronously reads data from the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, + ): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + } + + /** + * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function readSync(fd: number, buffer: BinaryData, offset: number, length: number, position: number | null): number; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | number, + options: { encoding?: string | null; flag?: string; } | string | undefined | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, + ): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. + */ + function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer; + + type WriteFileOptions = { encoding?: string | null; mode?: number | string; flag?: string; } | string | null; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | number, data: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathLike | number, data: any, options?: WriteFileOptions): Promise; + } + + /** + * Synchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFileSync(path: PathLike | number, data: any, options?: WriteFileOptions): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(file: PathLike | number, data: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathLike | number, data: any, options?: WriteFileOptions): Promise; + } + + /** + * Synchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFileSync(file: PathLike | number, data: any, options?: WriteFileOptions): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + */ + function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Stop watching for changes on `filename`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch( + filename: PathLike, + options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, + listener?: (event: string, filename: string) => void, + ): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch( + filename: PathLike, + options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null, + listener?: (event: string, filename: string | Buffer) => void, + ): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher; + + /** + * Asynchronously tests whether or not the given path exists by checking with the file system. + * @deprecated + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function exists(path: PathLike, callback: (exists: boolean) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronously tests whether or not the given path exists by checking with the file system. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function existsSync(path: PathLike): boolean; + + namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + + // File Copy Constants + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException | null) => void): void; + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + + /** + * Synchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function accessSync(path: PathLike, mode?: number): void; + + /** + * Returns a new `ReadStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function createReadStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + }): ReadStream; + + /** + * Returns a new `WriteStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function createWriteStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + highWaterMark?: number; + }): WriteStream; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function fdatasyncSync(fd: number): void; + + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + */ + function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException | null) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + namespace copyFile { + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. + * The only supported flag is fs.constants.COPYFILE_EXCL, + * which causes the copy operation to fail if dest already exists. + */ + function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; + } + + /** + * Synchronously copies src to dest. By default, dest is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. + * The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; + + namespace promises { + interface FileHandle { + /** + * Gets the file descriptor for this file handle. + */ + readonly fd: number; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for appending. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + */ + chown(uid: number, gid: number): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + chmod(mode: string | number): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + */ + datasync(): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + */ + sync(): Promise; + + /** + * Asynchronously reads data from the file. + * The `FileHandle` must have been opened for reading. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + */ + stat(): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param len If not specified, defaults to `0`. + */ + truncate(len?: number): Promise; + + /** + * Asynchronously change file timestamps of the file. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + utimes(atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously writes `buffer` to the file. + * The `FileHandle` must have been opened for writing. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous close(2) - close a `FileHandle`. + */ + close(): Promise; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode?: number): Promise; + + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only + * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if + * `dest` already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not + * supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode?: string | number): Promise; + + /** + * Asynchronously reads data from the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If + * `null`, data will be read from the current position. + */ + function read( + handle: FileHandle, + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null, + ): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write( + handle: FileHandle, + buffer: TBuffer, + offset?: number | null, + length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` + * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len?: number): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param handle A `FileHandle`. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(handle: FileHandle, len?: number): Promise; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param handle A `FileHandle`. + */ + function fdatasync(handle: FileHandle): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param handle A `FileHandle`. + */ + function fsync(handle: FileHandle): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + * @param handle A `FileHandle`. + */ + function fstat(handle: FileHandle): Promise; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike): Promise; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike): Promise; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param handle A `FileHandle`. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(handle: FileHandle, mode: string | number): Promise; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param handle A `FileHandle`. + */ + function fchown(handle: FileHandle, uid: number, gid: number): Promise; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + } +} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts new file mode 100644 index 000000000..5de9e98fa --- /dev/null +++ b/node_modules/@types/node/globals.d.ts @@ -0,0 +1,1180 @@ +// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build +interface Console { + Console: NodeJS.ConsoleConstructor; + /** + * A simple assertion test that verifies whether `value` is truthy. + * If it is not, an `AssertionError` is thrown. + * If provided, the error `message` is formatted using `util.format()` and used as the error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. + * When `stdout` is not a TTY, this method does nothing. + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link console.log()}. + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + */ + dir(obj: any, options?: NodeJS.InspectOptions): void; + /** + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by two spaces. + * If one or more `label`s are provided, those are printed first without the additional indentation. + */ + group(...label: any[]): void; + /** + * The `console.groupCollapsed()` function is an alias for {@link console.group()}. + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by two spaces. + */ + groupEnd(): void; + /** + * The {@link console.info()} function is an alias for {@link console.log()}. + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * This method does not display anything unless used in the inspector. + * Prints to `stdout` the array `array` formatted as a table. + */ + table(tabularData: any, properties?: string[]): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`. + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The {@link console.warn()} function is an alias for {@link console.error()}. + */ + warn(message?: any, ...optionalParams: any[]): void; + + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * The console.markTimeline() method is the deprecated form of console.timeStamp(). + * + * @deprecated Use console.timeStamp() instead. + */ + markTimeline(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * The console.timeline() method is the deprecated form of console.time(). + * + * @deprecated Use console.time() instead. + */ + timeline(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * The console.timelineEnd() method is the deprecated form of console.timeEnd(). + * + * @deprecated Use console.timeEnd() instead. + */ + timelineEnd(label?: string): void; +} + +interface Error { + stack?: string; +} + +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + */ + prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; + + stackTraceLimit: number; +} + +interface SymbolConstructor { + readonly observable: symbol; +} + +// Node.js ESNEXT support +interface String { + /** Removes whitespace from the left end of a string. */ + trimLeft(): string; + /** Removes whitespace from the right end of a string. */ + trimRight(): string; +} + +interface ImportMeta { + url: string; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; +declare namespace setTimeout { + function __promisify__(ms: number): Promise; + function __promisify__(ms: number, value: T): Promise; +} +declare function clearTimeout(timeoutId: NodeJS.Timeout): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; +declare function clearInterval(intervalId: NodeJS.Timeout): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; +declare namespace setImmediate { + function __promisify__(): Promise; + function __promisify__(value: T): Promise; +} +declare function clearImmediate(immediateId: NodeJS.Immediate): void; + +/** + * @experimental + */ +declare function queueMicrotask(callback: () => void): void; + +// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version. +interface NodeRequireFunction { + /* tslint:disable-next-line:callable-types */ + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve: RequireResolve; + cache: any; + /** + * @deprecated + */ + extensions: NodeExtensions; + main: NodeModule | undefined; +} + +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + +interface NodeExtensions { + '.js': (m: NodeModule, filename: string) => any; + '.json': (m: NodeModule, filename: string) => any; + '.node': (m: NodeModule, filename: string) => any; + [ext: string]: (m: NodeModule, filename: string) => any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: NodeModule | null; + children: NodeModule[]; + paths: string[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; + +interface Buffer { + constructor: typeof Buffer; +} + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare class Buffer extends Uint8Array { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + constructor(str: string, encoding?: BufferEncoding); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + constructor(size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + constructor(array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + constructor(array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + constructor(buffer: Buffer); + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer() + */ + static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + static from(data: number[]): Buffer; + static from(data: Uint8Array): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + static from(str: string, encoding?: BufferEncoding): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + static of(...items: number[]): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength( + string: string | NodeJS.TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, + encoding?: BufferEncoding + ): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Uint8Array[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Uint8Array, buf2: Uint8Array): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + /** + * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. + */ + static poolSize: number; + + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer'; data: number[] }; + equals(otherBuffer: Uint8Array): boolean; + compare( + otherBuffer: Uint8Array, + targetStart?: number, + targetEnd?: number, + sourceStart?: number, + sourceEnd?: number + ): number; + copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices. + * + * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory. + * + * @param begin Where the new `Buffer` will start. Default: `0`. + * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. + */ + slice(begin?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices. + * + * This method is compatible with `Uint8Array#subarray()`. + * + * @param begin Where the new `Buffer` will start. Default: `0`. + * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. + */ + subarray(begin?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number): number; + writeUIntBE(value: number, offset: number, byteLength: number): number; + writeIntLE(value: number, offset: number, byteLength: number): number; + writeIntBE(value: number, offset: number, byteLength: number): number; + readUIntLE(offset: number, byteLength: number): number; + readUIntBE(offset: number, byteLength: number): number; + readIntLE(offset: number, byteLength: number): number; + readIntBE(offset: number, byteLength: number): number; + readUInt8(offset: number): number; + readUInt16LE(offset: number): number; + readUInt16BE(offset: number): number; + readUInt32LE(offset: number): number; + readUInt32BE(offset: number): number; + readInt8(offset: number): number; + readInt16LE(offset: number): number; + readInt16BE(offset: number): number; + readInt32LE(offset: number): number; + readInt32BE(offset: number): number; + readFloatLE(offset: number): number; + readFloatBE(offset: number): number; + readDoubleLE(offset: number): number; + readDoubleBE(offset: number): number; + reverse(): this; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number): number; + writeUInt16LE(value: number, offset: number): number; + writeUInt16BE(value: number, offset: number): number; + writeUInt32LE(value: number, offset: number): number; + writeUInt32BE(value: number, offset: number): number; + writeInt8(value: number, offset: number): number; + writeInt16LE(value: number, offset: number): number; + writeInt16BE(value: number, offset: number): number; + writeInt32LE(value: number, offset: number): number; + writeInt32BE(value: number, offset: number): number; + writeFloatLE(value: number, offset: number): number; + writeFloatBE(value: number, offset: number): number; + writeDoubleLE(value: number, offset: number): number; + writeDoubleBE(value: number, offset: number): number; + + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface InspectOptions { + /** + * If set to `true`, getters are going to be + * inspected as well. If set to `'get'` only getters without setter are going + * to be inspected. If set to `'set'` only getters having a corresponding + * setter are going to be inspected. This might cause side effects depending on + * the getter function. + * @default `false` + */ + getters?: 'get' | 'set' | boolean; + showHidden?: boolean; + /** + * @default 2 + */ + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + breakLength?: number; + /** + * Setting this to `false` causes each object key + * to be displayed on a new line. It will also add new lines to text that is + * longer than `breakLength`. If set to a number, the most `n` inner elements + * are united on a single line as long as all properties fit into + * `breakLength`. Short array elements are also grouped together. Note that no + * text will be reduced below 16 characters, no matter the `breakLength` size. + * For more information, see the example below. + * @default `true` + */ + compact?: boolean | number; + sorted?: boolean | ((a: string, b: string) => number); + } + + interface ConsoleConstructorOptions { + stdout: WritableStream; + stderr?: WritableStream; + ignoreErrors?: boolean; + colorMode?: boolean | 'auto'; + inspectOptions?: InspectOptions; + } + + interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console; + new(options: ConsoleConstructorOptions): Console; + } + + interface CallSite { + /** + * Value of "this" + */ + getThis(): any; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + class EventEmitter { + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(type: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + eventNames(): Array; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): void; + end(data: string | Uint8Array, cb?: () => void): void; + end(str: string, encoding?: string, cb?: () => void): void; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface Events extends EventEmitter { } + + interface Domain extends Events { + run(fn: (...args: any[]) => T, ...args: any[]): T; + add(emitter: EventEmitter | Timer): void; + remove(emitter: EventEmitter | Timer): void; + bind(cb: T): T; + intercept(cb: T): T; + + addListener(event: string, listener: (...args: any[]) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + removeListener(event: string, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string): this; + } + + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + } + + interface CpuUsage { + user: number; + system: number; + } + + interface ProcessRelease { + name: string; + sourceUrl?: string; + headersUrl?: string; + libUrl?: string; + lts?: string; + } + + interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32' + | 'cygwin'; + + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; + + type MultipleResolveType = 'resolve' | 'reject'; + + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error) => void; + type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: any, sendHandle: any) => void; + type SignalsListener = (signal: Signals) => void; + type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: any) => void; + + interface Socket extends ReadWriteStream { + isTTY?: true; + } + + interface ProcessEnv { + [key: string]: string | undefined; + } + + interface WriteStream extends Socket { + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + columns?: number; + rows?: number; + _write(chunk: any, encoding: string, callback: (err?: null | Error) => void): void; + _destroy(err: Error | null, callback: (err?: null | Error) => void): void; + _final(callback: (err?: null | Error) => void): void; + setDefaultEncoding(encoding: string): this; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + } + interface ReadStream extends Socket { + readonly readableHighWaterMark: number; + readonly readableLength: number; + isRaw?: boolean; + setRawMode?(mode: boolean): void; + _read(size: number): void; + _destroy(err: Error | null, callback: (err?: null | Error) => void): void; + push(chunk: any, encoding?: string): boolean; + destroy(error?: Error): void; + } + + interface HRTime { + (time?: [number, number]): [number, number]; + } + + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @defaul false + */ + reportOnSignal: boolean; + + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + + interface Process extends EventEmitter { + /** + * Can also be a tty.WriteStream, not typed due to limitation.s + */ + stdout: WriteStream; + /** + * Can also be a tty.WriteStream, not typed due to limitation.s + */ + stderr: WriteStream; + stdin: ReadStream; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + debugPort: number; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; + env: ProcessEnv; + exit(code?: number): never; + exitCode?: number; + getgid(): number; + setgid(id: number | string): void; + getuid(): number; + setuid(id: number | string): void; + geteuid(): number; + seteuid(id: number | string): void; + getegid(): number; + setegid(id: number | string): void; + getgroups(): number[]; + setgroups(groups: Array): void; + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + hasUncaughtExceptionCaptureCallback(): boolean; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): void; + pid: number; + ppid: number; + title: string; + arch: string; + platform: Platform; + mainModule?: NodeModule; + memoryUsage(): MemoryUsage; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * Can only be set if not in worker thread. + */ + umask(mask?: number): number; + uptime(): number; + hrtime: HRTime; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean; + disconnect(): void; + connected: boolean; + + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][] + * environment variable. + */ + allowedNodeEnvironmentFlags: ReadonlySet; + + /** + * Only available with `--experimental-report` + */ + report?: ProcessReport; + + resourceUsage(): ResourceUsage; + + /** + * EventEmitter + * 1. beforeExit + * 2. disconnect + * 3. exit + * 4. message + * 5. rejectionHandled + * 6. uncaughtException + * 7. unhandledRejection + * 8. warning + * 9. message + * 10. + * 11. newListener/removeListener inherited from EventEmitter + */ + addListener(event: "beforeExit", listener: BeforeExitListener): this; + addListener(event: "disconnect", listener: DisconnectListener): this; + addListener(event: "exit", listener: ExitListener): this; + addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + addListener(event: "warning", listener: WarningListener): this; + addListener(event: "message", listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: "newListener", listener: NewListenerListener): this; + addListener(event: "removeListener", listener: RemoveListenerListener): this; + addListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals, signal: Signals): boolean; + emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; + emit(event: "multipleResolves", listener: MultipleResolveListener): this; + + on(event: "beforeExit", listener: BeforeExitListener): this; + on(event: "disconnect", listener: DisconnectListener): this; + on(event: "exit", listener: ExitListener): this; + on(event: "rejectionHandled", listener: RejectionHandledListener): this; + on(event: "uncaughtException", listener: UncaughtExceptionListener): this; + on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + on(event: "warning", listener: WarningListener): this; + on(event: "message", listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: "newListener", listener: NewListenerListener): this; + on(event: "removeListener", listener: RemoveListenerListener): this; + on(event: "multipleResolves", listener: MultipleResolveListener): this; + + once(event: "beforeExit", listener: BeforeExitListener): this; + once(event: "disconnect", listener: DisconnectListener): this; + once(event: "exit", listener: ExitListener): this; + once(event: "rejectionHandled", listener: RejectionHandledListener): this; + once(event: "uncaughtException", listener: UncaughtExceptionListener): this; + once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + once(event: "warning", listener: WarningListener): this; + once(event: "message", listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: "newListener", listener: NewListenerListener): this; + once(event: "removeListener", listener: RemoveListenerListener): this; + once(event: "multipleResolves", listener: MultipleResolveListener): this; + + prependListener(event: "beforeExit", listener: BeforeExitListener): this; + prependListener(event: "disconnect", listener: DisconnectListener): this; + prependListener(event: "exit", listener: ExitListener): this; + prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependListener(event: "warning", listener: WarningListener): this; + prependListener(event: "message", listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: "newListener", listener: NewListenerListener): this; + prependListener(event: "removeListener", listener: RemoveListenerListener): this; + prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; + prependOnceListener(event: "disconnect", listener: DisconnectListener): this; + prependOnceListener(event: "exit", listener: ExitListener): this; + prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependOnceListener(event: "warning", listener: WarningListener): this; + prependOnceListener(event: "message", listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: "newListener", listener: NewListenerListener): this; + prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; + prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; + + listeners(event: "beforeExit"): BeforeExitListener[]; + listeners(event: "disconnect"): DisconnectListener[]; + listeners(event: "exit"): ExitListener[]; + listeners(event: "rejectionHandled"): RejectionHandledListener[]; + listeners(event: "uncaughtException"): UncaughtExceptionListener[]; + listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; + listeners(event: "warning"): WarningListener[]; + listeners(event: "message"): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: "newListener"): NewListenerListener[]; + listeners(event: "removeListener"): RemoveListenerListener[]; + listeners(event: "multipleResolves"): MultipleResolveListener[]; + } + + interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: Immediate) => void; + clearInterval: (intervalId: Timeout) => void; + clearTimeout: (timeoutId: Timeout) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout; + queueMicrotask: typeof queueMicrotask; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + // compatibility with older typings + interface Timer { + hasRef(): boolean; + ref(): this; + refresh(): this; + unref(): this; + } + + class Immediate { + hasRef(): boolean; + ref(): this; + unref(): this; + _onImmediate: Function; // to distinguish it from the Timeout class + } + + class Timeout implements Timer { + hasRef(): boolean; + ref(): this; + refresh(): this; + unref(): this; + } + + class Module { + static runMain(): void; + static wrap(code: string): string; + static createRequireFromPath(path: string): (path: string) => any; + static builtinModules: string[]; + + static Module: typeof Module; + + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: Module | null; + children: Module[]; + paths: string[]; + + constructor(id: string, parent?: Module); + } + + type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; +} diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts new file mode 100644 index 000000000..31175d76b --- /dev/null +++ b/node_modules/@types/node/http.d.ts @@ -0,0 +1,279 @@ +declare module "http" { + import * as events from "events"; + import * as stream from "stream"; + import { URL } from "url"; + import { Socket, Server as NetServer } from "net"; + + // incoming headers will never contain number + interface IncomingHttpHeaders { + 'accept'?: string; + 'accept-language'?: string; + 'accept-patch'?: string; + 'accept-ranges'?: string; + 'access-control-allow-credentials'?: string; + 'access-control-allow-headers'?: string; + 'access-control-allow-methods'?: string; + 'access-control-allow-origin'?: string; + 'access-control-expose-headers'?: string; + 'access-control-max-age'?: string; + 'age'?: string; + 'allow'?: string; + 'alt-svc'?: string; + 'authorization'?: string; + 'cache-control'?: string; + 'connection'?: string; + 'content-disposition'?: string; + 'content-encoding'?: string; + 'content-language'?: string; + 'content-length'?: string; + 'content-location'?: string; + 'content-range'?: string; + 'content-type'?: string; + 'cookie'?: string; + 'date'?: string; + 'expect'?: string; + 'expires'?: string; + 'forwarded'?: string; + 'from'?: string; + 'host'?: string; + 'if-match'?: string; + 'if-modified-since'?: string; + 'if-none-match'?: string; + 'if-unmodified-since'?: string; + 'last-modified'?: string; + 'location'?: string; + 'pragma'?: string; + 'proxy-authenticate'?: string; + 'proxy-authorization'?: string; + 'public-key-pins'?: string; + 'range'?: string; + 'referer'?: string; + 'retry-after'?: string; + 'set-cookie'?: string[]; + 'strict-transport-security'?: string; + 'tk'?: string; + 'trailer'?: string; + 'transfer-encoding'?: string; + 'upgrade'?: string; + 'user-agent'?: string; + 'vary'?: string; + 'via'?: string; + 'warning'?: string; + 'www-authenticate'?: string; + [header: string]: string | string[] | undefined; + } + + // outgoing headers allows numbers (as they are converted internally to strings) + interface OutgoingHttpHeaders { + [header: string]: number | string | string[] | undefined; + } + + interface ClientRequestArgs { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number | string; + defaultPort?: number | string; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: OutgoingHttpHeaders; + auth?: string; + agent?: Agent | boolean; + _defaultAgent?: Agent; + timeout?: number; + setHost?: boolean; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket; + } + + interface ServerOptions { + IncomingMessage?: typeof IncomingMessage; + ServerResponse?: typeof ServerResponse; + } + + type RequestListener = (req: IncomingMessage, res: ServerResponse) => void; + + class Server extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @default 2000 + * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount} + */ + maxHeadersCount: number | null; + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP headers. + * @default 40000 + * {@link https://nodejs.org/api/http.html#http_server_headerstimeout} + */ + headersTimeout: number; + keepAliveTimeout: number; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js + class OutgoingMessage extends stream.Writable { + upgrading: boolean; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + finished: boolean; + headersSent: boolean; + connection: Socket; + + constructor(); + + setTimeout(msecs: number, callback?: () => void): this; + setHeader(name: string, value: number | string | string[]): void; + getHeader(name: string): number | string | string[] | undefined; + getHeaders(): OutgoingHttpHeaders; + getHeaderNames(): string[]; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void; + flushHeaders(): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 + class ServerResponse extends OutgoingMessage { + statusCode: number; + statusMessage: string; + + constructor(req: IncomingMessage); + + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 + // no args in writeContinue callback + writeContinue(callback?: () => void): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 + class ClientRequest extends OutgoingMessage { + connection: Socket; + socket: Socket; + aborted: number; + + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + + readonly path: string; + abort(): void; + onSocket(socket: Socket): void; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + } + + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + complete: boolean; + connection: Socket; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + trailers: { [key: string]: string | undefined }; + rawTrailers: string[]; + setTimeout(msecs: number, callback: () => void): this; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: Socket; + destroy(error?: Error): void; + } + + interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number; + } + + class Agent { + maxFreeSockets: number; + maxSockets: number; + readonly sockets: { + readonly [key: string]: Socket[]; + }; + readonly requests: { + readonly [key: string]: IncomingMessage[]; + }; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + const METHODS: string[]; + + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + + function createServer(requestListener?: RequestListener): Server; + function createServer(options: ServerOptions, requestListener?: RequestListener): Server; + + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs { } + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + let globalAgent: Agent; + + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 8KB. Configurable using the [`--max-http-header-size`][] CLI option. + */ + const maxHeaderSize: number; +} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts new file mode 100644 index 000000000..9b474c556 --- /dev/null +++ b/node_modules/@types/node/http2.d.ts @@ -0,0 +1,960 @@ +declare module "http2" { + import * as events from "events"; + import * as fs from "fs"; + import * as net from "net"; + import * as stream from "stream"; + import * as tls from "tls"; + import * as url from "url"; + + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from "http"; + export { OutgoingHttpHeaders } from "http"; + + export interface IncomingHttpStatusHeader { + ":status"?: number; + } + + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ":path"?: string; + ":method"?: string; + ":authority"?: string; + ":scheme"?: string; + } + + // Http2Stream + + export interface StreamPriorityOptions { + exclusive?: boolean; + parent?: number; + weight?: number; + silent?: boolean; + } + + export interface StreamState { + localWindowSize?: number; + state?: number; + localClose?: number; + remoteClose?: number; + sumDependencyWeight?: number; + weight?: number; + } + + export interface ServerStreamResponseOptions { + endStream?: boolean; + waitForTrailers?: boolean; + } + + export interface StatOptions { + offset: number; + length: number; + } + + export interface ServerStreamFileResponseOptions { + statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean; + waitForTrailers?: boolean; + offset?: number; + length?: number; + } + + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?: (err: NodeJS.ErrnoException) => void; + } + + export class Http2Stream extends stream.Duplex { + protected constructor(); + + readonly aborted: boolean; + readonly bufferSize: number; + readonly closed: boolean; + readonly destroyed: boolean; + /** + * Set the true if the END_STREAM flag was set in the request or response HEADERS frame received, + * indicating that no additional data should be received and the readable side of the Http2Stream will be closed. + */ + readonly endAfterHeaders: boolean; + readonly id?: number; + readonly pending: boolean; + readonly rstCode: number; + readonly sentHeaders: OutgoingHttpHeaders; + readonly sentInfoHeaders?: OutgoingHttpHeaders[]; + readonly sentTrailers?: OutgoingHttpHeaders; + readonly session: Http2Session; + readonly state: StreamState; + + close(code?: number, callback?: () => void): void; + priority(options: StreamPriorityOptions): void; + setTimeout(msecs: number, callback?: () => void): void; + sendTrailers(headers: OutgoingHttpHeaders): void; + + addListener(event: "aborted", listener: () => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: "streamClosed", listener: (code: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "wantTrailers", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "aborted"): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "frameError", frameType: number, errorCode: number): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: "streamClosed", code: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "wantTrailers"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "aborted", listener: () => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: "streamClosed", listener: (code: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "wantTrailers", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "aborted", listener: () => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: "streamClosed", listener: (code: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "wantTrailers", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "aborted", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "streamClosed", listener: (code: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "wantTrailers", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "aborted", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "wantTrailers", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class ClientHttp2Stream extends Http2Stream { + private constructor(); + + addListener(event: "continue", listener: () => {}): this; + addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "continue"): boolean; + emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "continue", listener: () => {}): this; + on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "continue", listener: () => {}): this; + once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "continue", listener: () => {}): this; + prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "continue", listener: () => {}): this; + prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class ServerHttp2Stream extends Http2Stream { + private constructor(); + + additionalHeaders(headers: OutgoingHttpHeaders): void; + readonly headersSent: boolean; + readonly pushAllowed: boolean; + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + + // Http2Session + + export interface Settings { + headerTableSize?: number; + enablePush?: boolean; + initialWindowSize?: number; + maxFrameSize?: number; + maxConcurrentStreams?: number; + maxHeaderListSize?: number; + enableConnectProtocol?: boolean; + } + + export interface ClientSessionRequestOptions { + endStream?: boolean; + exclusive?: boolean; + parent?: number; + weight?: number; + waitForTrailers?: boolean; + } + + export interface SessionState { + effectiveLocalWindowSize?: number; + effectiveRecvDataLength?: number; + nextStreamID?: number; + localWindowSize?: number; + lastProcStreamID?: number; + remoteWindowSize?: number; + outboundQueueSize?: number; + deflateDynamicTableSize?: number; + inflateDynamicTableSize?: number; + } + + export class Http2Session extends events.EventEmitter { + protected constructor(); + + readonly alpnProtocol?: string; + close(callback?: () => void): void; + readonly closed: boolean; + readonly connecting: boolean; + destroy(error?: Error, code?: number): void; + readonly destroyed: boolean; + readonly encrypted?: boolean; + goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void; + readonly localSettings: Settings; + readonly originSet?: string[]; + readonly pendingSettingsAck: boolean; + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: Buffer | DataView | NodeJS.TypedArray , callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ref(): void; + readonly remoteSettings: Settings; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + readonly state: SessionState; + settings(settings: Settings): void; + readonly type: number; + unref(): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: "localSettings", listener: (settings: Settings) => void): this; + addListener(event: "ping", listener: () => void): this; + addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; + emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: "localSettings", settings: Settings): boolean; + emit(event: "ping"): boolean; + emit(event: "remoteSettings", settings: Settings): boolean; + emit(event: "timeout"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: "localSettings", listener: (settings: Settings) => void): this; + on(event: "ping", listener: () => void): this; + on(event: "remoteSettings", listener: (settings: Settings) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: "localSettings", listener: (settings: Settings) => void): this; + once(event: "ping", listener: () => void): this; + once(event: "remoteSettings", listener: (settings: Settings) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependListener(event: "ping", listener: () => void): this; + prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "ping", listener: () => void): this; + prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class ClientHttp2Session extends Http2Session { + private constructor(); + + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + + addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: "origin", listener: (origins: string[]) => void): this; + addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; + emit(event: "origin", origins: string[]): boolean; + emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + on(event: "origin", listener: (origins: string[]) => void): this; + on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + once(event: "origin", listener: (origins: string[]) => void): this; + once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: "origin", listener: (origins: string[]) => void): this; + prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; + prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + + export class ServerHttp2Session extends Http2Session { + private constructor(); + + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + origin(...args: Array): void; + readonly server: Http2Server | Http2SecureServer; + + addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + // Http2Server + + export interface SessionOptions { + maxDeflateDynamicTableSize?: number; + maxSessionMemory?: number; + maxHeaderListPairs?: number; + maxOutstandingPings?: number; + maxSendHeaderBlockLength?: number; + paddingStrategy?: number; + peerMaxConcurrentStreams?: number; + selectPadding?: (frameLen: number, maxFrameLen: number) => number; + settings?: Settings; + createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex; + } + + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number; + createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex; + } + + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage; + Http1ServerResponse?: typeof ServerResponse; + Http2ServerRequest?: typeof Http2ServerRequest; + Http2ServerResponse?: typeof Http2ServerResponse; + } + + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } + + export interface ServerOptions extends ServerSessionOptions { } + + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean; + origins?: string[]; + } + + export class Http2Server extends net.Server { + private constructor(); + + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "session", session: ServerHttp2Session): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "session", listener: (session: ServerHttp2Session) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "session", listener: (session: ServerHttp2Session) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + setTimeout(msec?: number, callback?: () => void): this; + } + + export class Http2SecureServer extends tls.Server { + private constructor(); + + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "session", session: ServerHttp2Session): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "session", listener: (session: ServerHttp2Session) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "session", listener: (session: ServerHttp2Session) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + setTimeout(msec?: number, callback?: () => void): this; + } + + export class Http2ServerRequest extends stream.Readable { + private constructor(); + + readonly aborted: boolean; + readonly authority: string; + readonly headers: IncomingHttpHeaders; + readonly httpVersion: string; + readonly method: string; + readonly rawHeaders: string[]; + readonly rawTrailers: string[]; + readonly scheme: string; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + readonly stream: ServerHttp2Stream; + readonly trailers: IncomingHttpHeaders; + readonly url: string; + + read(size?: number): Buffer | string | null; + + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "aborted", hadError: boolean, code: number): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + export class Http2ServerResponse extends stream.Stream { + private constructor(); + + addTrailers(trailers: OutgoingHttpHeaders): void; + readonly connection: net.Socket | tls.TLSSocket; + end(callback?: () => void): void; + end(data: string | Uint8Array, callback?: () => void): void; + end(data: string | Uint8Array, encoding: string, callback?: () => void): void; + readonly finished: boolean; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(): OutgoingHttpHeaders; + hasHeader(name: string): boolean; + readonly headersSent: boolean; + removeHeader(name: string): void; + sendDate: boolean; + setHeader(name: string, value: number | string | string[]): void; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + statusCode: number; + statusMessage: ''; + readonly stream: ServerHttp2Stream; + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean; + writeContinue(): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + // Public API + + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + + export function getDefaultSettings(): Settings; + export function getPackedSettings(settings: Settings): Buffer; + export function getUnpackedSettings(buf: Uint8Array): Settings; + + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + + export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void, + ): ClientHttp2Session; +} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts new file mode 100644 index 000000000..6f33dbd04 --- /dev/null +++ b/node_modules/@types/node/https.d.ts @@ -0,0 +1,53 @@ +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + import { URL } from "url"; + + type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + + type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { + rejectUnauthorized?: boolean; // Defaults to true + servername?: string; // SNI TLS Extension + }; + + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean; + maxCachedSessions?: number; + } + + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + + class Server extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor(options: ServerOptions, requestListener?: http.RequestListener); + + setTimeout(callback: () => void): this; + setTimeout(msecs?: number, callback?: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @default 2000 + * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount} + */ + maxHeadersCount: number | null; + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP headers. + * @default 40000 + * {@link https://nodejs.org/api/http.html#http_server_headerstimeout} + */ + headersTimeout: number; + keepAliveTimeout: number; + } + + function createServer(requestListener?: http.RequestListener): Server; + function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + let globalAgent: Agent; +} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts new file mode 100644 index 000000000..582274110 --- /dev/null +++ b/node_modules/@types/node/index.d.ts @@ -0,0 +1,99 @@ +// Type definitions for non-npm package Node.js 12.6 +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Alberto Schiabel +// Alexander T. +// Alvis HT Tang +// Andrew Makarov +// Benjamin Toueg +// Bruno Scheufler +// Chigozirim C. +// Christian Vaagland Tellnes +// David Junger +// Deividas Bakanas +// Eugene Y. Q. Shen +// Flarna +// Hannes Magnusson +// Hoàng Văn Khải +// Huw +// Kelvin Jin +// Klaus Meinhardt +// Lishude +// Mariusz Wiktorczyk +// Matthieu Sieben +// Mohsen Azimi +// Nicolas Even +// Nicolas Voigt +// Parambir Singh +// Sebastian Silbermann +// Simon Schick +// Thomas den Hollander +// Wilco Bakker +// wwwy3y3 +// Zane Hannan AU +// Samuel Ainsworth +// Kyle Uehlein +// Jordi Oliveras Rovira +// Thanik Bhongbhibhat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// NOTE: These definitions support NodeJS and TypeScript 3.2. + +// NOTE: TypeScript version-specific augmentations can be found in the following paths: +// - ~/base.d.ts - Shared definitions common to all TypeScript versions +// - ~/index.d.ts - Definitions specific to TypeScript 2.1 +// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 + +// NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides +// within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions +// prior to TypeScript 3.2, so the older definitions will be found here. + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// + +// TypeScript 2.1-specific augmentations: + +// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`) +// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files +// just to ensure the names are known and node typings can be sued without importing these libs. +// if someone really needs these types the libs need to be added via --lib or in tsconfig.json +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } +interface Set {} +interface Map {} +interface ReadonlySet {} +interface IteratorResult { } +interface Iterable { } +interface AsyncIterable { } +interface Iterator { + next(value?: any): IteratorResult; +} +interface IterableIterator { } +interface AsyncIterableIterator {} +interface SymbolConstructor { + readonly iterator: symbol; + readonly asyncIterator: symbol; +} +declare var Symbol: SymbolConstructor; +// even this is just a forward declaration some properties are added otherwise +// it would be allowed to pass anything to e.g. Buffer.from() +interface SharedArrayBuffer { + readonly byteLength: number; + slice(begin?: number, end?: number): SharedArrayBuffer; +} + +declare module "util" { + namespace inspect { + const custom: symbol; + } + namespace promisify { + const custom: symbol; + } + namespace types { + function isBigInt64Array(value: any): boolean; + function isBigUint64Array(value: any): boolean; + } +} diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts new file mode 100644 index 000000000..8abee3951 --- /dev/null +++ b/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,3257 @@ +// tslint:disable-next-line:dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module "inspector" { + import { EventEmitter } from 'events'; + + interface InspectorNotification { + method: string; + params: T; + } + + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; + } + + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + + /** + * Call frame identifier. + */ + type CallFrameId = string; + + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * `this` object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For `global` and `with` scopes it represents the actual + * object; for the rest of the scopes, it is artificial transient object enumerating scope + * variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Location; + } + + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + interface BreakLocation { + /** + * Script identifier as reported in the `Debugger.scriptParsed`. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string; + } + + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles + * using `releaseObjectGroup`). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults + * to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause + * execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean; + /** + * Terminate execution after timing out (number of milliseconds). + * @experimental + */ + timeout?: Runtime.TimeDelta; + } + + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end + * of scripts is used as end of range. + */ + end?: Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async + * call stacks (default). + */ + maxDepth: number; + } + + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the + * breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or + * `urlRegex` must be specified. + */ + urlRegex?: string; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the + * breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + interface SetBreakpointOnFunctionCallParameterType { + /** + * Function object id. + */ + objectId: Runtime.RemoteObjectId; + /** + * Expression to use as a breakpoint condition. When specified, debugger will + * stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result + * description without actually modifying the code. + */ + dryRun?: boolean; + } + + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' + * scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled + * before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean; + } + + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + } + + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + + interface SetBreakpointOnFunctionCallReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + } + + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. + * This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId; + } + + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean; + /** + * This script length. + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + } + + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The + * default value is 32768 bytes. + */ + samplingInterval?: number; + } + + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken + * when the tracking is stopped. + */ + reportProgress?: boolean; + } + + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment + * index, the second integer is a total count of objects for the fragment, the third integer is + * a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + } + + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't + * optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[]; + } + + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the + * profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + /** + * Collect block-based coverage. + */ + detailed?: boolean; + } + + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + } + + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + + /** + * Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`, + * `-Infinity`, and bigint literals. + */ + type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for `object` type values only. + */ + subtype?: string; + /** + * Object class (constructor) name. Specified for `object` type values only. + */ + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have `value`, but gets this + * property. + */ + unserializableValue?: UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for `object` type values only. + * @experimental + */ + preview?: ObjectPreview; + /** + * @experimental + */ + customPreview?: CustomPreview; + } + + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId; + } + + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for `object` type values only. + */ + subtype?: string; + /** + * String representation of the object. + */ + description?: string; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for `map` and `set` subtype values only. + */ + entries?: EntryPreview[]; + } + + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview; + /** + * Object subtype hint. Specified for `object` type values only. + */ + subtype?: string; + } + + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean; + /** + * A function which serves as a getter for the property, or `undefined` if there is no getter + * (accessor descriptors only). + */ + get?: RemoteObject; + /** + * A function which serves as a setter for the property, or `undefined` if there is no setter + * (accessor descriptors only). + */ + set?: RemoteObject; + /** + * True if the type of this property descriptor may be changed and if the property may be + * deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding + * object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean; + /** + * Property symbol object, if the property is of the `symbol` type. + */ + symbol?: RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject; + } + + /** + * Represents function call argument. Either remote object id `objectId`, primitive `value`, + * unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId; + } + + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context + * script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; + } + + /** + * Detailed information about exception (or error) that was thrown during script compilation or + * execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace; + /** + * Exception object if available. + */ + exception?: RemoteObject; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId; + } + + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + + /** + * Number of milliseconds. + */ + type TimeDelta = number; + + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that + * initiated the async call. + */ + description?: string; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId; + } + + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + + /** + * If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This + * allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId; + } + + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + } + + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should + * be specified. + */ + objectId?: RemoteObjectId; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target + * object. + */ + arguments?: CallArgument[]; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause + * execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should `await` for resulting value and return once awaited promise is + * resolved. + */ + awaitPromise?: boolean; + /** + * Specifies execution context which global object will be used to call function on. Either + * executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not + * specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string; + } + + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the + * evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId; + } + + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause + * execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the + * evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean; + /** + * Whether execution should `await` for resulting value and return once awaited promise is + * resolved. + */ + awaitPromise?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + /** + * Terminate execution after timing out (number of milliseconds). + * @experimental + */ + timeout?: TimeDelta; + } + + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype + * chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not + * returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId; + } + + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + /** + * Symbolic group name that can be used to release the results. + */ + objectGroup?: string; + } + + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the + * evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause + * execution. Overrides `setPauseOnException` state. + */ + silent?: boolean; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + /** + * Whether execution should `await` for resulting value and return once awaited promise is + * resolved. + */ + awaitPromise?: boolean; + } + + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async + * call stacks (default). + */ + maxDepth: number; + } + + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + interface SetMaxCallStackSizeToCaptureParameterType { + size: number; + } + + interface AddBindingParameterType { + name: string; + executionContextId?: ExecutionContextId; + } + + interface RemoveBindingParameterType { + name: string; + } + + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails; + } + + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface GetIsolateIdReturnType { + /** + * The isolate id. + */ + id: string; + } + + interface GetHeapUsageReturnType { + /** + * Used heap size in bytes. + */ + usedSize: number; + /** + * Allocated heap size in bytes. + */ + totalSize: number; + } + + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[]; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails; + } + + interface BindingCalledEventDataType { + name: string; + payload: string; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + } + + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace; + /** + * Console context descriptor for calls on non-default console context (not console.*): + * 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call + * on named context. + * @experimental + */ + context?: string; + } + + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in `exceptionThrown`. + */ + exceptionId: number; + } + + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string; + /** + * Included category filters. + */ + includedCategories: string[]; + } + + interface StartParameterType { + traceConfig: TraceConfig; + } + + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + + namespace NodeWorker { + type WorkerID = string; + + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + + /** + * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + + /** + * Connects a session to the inspector back-end. + * An exception will be thrown if there is already a connected session established either + * through the API or by a front-end connected to the Inspector WebSocket port. + */ + connect(): void; + + /** + * Immediately close the session. All pending message callbacks will be called with an error. + * session.connect() will need to be called to be able to send messages again. + * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + + /** + * Posts a message to the inspector back-end. callback will be notified when a response is received. + * callback is a function that accepts two optional arguments - error and message-specific result. + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables console domain, sends the messages collected so far to the client by means of the + * `messageAdded` notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been + * enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be + * the same. + */ + post( + method: "Debugger.getPossibleBreakpoints", + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Returns stack trace with given `stackTraceId`. + * @experimental + */ + post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and + * Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled + * before next pause. Returns success when async task is actually scheduled, returns error if no + * task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in + * scripts with url matching one of the patterns. VM will try to leave blackboxed script by + * performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted + * scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * Positions array contains positions where blackbox state is changed. First interval isn't + * blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this + * command is issued, all existing parsed scripts will have breakpoints resolved and returned in + * `locations` property. Further matching script parsing will result in subsequent + * `breakpointResolved` events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Sets JavaScript breakpoint before each call to the given function. + * If another function was created from the same source as a given one, + * calling it will also trigger the breakpoint. + * @experimental + */ + post( + method: "Debugger.setBreakpointOnFunctionCall", + params?: Debugger.SetBreakpointOnFunctionCallParameterType, + callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void + ): void; + post(method: "Debugger.setBreakpointOnFunctionCall", callback?: (err: Error | null, params: Debugger.SetBreakpointOnFunctionCallReturnType) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or + * no exceptions. Initial pause on exceptions state is `none`. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be + * mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details + * $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post( + method: "HeapProfiler.getObjectByHeapObjectId", + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to + * garbage collection. + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code + * coverage may be incomplete. Enabling prevents running optimized code and resets execution + * counters. + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Enable type profile. + * @experimental + */ + post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows + * executing optimized code. + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code + * coverage needs to have started. + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect type profile. + * @experimental + */ + post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + + /** + * Calls function with given declaration on the given object. Object group of the result is + * inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of `executionContextCreated` event. + * When the reporting gets enabled the event will be sent immediately for each existing execution + * context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Returns the isolate id. + * @experimental + */ + post(method: "Runtime.getIsolateId", callback?: (err: Error | null, params: Runtime.GetIsolateIdReturnType) => void): void; + + /** + * Returns the JavaScript heap usage. + * It is the total usage of the corresponding isolate not scoped to a particular Runtime. + * @experimental + */ + post(method: "Runtime.getHeapUsage", callback?: (err: Error | null, params: Runtime.GetHeapUsageReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target + * object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: "Runtime.globalLexicalScopeNames", + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + + post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Runtime.setAsyncCallStackDepth", params?: Runtime.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setMaxCallStackSizeToCapture", params?: Runtime.SetMaxCallStackSizeToCaptureParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setMaxCallStackSizeToCapture", callback?: (err: Error | null) => void): void; + + /** + * Terminate current or next JavaScript execution. + * Will cancel the termination when the outer-most script execution ends. + * @experimental + */ + post(method: "Runtime.terminateExecution", callback?: (err: Error | null) => void): void; + + /** + * If executionContextId is empty, adds binding with the given name on the + * global objects of all inspected contexts, including those created later, + * bindings survive reloads. + * If executionContextId is specified, adds binding only on global object of + * given execution context. + * Binding function takes exactly one argument, this argument should be string, + * in case of any other input, function throws an exception. + * Each binding function call produces Runtime.bindingCalled notification. + * @experimental + */ + post(method: "Runtime.addBinding", params?: Runtime.AddBindingParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.addBinding", callback?: (err: Error | null) => void): void; + + /** + * This method does not remove binding function from global object but + * unsubscribes current runtime agent from Runtime.bindingCalled notifications. + * @experimental + */ + post(method: "Runtime.removeBinding", params?: Runtime.RemoveBindingParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.removeBinding", callback?: (err: Error | null) => void): void; + + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + + /** + * Gets supported tracing categories. + */ + post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + + /** + * Start trace events collection. + */ + post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void; + + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void; + + /** + * Sends protocol message over session with given id. + */ + post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void; + + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void; + + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void; + + // Events + + addListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected + * scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last + * seen object id and corresponding timestamp. If the were changes in the heap since last event + * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Notification is issued every time when binding is called. + * @experimental + */ + addListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API + * call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Runtime.bindingCalled", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; + emit(event: "NodeTracing.tracingComplete"): boolean; + emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; + emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected + * scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last + * seen object id and corresponding timestamp. If the were changes in the heap since last event + * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Notification is issued every time when binding is called. + * @experimental + */ + on(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API + * call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected + * scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last + * seen object id and corresponding timestamp. If the were changes in the heap since last event + * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Notification is issued every time when binding is called. + * @experimental + */ + once(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API + * call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected + * scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last + * seen object id and corresponding timestamp. If the were changes in the heap since last event + * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Notification is issued every time when binding is called. + * @experimental + */ + prependListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API + * call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected + * scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last + * seen object id and corresponding timestamp. If the were changes in the heap since last event + * then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + /** + * Notification is issued every time when binding is called. + * @experimental + */ + prependOnceListener(event: "Runtime.bindingCalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API + * call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; + + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; + + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; + + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; + } + + // Top Level API + + /** + * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. + * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. + * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Optional, defaults to false. + */ + function open(port?: number, host?: string, wait?: boolean): void; + + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + + /** + * Return the URL of the active inspector, or `undefined` if there is none. + */ + function url(): string | undefined; +} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts new file mode 100644 index 000000000..f512be7e5 --- /dev/null +++ b/node_modules/@types/node/module.d.ts @@ -0,0 +1,3 @@ +declare module "module" { + export = NodeJS.Module; +} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts new file mode 100644 index 000000000..c8bccb7b3 --- /dev/null +++ b/node_modules/@types/node/net.d.ts @@ -0,0 +1,249 @@ +declare module "net" { + import * as stream from "stream"; + import * as events from "events"; + import * as dns from "dns"; + + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + interface SocketConstructorOpts { + fd?: number; + allowHalfOpen?: boolean; + readable?: boolean; + writable?: boolean; + } + + interface TcpSocketConnectOpts { + port: number; + host?: string; + localAddress?: string; + localPort?: number; + hints?: number; + family?: number; + lookup?: LookupFunction; + } + + interface IpcSocketConnectOpts { + path: string; + } + + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + + // Extended base methods + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean; + + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + + setEncoding(encoding?: string): this; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): this; + setKeepAlive(enable?: boolean, initialDelay?: number): this; + address(): AddressInfo | string; + unref(): void; + ref(): void; + + readonly bufferSize: number; + readonly bytesRead: number; + readonly bytesWritten: number; + readonly connecting: boolean; + readonly destroyed: boolean; + readonly localAddress: string; + readonly localPort: number; + readonly remoteAddress?: string; + readonly remoteFamily?: string; + readonly remotePort?: number; + + // Extended base methods + end(cb?: () => void): void; + end(buffer: Uint8Array | string, cb?: () => void): void; + end(str: Uint8Array | string, encoding?: string, cb?: () => void): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + readableAll?: boolean; + writableAll?: boolean; + /** + * @default false + */ + ipv6Only?: boolean; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js + class Server extends events.EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void); + + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + close(callback?: (err?: Error) => void): this; + address(): AddressInfo | string | null; + getConnections(cb: (error: Error | null, count: number) => void): void; + ref(): this; + unref(): this; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + function isIP(input: string): number; + function isIPv4(input: string): boolean; + function isIPv6(input: string): boolean; +} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts new file mode 100644 index 000000000..4182e5074 --- /dev/null +++ b/node_modules/@types/node/os.d.ts @@ -0,0 +1,201 @@ +declare module "os" { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + + function hostname(): string; + function loadavg(): number[]; + function uptime(): number; + function freemem(): number; + function totalmem(): number; + function cpus(): CpuInfo[]; + function type(): string; + function release(): string; + function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + function homedir(): string; + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: string }): UserInfo; + const constants: { + UV_UDP_REUSEADDR: number; + signals: { + SIGHUP: number; + SIGINT: number; + SIGQUIT: number; + SIGILL: number; + SIGTRAP: number; + SIGABRT: number; + SIGIOT: number; + SIGBUS: number; + SIGFPE: number; + SIGKILL: number; + SIGUSR1: number; + SIGSEGV: number; + SIGUSR2: number; + SIGPIPE: number; + SIGALRM: number; + SIGTERM: number; + SIGCHLD: number; + SIGSTKFLT: number; + SIGCONT: number; + SIGSTOP: number; + SIGTSTP: number; + SIGTTIN: number; + SIGTTOU: number; + SIGURG: number; + SIGXCPU: number; + SIGXFSZ: number; + SIGVTALRM: number; + SIGPROF: number; + SIGWINCH: number; + SIGIO: number; + SIGPOLL: number; + SIGPWR: number; + SIGSYS: number; + SIGUNUSED: number; + }; + errno: { + E2BIG: number; + EACCES: number; + EADDRINUSE: number; + EADDRNOTAVAIL: number; + EAFNOSUPPORT: number; + EAGAIN: number; + EALREADY: number; + EBADF: number; + EBADMSG: number; + EBUSY: number; + ECANCELED: number; + ECHILD: number; + ECONNABORTED: number; + ECONNREFUSED: number; + ECONNRESET: number; + EDEADLK: number; + EDESTADDRREQ: number; + EDOM: number; + EDQUOT: number; + EEXIST: number; + EFAULT: number; + EFBIG: number; + EHOSTUNREACH: number; + EIDRM: number; + EILSEQ: number; + EINPROGRESS: number; + EINTR: number; + EINVAL: number; + EIO: number; + EISCONN: number; + EISDIR: number; + ELOOP: number; + EMFILE: number; + EMLINK: number; + EMSGSIZE: number; + EMULTIHOP: number; + ENAMETOOLONG: number; + ENETDOWN: number; + ENETRESET: number; + ENETUNREACH: number; + ENFILE: number; + ENOBUFS: number; + ENODATA: number; + ENODEV: number; + ENOENT: number; + ENOEXEC: number; + ENOLCK: number; + ENOLINK: number; + ENOMEM: number; + ENOMSG: number; + ENOPROTOOPT: number; + ENOSPC: number; + ENOSR: number; + ENOSTR: number; + ENOSYS: number; + ENOTCONN: number; + ENOTDIR: number; + ENOTEMPTY: number; + ENOTSOCK: number; + ENOTSUP: number; + ENOTTY: number; + ENXIO: number; + EOPNOTSUPP: number; + EOVERFLOW: number; + EPERM: number; + EPIPE: number; + EPROTO: number; + EPROTONOSUPPORT: number; + EPROTOTYPE: number; + ERANGE: number; + EROFS: number; + ESPIPE: number; + ESRCH: number; + ESTALE: number; + ETIME: number; + ETIMEDOUT: number; + ETXTBSY: number; + EWOULDBLOCK: number; + EXDEV: number; + }; + priority: { + PRIORITY_LOW: number; + PRIORITY_BELOW_NORMAL: number; + PRIORITY_NORMAL: number; + PRIORITY_ABOVE_NORMAL: number; + PRIORITY_HIGH: number; + PRIORITY_HIGHEST: number; + } + }; + function arch(): string; + function platform(): NodeJS.Platform; + function tmpdir(): string; + const EOL: string; + function endianness(): "BE" | "LE"; + /** + * Gets the priority of a process. + * Defaults to current process. + */ + function getPriority(pid?: number): number; + /** + * Sets the priority of the current process. + * @param priority Must be in range of -20 to 19 + */ + function setPriority(priority: number): void; + /** + * Sets the priority of the process specified process. + * @param priority Must be in range of -20 to 19 + */ + function setPriority(pid: number, priority: number): void; +} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json new file mode 100644 index 000000000..ad2bcae1a --- /dev/null +++ b/node_modules/@types/node/package.json @@ -0,0 +1,206 @@ +{ + "name": "@types/node", + "version": "12.6.8", + "description": "TypeScript definitions for Node.js", + "license": "MIT", + "contributors": [ + { + "name": "Microsoft TypeScript", + "url": "https://github.com/Microsoft", + "githubUsername": "Microsoft" + }, + { + "name": "DefinitelyTyped", + "url": "https://github.com/DefinitelyTyped", + "githubUsername": "DefinitelyTyped" + }, + { + "name": "Alberto Schiabel", + "url": "https://github.com/jkomyno", + "githubUsername": "jkomyno" + }, + { + "name": "Alexander T.", + "url": "https://github.com/a-tarasyuk", + "githubUsername": "a-tarasyuk" + }, + { + "name": "Alvis HT Tang", + "url": "https://github.com/alvis", + "githubUsername": "alvis" + }, + { + "name": "Andrew Makarov", + "url": "https://github.com/r3nya", + "githubUsername": "r3nya" + }, + { + "name": "Benjamin Toueg", + "url": "https://github.com/btoueg", + "githubUsername": "btoueg" + }, + { + "name": "Bruno Scheufler", + "url": "https://github.com/brunoscheufler", + "githubUsername": "brunoscheufler" + }, + { + "name": "Chigozirim C.", + "url": "https://github.com/smac89", + "githubUsername": "smac89" + }, + { + "name": "Christian Vaagland Tellnes", + "url": "https://github.com/tellnes", + "githubUsername": "tellnes" + }, + { + "name": "David Junger", + "url": "https://github.com/touffy", + "githubUsername": "touffy" + }, + { + "name": "Deividas Bakanas", + "url": "https://github.com/DeividasBakanas", + "githubUsername": "DeividasBakanas" + }, + { + "name": "Eugene Y. Q. Shen", + "url": "https://github.com/eyqs", + "githubUsername": "eyqs" + }, + { + "name": "Flarna", + "url": "https://github.com/Flarna", + "githubUsername": "Flarna" + }, + { + "name": "Hannes Magnusson", + "url": "https://github.com/Hannes-Magnusson-CK", + "githubUsername": "Hannes-Magnusson-CK" + }, + { + "name": "Hoàng Văn Khải", + "url": "https://github.com/KSXGitHub", + "githubUsername": "KSXGitHub" + }, + { + "name": "Huw", + "url": "https://github.com/hoo29", + "githubUsername": "hoo29" + }, + { + "name": "Kelvin Jin", + "url": "https://github.com/kjin", + "githubUsername": "kjin" + }, + { + "name": "Klaus Meinhardt", + "url": "https://github.com/ajafff", + "githubUsername": "ajafff" + }, + { + "name": "Lishude", + "url": "https://github.com/islishude", + "githubUsername": "islishude" + }, + { + "name": "Mariusz Wiktorczyk", + "url": "https://github.com/mwiktorczyk", + "githubUsername": "mwiktorczyk" + }, + { + "name": "Matthieu Sieben", + "url": "https://github.com/matthieusieben", + "githubUsername": "matthieusieben" + }, + { + "name": "Mohsen Azimi", + "url": "https://github.com/mohsen1", + "githubUsername": "mohsen1" + }, + { + "name": "Nicolas Even", + "url": "https://github.com/n-e", + "githubUsername": "n-e" + }, + { + "name": "Nicolas Voigt", + "url": "https://github.com/octo-sniffle", + "githubUsername": "octo-sniffle" + }, + { + "name": "Parambir Singh", + "url": "https://github.com/parambirs", + "githubUsername": "parambirs" + }, + { + "name": "Sebastian Silbermann", + "url": "https://github.com/eps1lon", + "githubUsername": "eps1lon" + }, + { + "name": "Simon Schick", + "url": "https://github.com/SimonSchick", + "githubUsername": "SimonSchick" + }, + { + "name": "Thomas den Hollander", + "url": "https://github.com/ThomasdenH", + "githubUsername": "ThomasdenH" + }, + { + "name": "Wilco Bakker", + "url": "https://github.com/WilcoBakker", + "githubUsername": "WilcoBakker" + }, + { + "name": "wwwy3y3", + "url": "https://github.com/wwwy3y3", + "githubUsername": "wwwy3y3" + }, + { + "name": "Zane Hannan AU", + "url": "https://github.com/ZaneHannanAU", + "githubUsername": "ZaneHannanAU" + }, + { + "name": "Samuel Ainsworth", + "url": "https://github.com/samuela", + "githubUsername": "samuela" + }, + { + "name": "Kyle Uehlein", + "url": "https://github.com/kuehlein", + "githubUsername": "kuehlein" + }, + { + "name": "Jordi Oliveras Rovira", + "url": "https://github.com/j-oliveras", + "githubUsername": "j-oliveras" + }, + { + "name": "Thanik Bhongbhibhat", + "url": "https://github.com/bhongy", + "githubUsername": "bhongy" + } + ], + "main": "", + "types": "index", + "typesVersions": { + ">=3.2.0-0": { + "*": [ + "ts3.2/*" + ] + } + }, + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "8630266379794ffe5826422974749423e8d09e4d652e641cbf6ade81782c32af", + "typeScriptVersion": "2.0" +} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts new file mode 100644 index 000000000..2f4a54918 --- /dev/null +++ b/node_modules/@types/node/path.d.ts @@ -0,0 +1,159 @@ +declare module "path" { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string; + /** + * The file extension (if any) such as '.html' + */ + ext?: string; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + function resolve(...pathSegments: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + */ + function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + const sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + const delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + function format(pathObject: FormatInputPathObject): string; + + namespace posix { + function normalize(p: string): string; + function join(...paths: string[]): string; + function resolve(...pathSegments: string[]): string; + function isAbsolute(p: string): boolean; + function relative(from: string, to: string): string; + function dirname(p: string): string; + function basename(p: string, ext?: string): string; + function extname(p: string): string; + const sep: string; + const delimiter: string; + function parse(p: string): ParsedPath; + function format(pP: FormatInputPathObject): string; + } + + namespace win32 { + function normalize(p: string): string; + function join(...paths: string[]): string; + function resolve(...pathSegments: string[]): string; + function isAbsolute(p: string): boolean; + function relative(from: string, to: string): string; + function dirname(p: string): string; + function basename(p: string, ext?: string): string; + function extname(p: string): string; + const sep: string; + const delimiter: string; + function parse(p: string): ParsedPath; + function format(pP: FormatInputPathObject): string; + } +} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts new file mode 100644 index 000000000..bf44d446e --- /dev/null +++ b/node_modules/@types/node/perf_hooks.d.ts @@ -0,0 +1,304 @@ +declare module "perf_hooks" { + import { AsyncResource } from "async_hooks"; + + interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; + + /** + * The name of the performance entry. + */ + readonly name: string; + + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; + + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: string; + + /** + * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies + * the type of garbage collection operation that occurred. + * The value may be one of perf_hooks.constants. + */ + readonly kind?: number; + } + + interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; + + /** + * The high resolution millisecond timestamp at which cluster processing ended. + */ + readonly clusterSetupEnd: number; + + /** + * The high resolution millisecond timestamp at which cluster processing started. + */ + readonly clusterSetupStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop exited. + */ + readonly loopExit: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + */ + readonly loopStart: number; + + /** + * The high resolution millisecond timestamp at which main module load ended. + */ + readonly moduleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which main module load started. + */ + readonly moduleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + */ + readonly nodeStart: number; + + /** + * The high resolution millisecond timestamp at which preload module load ended. + */ + readonly preloadModuleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which preload module load started. + */ + readonly preloadModuleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing ended. + */ + readonly thirdPartyMainEnd: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing started. + */ + readonly thirdPartyMainStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + interface Performance { + /** + * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. + * If name is provided, removes entries with name. + * @param name + */ + clearFunctions(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only objects whose performanceEntry.name matches name. + */ + clearMeasures(name?: string): void; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + * @return list of all PerformanceEntry objects + */ + getEntries(): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + * @param name + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByType(type: string): PerformanceEntry[]; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; + } + + interface PerformanceObserverEntryList { + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + */ + getEntries(): PerformanceEntry[]; + + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + */ + getEntriesByType(type: string): PerformanceEntry[]; + } + + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + + /** + * Disconnects the PerformanceObserver instance from all notifications. + */ + disconnect(): void; + + /** + * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. + * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. + * Property buffered defaults to false. + * @param options + */ + observe(options: { entryTypes: string[], buffered?: boolean }): void; + } + + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + } + + const performance: Performance; + + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number; + } + + interface EventLoopDelayMonitor { + /** + * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started. + */ + enable(): boolean; + /** + * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped. + */ + disable(): boolean; + + /** + * Resets the collected histogram data. + */ + reset(): void; + + /** + * Returns the value at the given percentile. + * @param percentile A percentile value between 1 and 100. + */ + percentile(percentile: number): number; + + /** + * A `Map` object detailing the accumulated percentile distribution. + */ + readonly percentiles: Map; + + /** + * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold. + */ + readonly exceeds: number; + + /** + * The minimum recorded event loop delay. + */ + readonly min: number; + + /** + * The maximum recorded event loop delay. + */ + readonly max: number; + + /** + * The mean of the recorded event loop delays. + */ + readonly mean: number; + + /** + * The standard deviation of the recorded event loop delays. + */ + readonly stddev: number; + } + + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor; +} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts new file mode 100644 index 000000000..ccd5c9c19 --- /dev/null +++ b/node_modules/@types/node/process.d.ts @@ -0,0 +1,3 @@ +declare module "process" { + export = process; +} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts new file mode 100644 index 000000000..75d2811d0 --- /dev/null +++ b/node_modules/@types/node/punycode.d.ts @@ -0,0 +1,12 @@ +declare module "punycode" { + function decode(string: string): string; + function encode(string: string): string; + function toUnicode(domain: string): string; + function toASCII(domain: string): string; + const ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + const version: string; +} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts new file mode 100644 index 000000000..23359d9de --- /dev/null +++ b/node_modules/@types/node/querystring.d.ts @@ -0,0 +1,32 @@ +declare module "querystring" { + interface StringifyOptions { + encodeURIComponent?: (str: string) => string; + } + + interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: (str: string) => string; + } + + interface ParsedUrlQuery { [key: string]: string | string[]; } + + interface ParsedUrlQueryInput { + [key: string]: + // The value type here is a "poor man's `unknown`". When these types support TypeScript + // 3.0+, we can replace this with `unknown`. + {} | null | undefined; + } + + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + function escape(str: string): string; + function unescape(str: string): string; +} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts new file mode 100644 index 000000000..c2518d8da --- /dev/null +++ b/node_modules/@types/node/readline.d.ts @@ -0,0 +1,136 @@ +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + class Interface extends events.EventEmitter { + readonly terminal: boolean; + + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface + */ + protected constructor(options: ReadLineOptions); + + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): this; + resume(): this; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: string) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: string): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: string) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: string) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: string) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: string) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + type ReadLine = Interface; // type forwarded for backwards compatiblity + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any; + + type CompleterResult = [string[], string]; + + interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + prompt?: string; + crlfDelay?: number; + removeHistoryDuplicates?: boolean; + } + + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + function createInterface(options: ReadLineOptions): Interface; + + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void; + function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void; + function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + function clearLine(stream: NodeJS.WritableStream, dir: number): void; + function clearScreenDown(stream: NodeJS.WritableStream): void; +} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts new file mode 100644 index 000000000..71f490443 --- /dev/null +++ b/node_modules/@types/node/repl.d.ts @@ -0,0 +1,382 @@ +declare module "repl" { + import { Interface, Completer, AsyncCompleter } from "readline"; + import { Context } from "vm"; + import { InspectOptions } from "util"; + + interface ReplOptions { + /** + * The input prompt to display. + * Default: `"> "` + */ + prompt?: string; + /** + * The `Readable` stream from which REPL input will be read. + * Default: `process.stdin` + */ + input?: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + * Default: `process.stdout` + */ + output?: NodeJS.WritableStream; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean; + } + + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { options: InspectOptions }; + + type REPLCommandAction = (this: REPLServer, text: string) => void; + + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + + /** + * Provides a customizable Read-Eval-Print-Loop (REPL). + * + * Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those + * according to a user-defined evaluation function, then output the result. Input and output + * may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`. + * + * Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style + * line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session + * state, error recovery, and customizable evaluation functions. + * + * Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_ + * be created directly using the JavaScript `new` keyword. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: { readonly [name: string]: REPLCommand | undefined }; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + + /** + * Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked + * by typing a `.` followed by the `keyword`. + * + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * Readies the REPL instance for input from the user, printing the configured `prompt` to a + * new line in the `output` and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'. + * + * This method is primarily intended to be called from within the action function for + * commands registered using the `replServer.defineCommand()` method. + * + * @param preserveCursor When `true`, the cursor placement will not be reset to `0`. + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * Clears any command that has been buffered but not yet executed. + * + * This method is primarily intended to be called from within the action function for + * commands registered using the `replServer.defineCommand()` method. + * + * @since v9.0.0 + */ + clearBufferedCommand(): void; + + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @param path The path to the history file + */ + setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void; + + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: string) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: (context: Context) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: string): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: Context): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: string) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: (context: Context) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: string) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: (context: Context) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: string) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: (context: Context) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: string) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: (context: Context) => void): this; + } + + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + export const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol + + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + export const REPL_MODE_STRICT: symbol; // TODO: unique symbol + + /** + * Creates and starts a `repl.REPLServer` instance. + * + * @param options The options for the `REPLServer`. If `options` is a string, then it specifies + * the input prompt. + */ + function start(options?: string | ReplOptions): REPLServer; + + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + + constructor(err: Error); + } +} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts new file mode 100644 index 000000000..f4424f8c1 --- /dev/null +++ b/node_modules/@types/node/stream.d.ts @@ -0,0 +1,307 @@ +declare module "stream" { + import * as events from "events"; + + class internal extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + class Stream extends internal { } + + interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?(this: Readable, size: number): void; + destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean; + } + + class Readable extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + + readable: boolean; + readonly readableHighWaterMark: number; + readonly readableLength: number; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + unpipe(destination?: NodeJS.WritableStream): this; + unshift(chunk: any, encoding?: BufferEncoding): void; + wrap(oldStream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: string): boolean; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. readable + * 5. error + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: any) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "data", chunk: any): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: any) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: any) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: any) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: any) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: any) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + defaultEncoding?: string; + objectMode?: boolean; + emitClose?: boolean; + write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + autoDestroy?: boolean; + } + + class Writable extends Stream implements NodeJS.WritableStream { + readonly writable: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: string, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding: string, cb?: () => void): void; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + + // Note: Duplex extends both Readable and Writable. + class Duplex extends Readable implements Writable { + readonly writable: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: () => void): void; + end(chunk: any, cb?: () => void): void; + end(chunk: any, encoding?: string, cb?: () => void): void; + cork(): void; + uncork(): void; + } + + type TransformCallback = (error?: Error | null, data?: any) => void; + + interface TransformOptions extends DuplexOptions { + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: string, callback: (error?: Error | null) => void): void; + writev?(this: Transform, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: string, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + + class PassThrough extends Transform { } + + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream): Promise; + } + + function pipeline(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T; + function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException | null) => void): T; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream, + stream3: NodeJS.ReadWriteStream, + stream4: T, + callback?: (err: NodeJS.ErrnoException | null) => void, + ): T; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream, + stream3: NodeJS.ReadWriteStream, + stream4: NodeJS.ReadWriteStream, + stream5: T, + callback?: (err: NodeJS.ErrnoException | null) => void, + ): T; + function pipeline(streams: Array, callback?: (err: NodeJS.ErrnoException | null) => void): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)>, + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.WritableStream): Promise; + function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.WritableStream): Promise; + function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.WritableStream): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream, + stream3: NodeJS.ReadWriteStream, + stream4: NodeJS.ReadWriteStream, + stream5: NodeJS.WritableStream, + ): Promise; + function __promisify__(streams: Array): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array, + ): Promise; + } + + interface Pipe { } + } + + export = internal; +} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts new file mode 100644 index 000000000..fe0e0b4d2 --- /dev/null +++ b/node_modules/@types/node/string_decoder.d.ts @@ -0,0 +1,7 @@ +declare module "string_decoder" { + class StringDecoder { + constructor(encoding?: string); + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } +} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts new file mode 100644 index 000000000..e64a6735c --- /dev/null +++ b/node_modules/@types/node/timers.d.ts @@ -0,0 +1,16 @@ +declare module "timers" { + function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; + namespace setTimeout { + function __promisify__(ms: number): Promise; + function __promisify__(ms: number, value: T): Promise; + } + function clearTimeout(timeoutId: NodeJS.Timeout): void; + function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; + function clearInterval(intervalId: NodeJS.Timeout): void; + function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; + namespace setImmediate { + function __promisify__(): Promise; + function __promisify__(value: T): Promise; + } + function clearImmediate(immediateId: NodeJS.Immediate): void; +} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts new file mode 100644 index 000000000..3446c0972 --- /dev/null +++ b/node_modules/@types/node/tls.d.ts @@ -0,0 +1,418 @@ +declare module "tls" { + import * as crypto from "crypto"; + import * as dns from "dns"; + import * as net from "net"; + import * as stream from "stream"; + + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: { [index: string]: string[] | undefined }; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean; + /** + * An optional net.Server instance. + */ + server?: net.Server; + + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean; + } + + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + + /** + * String containing the selected ALPN protocol. + * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol?: string; + + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param detailed - If true; the full chain with issuer property will be returned. + * @returns An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. + * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. + * The value `null` will be returned for server sockets or disconnected client sockets. + * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. + * @returns negotiated SSL/TLS protocol version of the current connection + */ + getProtocol(): string | null; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): Buffer | undefined; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): Buffer | undefined; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated. + */ + renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * Note: The format of the output is identical to the output of `openssl s_client + * -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's + * `SSL_trace()` function, the format is undocumented, can change without notice, + * and should not be relied on. + */ + enableTrace(): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + addListener(event: "session", listener: (session: Buffer) => void): this; + addListener(event: "keylog", listener: (line: Buffer) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + emit(event: "session", session: Buffer): boolean; + emit(event: "keylog", line: Buffer): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + on(event: "session", listener: (session: Buffer) => void): this; + on(event: "keylog", listener: (line: Buffer) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + once(event: "session", listener: (session: Buffer) => void): this; + once(event: "keylog", listener: (line: Buffer) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + prependListener(event: "session", listener: (session: Buffer) => void): this; + prependListener(event: "keylog", listener: (line: Buffer) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + prependOnceListener(event: "session", listener: (session: Buffer) => void): this; + prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; + } + + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext; + + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean; + } + + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions { + handshakeTimeout?: number; + sessionTimeout?: number; + ticketKeys?: Buffer; + } + + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string; + port?: number; + path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity; + servername?: string; // SNI TLS Extension + session?: Buffer; + minDHSize?: number; + lookup?: net.LookupFunction; + timeout?: number; + } + + class Server extends net.Server { + addContext(hostName: string, credentials: SecureContextOptions): void; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + + interface SecureContextOptions { + pfx?: string | Buffer | Array; + key?: string | Buffer | Array; + passphrase?: string; + cert?: string | Buffer | Array; + ca?: string | Buffer | Array; + ciphers?: string; + honorCipherOrder?: boolean; + ecdhCurve?: string; + clientCertEngine?: string; + crl?: string | Buffer | Array; + dhparam?: string | Buffer; + secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options + secureProtocol?: string; // SSL Method, e.g. SSLv23_method + sessionIdContext?: string; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion; + } + + interface SecureContext { + context: any; + } + + /* + * Verifies the certificate `cert` is issued to host `host`. + * @host The hostname to verify the certificate against + * @cert PeerCertificate representing the peer's certificate + * + * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. + */ + function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * @deprecated + */ + function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + function createSecureContext(details: SecureContextOptions): SecureContext; + function getCiphers(): string[]; + + const DEFAULT_ECDH_CURVE: string; + + const rootCertificates: ReadonlyArray; +} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts new file mode 100644 index 000000000..9d1a59bdd --- /dev/null +++ b/node_modules/@types/node/trace_events.d.ts @@ -0,0 +1,61 @@ +declare module "trace_events" { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + export interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + + /** + * Creates and returns a Tracing object for the given set of categories. + */ + export function createTracing(options: CreateTracingOptions): Tracing; + + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is + * determined by the union of all currently-enabled `Tracing` objects and + * any categories enabled using the `--trace-event-categories` flag. + */ + export function getEnabledCategories(): string; +} diff --git a/node_modules/@types/node/ts3.2/globals.d.ts b/node_modules/@types/node/ts3.2/globals.d.ts new file mode 100644 index 000000000..70892bca9 --- /dev/null +++ b/node_modules/@types/node/ts3.2/globals.d.ts @@ -0,0 +1,19 @@ +// tslint:disable-next-line:no-bad-reference +/// + +declare namespace NodeJS { + interface HRTime { + bigint(): bigint; + } +} + +interface Buffer extends Uint8Array { + readBigUInt64BE(offset?: number): bigint; + readBigUInt64LE(offset?: number): bigint; + readBigInt64BE(offset?: number): bigint; + readBigInt64LE(offset?: number): bigint; + writeBigInt64BE(value: bigint, offset?: number): number; + writeBigInt64LE(value: bigint, offset?: number): number; + writeBigUInt64BE(value: bigint, offset?: number): number; + writeBigUInt64LE(value: bigint, offset?: number): number; +} diff --git a/node_modules/@types/node/ts3.2/index.d.ts b/node_modules/@types/node/ts3.2/index.d.ts new file mode 100644 index 000000000..ce7709bc7 --- /dev/null +++ b/node_modules/@types/node/ts3.2/index.d.ts @@ -0,0 +1,20 @@ +// NOTE: These definitions support NodeJS and TypeScript 3.2. + +// NOTE: TypeScript version-specific augmentations can be found in the following paths: +// - ~/base.d.ts - Shared definitions common to all TypeScript versions +// - ~/index.d.ts - Definitions specific to TypeScript 2.1 +// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +// tslint:disable-next-line:no-bad-reference +/// + +// TypeScript 3.2-specific augmentations: +/// +/// diff --git a/node_modules/@types/node/ts3.2/util.d.ts b/node_modules/@types/node/ts3.2/util.d.ts new file mode 100644 index 000000000..a8b2487ef --- /dev/null +++ b/node_modules/@types/node/ts3.2/util.d.ts @@ -0,0 +1,15 @@ +// tslint:disable-next-line:no-bad-reference +/// + +declare module "util" { + namespace inspect { + const custom: unique symbol; + } + namespace promisify { + const custom: unique symbol; + } + namespace types { + function isBigInt64Array(value: any): value is BigInt64Array; + function isBigUint64Array(value: any): value is BigUint64Array; + } +} diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts new file mode 100644 index 000000000..d7fc18647 --- /dev/null +++ b/node_modules/@types/node/tty.d.ts @@ -0,0 +1,50 @@ +declare module "tty" { + import * as net from "net"; + + function isatty(fd: number): boolean; + class ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + /** + * -1 - to the left from cursor + * 0 - the entire line + * 1 - to the right from cursor + */ + type Direction = -1 | 0 | 1; + class WriteStream extends net.Socket { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "resize", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "resize"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "resize", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "resize", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "resize", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "resize", listener: () => void): this; + + clearLine(dir: Direction): void; + clearScreenDown(): void; + cursorTo(x: number, y: number): void; + /** + * @default `process.env` + */ + getColorDepth(env?: {}): number; + hasColors(depth?: number): boolean; + hasColors(env?: {}): boolean; + hasColors(depth: number, env?: {}): boolean; + getWindowSize(): [number, number]; + columns: number; + rows: number; + isTTY: boolean; + } +} diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts new file mode 100644 index 000000000..51dcd69ab --- /dev/null +++ b/node_modules/@types/node/url.d.ts @@ -0,0 +1,104 @@ +declare module "url" { + import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring'; + + interface UrlObjectCommon { + auth?: string; + hash?: string; + host?: string; + hostname?: string; + href?: string; + path?: string; + pathname?: string; + protocol?: string; + search?: string; + slashes?: boolean; + } + + // Input to `url.format` + interface UrlObject extends UrlObjectCommon { + port?: string | number; + query?: string | null | ParsedUrlQueryInput; + } + + // Output of `url.parse` + interface Url extends UrlObjectCommon { + port?: string; + query?: string | null | ParsedUrlQuery; + } + + interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + interface UrlWithStringQuery extends Url { + query: string | null; + } + + function parse(urlStr: string): UrlWithStringQuery; + function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + + function format(URL: URL, options?: URLFormatOptions): string; + function format(urlObject: UrlObject | string): string; + function resolve(from: string, to: string): string; + + function domainToASCII(domain: string): string; + function domainToUnicode(domain: string): string; + + /** + * This function ensures the correct decodings of percent-encoded characters as + * well as ensuring a cross-platform valid absolute path string. + * @param url The file URL string or URL object to convert to a path. + */ + function fileURLToPath(url: string | URL): string; + + /** + * This function ensures that path is resolved absolutely, and that the URL + * control characters are correctly encoded when converting into a File URL. + * @param url The path to convert to a File URL. + */ + function pathToFileURL(url: string): URL; + + interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } + + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string, searchParams: this) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } +} diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts new file mode 100644 index 000000000..0e7a1c6ee --- /dev/null +++ b/node_modules/@types/node/util.d.ts @@ -0,0 +1,165 @@ +declare module "util" { + interface InspectOptions extends NodeJS.InspectOptions { } + function format(format: any, ...param: any[]): string; + function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string; + /** @deprecated since v0.11.3 - use a third party module instead. */ + function log(string: string): void; + function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + function inspect(object: any, options: InspectOptions): string; + namespace inspect { + let colors: { + [color: string]: [number, number] | undefined + }; + let styles: { + [style: string]: string | undefined + }; + let defaultOptions: InspectOptions; + /** + * Allows changing inspect settings from the repl. + */ + let replDefaults: InspectOptions; + } + /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ + function isArray(object: any): object is any[]; + /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ + function isRegExp(object: any): object is RegExp; + /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ + function isDate(object: any): object is Date; + /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ + function isError(object: any): object is Error; + function inherits(constructor: any, superConstructor: any): void; + function debuglog(key: string): (msg: string, ...param: any[]) => void; + /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ + function isBoolean(object: any): object is boolean; + /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ + function isBuffer(object: any): object is Buffer; + /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ + function isFunction(object: any): boolean; + /** @deprecated since v4.0.0 - use `value === null` instead. */ + function isNull(object: any): object is null; + /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ + function isNullOrUndefined(object: any): object is null | undefined; + /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ + function isNumber(object: any): object is number; + /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ + function isObject(object: any): boolean; + /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ + function isPrimitive(object: any): boolean; + /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ + function isString(object: any): object is string; + /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ + function isSymbol(object: any): object is symbol; + /** @deprecated since v4.0.0 - use `value === undefined` instead. */ + function isUndefined(object: any): object is undefined; + function deprecate(fn: T, message: string): T; + function isDeepStrictEqual(val1: any, val2: any): boolean; + + interface CustomPromisify extends Function { + __promisify__: TCustom; + } + + function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + + function promisify(fn: CustomPromisify): TCustom; + function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; + function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise; + function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; + function promisify(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise; + function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void, + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + function promisify(fn: Function): Function; + + namespace types { + function isAnyArrayBuffer(object: any): boolean; + function isArgumentsObject(object: any): object is IArguments; + function isArrayBuffer(object: any): object is ArrayBuffer; + function isAsyncFunction(object: any): boolean; + function isBooleanObject(object: any): object is Boolean; + function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */); + function isDataView(object: any): object is DataView; + function isDate(object: any): object is Date; + function isExternal(object: any): boolean; + function isFloat32Array(object: any): object is Float32Array; + function isFloat64Array(object: any): object is Float64Array; + function isGeneratorFunction(object: any): boolean; + function isGeneratorObject(object: any): boolean; + function isInt8Array(object: any): object is Int8Array; + function isInt16Array(object: any): object is Int16Array; + function isInt32Array(object: any): object is Int32Array; + function isMap(object: any): boolean; + function isMapIterator(object: any): boolean; + function isModuleNamespaceObject(value: any): boolean; + function isNativeError(object: any): object is Error; + function isNumberObject(object: any): object is Number; + function isPromise(object: any): boolean; + function isProxy(object: any): boolean; + function isRegExp(object: any): object is RegExp; + function isSet(object: any): boolean; + function isSetIterator(object: any): boolean; + function isSharedArrayBuffer(object: any): boolean; + function isStringObject(object: any): boolean; + function isSymbolObject(object: any): boolean; + function isTypedArray(object: any): object is NodeJS.TypedArray; + function isUint8Array(object: any): object is Uint8Array; + function isUint8ClampedArray(object: any): object is Uint8ClampedArray; + function isUint16Array(object: any): object is Uint16Array; + function isUint32Array(object: any): object is Uint32Array; + function isWeakMap(object: any): boolean; + function isWeakSet(object: any): boolean; + function isWebAssemblyCompiledModule(object: any): boolean; + } + + class TextDecoder { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean } + ); + decode( + input?: NodeJS.TypedArray | DataView | ArrayBuffer | null, + options?: { stream?: boolean } + ): string; + } + + class TextEncoder { + readonly encoding: string; + encode(input?: string): Uint8Array; + } +} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts new file mode 100644 index 000000000..fdecdb625 --- /dev/null +++ b/node_modules/@types/node/v8.d.ts @@ -0,0 +1,52 @@ +declare module "v8" { + import { Readable } from "stream"; + + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + number_of_native_contexts: number; + number_of_detached_contexts: number; + } + + function getHeapStatistics(): HeapInfo; + function getHeapSpaceStatistics(): HeapSpaceInfo[]; + function setFlagsFromString(flags: string): void; + /** + * Generates a snapshot of the current V8 heap and returns a Readable + * Stream that may be used to read the JSON serialized representation. + * This conversation was marked as resolved by joyeecheung + * This JSON stream format is intended to be used with tools such as + * Chrome DevTools. The JSON schema is undocumented and specific to the + * V8 engine, and may change from one version of V8 to the next. + */ + function getHeapSnapshot(): Readable; + + /** + * + * @param fileName The file path where the V8 heap snapshot is to be + * saved. If not specified, a file name with the pattern + * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be + * generated, where `{pid}` will be the PID of the Node.js process, + * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from + * the main Node.js thread or the id of a worker thread. + */ + function writeHeapSnapshot(fileName?: string): string; +} diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts new file mode 100644 index 000000000..0eefafd22 --- /dev/null +++ b/node_modules/@types/node/vm.d.ts @@ -0,0 +1,95 @@ +declare module "vm" { + interface Context { + [key: string]: any; + } + interface BaseOptions { + /** + * Specifies the filename used in stack traces produced by this script. + * Default: `''`. + */ + filename?: string; + /** + * Specifies the line number offset that is displayed in stack traces produced by this script. + * Default: `0`. + */ + lineOffset?: number; + /** + * Specifies the column number offset that is displayed in stack traces produced by this script. + * Default: `0` + */ + columnOffset?: number; + } + interface ScriptOptions extends BaseOptions { + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + interface RunningScriptOptions extends BaseOptions { + displayErrors?: boolean; + timeout?: number; + } + interface CompileFunctionOptions extends BaseOptions { + /** + * Provides an optional data with V8's code cache data for the supplied source. + */ + cachedData?: Buffer; + /** + * Specifies whether to produce new cache data. + * Default: `false`, + */ + produceCachedData?: boolean; + /** + * The sandbox/context in which the said function should be compiled in. + */ + parsingContext?: Context; + + /** + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling + */ + contextExtensions?: Object[]; + } + + interface CreateContextOptions { + /** + * Human-readable name of the newly created context. + * @default 'VM Context i' Where i is an ascending numerical index of the created context. + */ + name?: string; + /** + * Corresponds to the newly created context for display purposes. + * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), + * like the value of the `url.origin` property of a URL object. + * Most notably, this string should omit the trailing slash, as that denotes a path. + * @default '' + */ + origin?: string; + codeGeneration?: { + /** + * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) + * will throw an EvalError. + * @default true + */ + strings?: boolean; + /** + * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. + * @default true + */ + wasm?: boolean; + }; + } + + class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + createCachedData(): Buffer; + } + function createContext(sandbox?: Context, options?: CreateContextOptions): Context; + function isContext(sandbox: Context): boolean; + function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + function runInThisContext(code: string, options?: RunningScriptOptions | string): any; + function compileFunction(code: string, params: string[], options: CompileFunctionOptions): Function; +} diff --git a/node_modules/@types/node/worker_threads.d.ts b/node_modules/@types/node/worker_threads.d.ts new file mode 100644 index 000000000..45ea85e0a --- /dev/null +++ b/node_modules/@types/node/worker_threads.d.ts @@ -0,0 +1,153 @@ +declare module "worker_threads" { + import { Context } from "vm"; + import { EventEmitter } from "events"; + import { Readable, Writable } from "stream"; + + const isMainThread: boolean; + const parentPort: null | MessagePort; + const threadId: number; + const workerData: any; + + class MessageChannel { + readonly port1: MessagePort; + readonly port2: MessagePort; + } + + class MessagePort extends EventEmitter { + close(): void; + postMessage(value: any, transferList?: Array): void; + ref(): void; + unref(): void; + start(): void; + + addListener(event: "close", listener: () => void): this; + addListener(event: "message", listener: (value: any) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "close"): boolean; + emit(event: "message", value: any): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "close", listener: () => void): this; + on(event: "message", listener: (value: any) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "close", listener: () => void): this; + once(event: "message", listener: (value: any) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "close", listener: () => void): this; + prependListener(event: "message", listener: (value: any) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "message", listener: (value: any) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: () => void): this; + removeListener(event: "message", listener: (value: any) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + off(event: "close", listener: () => void): this; + off(event: "message", listener: (value: any) => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + } + + interface WorkerOptions { + eval?: boolean; + workerData?: any; + stdin?: boolean; + stdout?: boolean; + stderr?: boolean; + execArgv?: string[]; + } + + class Worker extends EventEmitter { + readonly stdin: Writable | null; + readonly stdout: Readable; + readonly stderr: Readable; + readonly threadId: number; + + constructor(filename: string, options?: WorkerOptions); + + postMessage(value: any, transferList?: Array): void; + ref(): void; + unref(): void; + /** + * Stop all JavaScript execution in the worker thread as soon as possible. + * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted. + */ + terminate(): Promise; + /** + * Transfer a `MessagePort` to a different `vm` Context. The original `port` + * object will be rendered unusable, and the returned `MessagePort` instance will + * take its place. + * + * The returned `MessagePort` will be an object in the target context, and will + * inherit from its global `Object` class. Objects passed to the + * `port.onmessage()` listener will also be created in the target context + * and inherit from its global `Object` class. + * + * However, the created `MessagePort` will no longer inherit from + * `EventEmitter`, and only `port.onmessage()` can be used to receive + * events using it. + */ + moveMessagePortToContext(port: MessagePort, context: Context): MessagePort; + + /** + * Receive a single message from a given `MessagePort`. If no message is available, + * `undefined` is returned, otherwise an object with a single `message` property + * that contains the message payload, corresponding to the oldest message in the + * `MessagePort`’s queue. + */ + receiveMessageOnPort(port: MessagePort): {} | undefined; + + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (exitCode: number) => void): this; + addListener(event: "message", listener: (value: any) => void): this; + addListener(event: "online", listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + emit(event: "error", err: Error): boolean; + emit(event: "exit", exitCode: number): boolean; + emit(event: "message", value: any): boolean; + emit(event: "online"): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (exitCode: number) => void): this; + on(event: "message", listener: (value: any) => void): this; + on(event: "online", listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (exitCode: number) => void): this; + once(event: "message", listener: (value: any) => void): this; + once(event: "online", listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (exitCode: number) => void): this; + prependListener(event: "message", listener: (value: any) => void): this; + prependListener(event: "online", listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (exitCode: number) => void): this; + prependOnceListener(event: "message", listener: (value: any) => void): this; + prependOnceListener(event: "online", listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "exit", listener: (exitCode: number) => void): this; + removeListener(event: "message", listener: (value: any) => void): this; + removeListener(event: "online", listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + + off(event: "error", listener: (err: Error) => void): this; + off(event: "exit", listener: (exitCode: number) => void): this; + off(event: "message", listener: (value: any) => void): this; + off(event: "online", listener: () => void): this; + off(event: string | symbol, listener: (...args: any[]) => void): this; + } +} diff --git a/node_modules/@types/node/zlib.d.ts b/node_modules/@types/node/zlib.d.ts new file mode 100644 index 000000000..b45721a14 --- /dev/null +++ b/node_modules/@types/node/zlib.d.ts @@ -0,0 +1,352 @@ +declare module "zlib" { + import * as stream from "stream"; + + interface ZlibOptions { + /** + * @default constants.Z_NO_FLUSH + */ + flush?: number; + /** + * @default constants.Z_FINISH + */ + finishFlush?: number; + /** + * @default 16*1024 + */ + chunkSize?: number; + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default + } + + interface BrotliOptions { + /** + * @default constants.BROTLI_OPERATION_PROCESS + */ + flush?: number; + /** + * @default constants.BROTLI_OPERATION_FINISH + */ + finishFlush?: number; + /** + * @default 16*1024 + */ + chunkSize?: number; + params?: { + /** + * Each key is a `constants.BROTLI_*` constant. + */ + [key: number]: boolean | number; + }; + } + + interface Zlib { + /** @deprecated Use bytesWritten instead. */ + readonly bytesRead: number; + readonly bytesWritten: number; + shell?: boolean | string; + close(callback?: () => void): void; + flush(kind?: number | (() => void), callback?: () => void): void; + } + + interface ZlibParams { + params(level: number, strategy: number, callback: () => void): void; + } + + interface ZlibReset { + reset(): void; + } + + interface BrotliCompress extends stream.Transform, Zlib { } + interface BrotliDecompress extends stream.Transform, Zlib { } + interface Gzip extends stream.Transform, Zlib { } + interface Gunzip extends stream.Transform, Zlib { } + interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + interface Inflate extends stream.Transform, Zlib, ZlibReset { } + interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } + interface Unzip extends stream.Transform, Zlib { } + + function createBrotliCompress(options?: BrotliOptions): BrotliCompress; + function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress; + function createGzip(options?: ZlibOptions): Gzip; + function createGunzip(options?: ZlibOptions): Gunzip; + function createDeflate(options?: ZlibOptions): Deflate; + function createInflate(options?: ZlibOptions): Inflate; + function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + function createInflateRaw(options?: ZlibOptions): InflateRaw; + function createUnzip(options?: ZlibOptions): Unzip; + + type InputType = string | DataView | ArrayBuffer | NodeJS.TypedArray; + + type CompressCallback = (error: Error | null, result: Buffer) => void; + + function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; + function brotliCompress(buf: InputType, callback: CompressCallback): void; + function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer; + function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; + function brotliDecompress(buf: InputType, callback: CompressCallback): void; + function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer; + function deflate(buf: InputType, callback: CompressCallback): void; + function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + function deflateRaw(buf: InputType, callback: CompressCallback): void; + function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + function gzip(buf: InputType, callback: CompressCallback): void; + function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + function gunzip(buf: InputType, callback: CompressCallback): void; + function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + function inflate(buf: InputType, callback: CompressCallback): void; + function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + function inflateRaw(buf: InputType, callback: CompressCallback): void; + function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + function unzip(buf: InputType, callback: CompressCallback): void; + function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; + function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + namespace constants { + const BROTLI_DECODE: number; + const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number; + const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number; + const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number; + const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number; + const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number; + const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number; + const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number; + const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number; + const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number; + const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number; + const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number; + const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number; + const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number; + const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number; + const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number; + const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number; + const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number; + const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number; + const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number; + const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number; + const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number; + const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number; + const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number; + const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number; + const BROTLI_DECODER_ERROR_UNREACHABLE: number; + const BROTLI_DECODER_NEEDS_MORE_INPUT: number; + const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number; + const BROTLI_DECODER_NO_ERROR: number; + const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number; + const BROTLI_DECODER_PARAM_LARGE_WINDOW: number; + const BROTLI_DECODER_RESULT_ERROR: number; + const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number; + const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number; + const BROTLI_DECODER_RESULT_SUCCESS: number; + const BROTLI_DECODER_SUCCESS: number; + + const BROTLI_DEFAULT_MODE: number; + const BROTLI_DEFAULT_QUALITY: number; + const BROTLI_DEFAULT_WINDOW: number; + const BROTLI_ENCODE: number; + const BROTLI_LARGE_MAX_WINDOW_BITS: number; + const BROTLI_MAX_INPUT_BLOCK_BITS: number; + const BROTLI_MAX_QUALITY: number; + const BROTLI_MAX_WINDOW_BITS: number; + const BROTLI_MIN_INPUT_BLOCK_BITS: number; + const BROTLI_MIN_QUALITY: number; + const BROTLI_MIN_WINDOW_BITS: number; + + const BROTLI_MODE_FONT: number; + const BROTLI_MODE_GENERIC: number; + const BROTLI_MODE_TEXT: number; + + const BROTLI_OPERATION_EMIT_METADATA: number; + const BROTLI_OPERATION_FINISH: number; + const BROTLI_OPERATION_FLUSH: number; + const BROTLI_OPERATION_PROCESS: number; + + const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number; + const BROTLI_PARAM_LARGE_WINDOW: number; + const BROTLI_PARAM_LGBLOCK: number; + const BROTLI_PARAM_LGWIN: number; + const BROTLI_PARAM_MODE: number; + const BROTLI_PARAM_NDIRECT: number; + const BROTLI_PARAM_NPOSTFIX: number; + const BROTLI_PARAM_QUALITY: number; + const BROTLI_PARAM_SIZE_HINT: number; + + const DEFLATE: number; + const DEFLATERAW: number; + const GUNZIP: number; + const GZIP: number; + const INFLATE: number; + const INFLATERAW: number; + const UNZIP: number; + + const Z_BEST_COMPRESSION: number; + const Z_BEST_SPEED: number; + const Z_BLOCK: number; + const Z_BUF_ERROR: number; + const Z_DATA_ERROR: number; + + const Z_DEFAULT_CHUNK: number; + const Z_DEFAULT_COMPRESSION: number; + const Z_DEFAULT_LEVEL: number; + const Z_DEFAULT_MEMLEVEL: number; + const Z_DEFAULT_STRATEGY: number; + const Z_DEFAULT_WINDOWBITS: number; + + const Z_ERRNO: number; + const Z_FILTERED: number; + const Z_FINISH: number; + const Z_FIXED: number; + const Z_FULL_FLUSH: number; + const Z_HUFFMAN_ONLY: number; + const Z_MAX_CHUNK: number; + const Z_MAX_LEVEL: number; + const Z_MAX_MEMLEVEL: number; + const Z_MAX_WINDOWBITS: number; + const Z_MEM_ERROR: number; + const Z_MIN_CHUNK: number; + const Z_MIN_LEVEL: number; + const Z_MIN_MEMLEVEL: number; + const Z_MIN_WINDOWBITS: number; + const Z_NEED_DICT: number; + const Z_NO_COMPRESSION: number; + const Z_NO_FLUSH: number; + const Z_OK: number; + const Z_PARTIAL_FLUSH: number; + const Z_RLE: number; + const Z_STREAM_END: number; + const Z_STREAM_ERROR: number; + const Z_SYNC_FLUSH: number; + const Z_VERSION_ERROR: number; + const ZLIB_VERNUM: number; + } + + /** + * @deprecated + */ + const Z_NO_FLUSH: number; + /** + * @deprecated + */ + const Z_PARTIAL_FLUSH: number; + /** + * @deprecated + */ + const Z_SYNC_FLUSH: number; + /** + * @deprecated + */ + const Z_FULL_FLUSH: number; + /** + * @deprecated + */ + const Z_FINISH: number; + /** + * @deprecated + */ + const Z_BLOCK: number; + /** + * @deprecated + */ + const Z_TREES: number; + /** + * @deprecated + */ + const Z_OK: number; + /** + * @deprecated + */ + const Z_STREAM_END: number; + /** + * @deprecated + */ + const Z_NEED_DICT: number; + /** + * @deprecated + */ + const Z_ERRNO: number; + /** + * @deprecated + */ + const Z_STREAM_ERROR: number; + /** + * @deprecated + */ + const Z_DATA_ERROR: number; + /** + * @deprecated + */ + const Z_MEM_ERROR: number; + /** + * @deprecated + */ + const Z_BUF_ERROR: number; + /** + * @deprecated + */ + const Z_VERSION_ERROR: number; + /** + * @deprecated + */ + const Z_NO_COMPRESSION: number; + /** + * @deprecated + */ + const Z_BEST_SPEED: number; + /** + * @deprecated + */ + const Z_BEST_COMPRESSION: number; + /** + * @deprecated + */ + const Z_DEFAULT_COMPRESSION: number; + /** + * @deprecated + */ + const Z_FILTERED: number; + /** + * @deprecated + */ + const Z_HUFFMAN_ONLY: number; + /** + * @deprecated + */ + const Z_RLE: number; + /** + * @deprecated + */ + const Z_FIXED: number; + /** + * @deprecated + */ + const Z_DEFAULT_STRATEGY: number; + /** + * @deprecated + */ + const Z_BINARY: number; + /** + * @deprecated + */ + const Z_TEXT: number; + /** + * @deprecated + */ + const Z_ASCII: number; + /** + * @deprecated + */ + const Z_UNKNOWN: number; + /** + * @deprecated + */ + const Z_DEFLATED: number; +} diff --git a/node_modules/@types/zen-observable/LICENSE b/node_modules/@types/zen-observable/LICENSE new file mode 100644 index 000000000..21071075c --- /dev/null +++ b/node_modules/@types/zen-observable/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/zen-observable/README.md b/node_modules/@types/zen-observable/README.md new file mode 100644 index 000000000..91c1b8d2b --- /dev/null +++ b/node_modules/@types/zen-observable/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/zen-observable` + +# Summary +This package contains type definitions for zen-observable (https://github.com/zenparsing/zen-observable). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/zen-observable + +Additional Details + * Last updated: Tue, 26 Jun 2018 01:10:51 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Kombu , JounQin , Thomas . diff --git a/node_modules/@types/zen-observable/index.d.ts b/node_modules/@types/zen-observable/index.d.ts new file mode 100644 index 000000000..94ca94ccd --- /dev/null +++ b/node_modules/@types/zen-observable/index.d.ts @@ -0,0 +1,65 @@ +// Type definitions for zen-observable 0.8 +// Project: https://github.com/zenparsing/zen-observable +// Definitions by: Kombu +// JounQin +// Thomas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } + + namespace ZenObservable { + interface SubscriptionObserver { + closed: boolean; + next(value: T): void; + error(errorValue: any): void; + complete(): void; + } + + interface Subscription { + closed: boolean; + unsubscribe(): void; + } + + interface Observer { + start?(subscription: Subscription): any; + next?(value: T): void; + error?(errorValue: any): void; + complete?(): void; + } + + type Subscriber = (observer: SubscriptionObserver) => void | (() => void) | Subscription; + + interface ObservableLike { + subscribe?: Subscriber; + [Symbol.observable](): Observable | ObservableLike; + } + } +} + +declare class Observable { + constructor(subscriber: ZenObservable.Subscriber) + + subscribe(observer: ZenObservable.Observer): ZenObservable.Subscription; + subscribe(onNext: (value: T) => void, onError?: (error: any) => void, onComplete?: () => void): ZenObservable.Subscription; + + [Symbol.observable](): Observable; + + forEach(callback: (value: T) => void): Promise; + map(callback: (value: T) => R): Observable; + filter(callback: (value: T) => boolean): Observable; + reduce(callback: (previousValue: T, currentValue: T) => T, initialValue?: T): Observable; + reduce(callback: (previousValue: R, currentValue: T) => R, initialValue?: R): Observable; + flatMap(callback: (value: T) => ZenObservable.ObservableLike): Observable; + concat(...observable: Array>): Observable; + + static from(observable: Observable | ZenObservable.ObservableLike | ArrayLike): Observable; + static of(...items: R[]): Observable; +} + +declare namespace Observable { +} + +export = Observable; diff --git a/node_modules/@types/zen-observable/package.json b/node_modules/@types/zen-observable/package.json new file mode 100644 index 000000000..60421dc27 --- /dev/null +++ b/node_modules/@types/zen-observable/package.json @@ -0,0 +1,32 @@ +{ + "name": "@types/zen-observable", + "version": "0.8.0", + "description": "TypeScript definitions for zen-observable", + "license": "MIT", + "contributors": [ + { + "name": "Kombu", + "url": "https://github.com/aicest", + "githubUsername": "aicest" + }, + { + "name": "JounQin", + "url": "https://github.com/JounQin", + "githubUsername": "JounQin" + }, + { + "name": "Thomas", + "url": "https://github.com/itomtom", + "githubUsername": "itomtom" + } + ], + "main": "", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "b38cf27ebcd899d9dab8a02d5cb7b53aacd5c4b407a36e938223f642882b6509", + "typeScriptVersion": "2.0" +} \ No newline at end of file diff --git a/node_modules/@wry/context/LICENSE b/node_modules/@wry/context/LICENSE new file mode 100644 index 000000000..306c285a4 --- /dev/null +++ b/node_modules/@wry/context/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Ben Newman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@wry/context/README.md b/node_modules/@wry/context/README.md new file mode 100644 index 000000000..e294499f6 --- /dev/null +++ b/node_modules/@wry/context/README.md @@ -0,0 +1,4 @@ +# @wry/context + +Manage contextual information needed by synchronous or asynchronous +tasks without explicitly passing objects around. diff --git a/node_modules/@wry/context/lib/context.d.ts b/node_modules/@wry/context/lib/context.d.ts new file mode 100644 index 000000000..58076ea25 --- /dev/null +++ b/node_modules/@wry/context/lib/context.d.ts @@ -0,0 +1,8 @@ +/// +import { Slot } from "./slot"; +export { Slot }; +export declare const bind: (callback: (...args: TArgs) => TResult) => (...args: TArgs) => TResult, noContext: (callback: (this: TThis, ...args: TArgs) => TResult, args?: TArgs | undefined, thisArg?: TThis | undefined) => TResult; +export { setTimeoutWithContext as setTimeout }; +declare function setTimeoutWithContext(callback: () => any, delay: number): NodeJS.Timer; +export declare function asyncFromGen(genFn: (...args: TArgs) => IterableIterator): (...args: TArgs) => Promise; +export declare function wrapYieldingFiberMethods(Fiber: F): F; diff --git a/node_modules/@wry/context/lib/context.esm.js b/node_modules/@wry/context/lib/context.esm.js new file mode 100644 index 000000000..c383b023f --- /dev/null +++ b/node_modules/@wry/context/lib/context.esm.js @@ -0,0 +1,199 @@ +// This currentContext variable will only be used if the makeSlotClass +// function is called, which happens only if this is the first copy of the +// @wry/context package to be imported. +var currentContext = null; +// This unique internal object is used to denote the absence of a value +// for a given Slot, and is never exposed to outside code. +var MISSING_VALUE = {}; +var idCounter = 1; +// Although we can't do anything about the cost of duplicated code from +// accidentally bundling multiple copies of the @wry/context package, we can +// avoid creating the Slot class more than once using makeSlotClass. +var makeSlotClass = function () { return /** @class */ (function () { + function Slot() { + // If you have a Slot object, you can find out its slot.id, but you cannot + // guess the slot.id of a Slot you don't have access to, thanks to the + // randomized suffix. + this.id = [ + "slot", + idCounter++, + Date.now(), + Math.random().toString(36).slice(2), + ].join(":"); + } + Slot.prototype.hasValue = function () { + for (var context_1 = currentContext; context_1; context_1 = context_1.parent) { + // We use the Slot object iself as a key to its value, which means the + // value cannot be obtained without a reference to the Slot object. + if (this.id in context_1.slots) { + var value = context_1.slots[this.id]; + if (value === MISSING_VALUE) + break; + if (context_1 !== currentContext) { + // Cache the value in currentContext.slots so the next lookup will + // be faster. This caching is safe because the tree of contexts and + // the values of the slots are logically immutable. + currentContext.slots[this.id] = value; + } + return true; + } + } + if (currentContext) { + // If a value was not found for this Slot, it's never going to be found + // no matter how many times we look it up, so we might as well cache + // the absence of the value, too. + currentContext.slots[this.id] = MISSING_VALUE; + } + return false; + }; + Slot.prototype.getValue = function () { + if (this.hasValue()) { + return currentContext.slots[this.id]; + } + }; + Slot.prototype.withValue = function (value, callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + var _a; + var slots = (_a = { + __proto__: null + }, + _a[this.id] = value, + _a); + var parent = currentContext; + currentContext = { parent: parent, slots: slots }; + try { + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = parent; + } + }; + // Capture the current context and wrap a callback function so that it + // reestablishes the captured context when called. + Slot.bind = function (callback) { + var context = currentContext; + return function () { + var saved = currentContext; + try { + currentContext = context; + return callback.apply(this, arguments); + } + finally { + currentContext = saved; + } + }; + }; + // Immediately run a callback function without any captured context. + Slot.noContext = function (callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + if (currentContext) { + var saved = currentContext; + try { + currentContext = null; + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = saved; + } + } + else { + return callback.apply(thisArg, args); + } + }; + return Slot; +}()); }; +// We store a single global implementation of the Slot class as a permanent +// non-enumerable symbol property of the Array constructor. This obfuscation +// does nothing to prevent access to the Slot class, but at least it ensures +// the implementation (i.e. currentContext) cannot be tampered with, and all +// copies of the @wry/context package (hopefully just one) will share the +// same Slot implementation. Since the first copy of the @wry/context package +// to be imported wins, this technique imposes a very high cost for any +// future breaking changes to the Slot class. +var globalKey = "@wry/context:Slot"; +var host = Array; +var Slot = host[globalKey] || function () { + var Slot = makeSlotClass(); + try { + Object.defineProperty(host, globalKey, { + value: host[globalKey] = Slot, + enumerable: false, + writable: false, + configurable: false, + }); + } + finally { + return Slot; + } +}(); + +var bind = Slot.bind, noContext = Slot.noContext; +function setTimeoutWithContext(callback, delay) { + return setTimeout(bind(callback), delay); +} +// Turn any generator function into an async function (using yield instead +// of await), with context automatically preserved across yields. +function asyncFromGen(genFn) { + return function () { + var gen = genFn.apply(this, arguments); + var boundNext = bind(gen.next); + var boundThrow = bind(gen.throw); + return new Promise(function (resolve, reject) { + function invoke(method, argument) { + try { + var result = method.call(gen, argument); + } + catch (error) { + return reject(error); + } + var next = result.done ? resolve : invokeNext; + if (isPromiseLike(result.value)) { + result.value.then(next, result.done ? reject : invokeThrow); + } + else { + next(result.value); + } + } + var invokeNext = function (value) { return invoke(boundNext, value); }; + var invokeThrow = function (error) { return invoke(boundThrow, error); }; + invokeNext(); + }); + }; +} +function isPromiseLike(value) { + return value && typeof value.then === "function"; +} +// If you use the fibers npm package to implement coroutines in Node.js, +// you should call this function at least once to ensure context management +// remains coherent across any yields. +var wrappedFibers = []; +function wrapYieldingFiberMethods(Fiber) { + // There can be only one implementation of Fiber per process, so this array + // should never grow longer than one element. + if (wrappedFibers.indexOf(Fiber) < 0) { + var wrap = function (obj, method) { + var fn = obj[method]; + obj[method] = function () { + return noContext(fn, arguments, this); + }; + }; + // These methods can yield, according to + // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100 + wrap(Fiber, "yield"); + wrap(Fiber.prototype, "run"); + wrap(Fiber.prototype, "throwInto"); + wrappedFibers.push(Fiber); + } + return Fiber; +} + +export { Slot, asyncFromGen, bind, noContext, setTimeoutWithContext as setTimeout, wrapYieldingFiberMethods }; +//# sourceMappingURL=context.esm.js.map diff --git a/node_modules/@wry/context/lib/context.esm.js.map b/node_modules/@wry/context/lib/context.esm.js.map new file mode 100644 index 000000000..1473e8b28 --- /dev/null +++ b/node_modules/@wry/context/lib/context.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"context.esm.js","sources":["../src/slot.ts","../src/context.ts"],"sourcesContent":["type Context = {\n parent: Context | null;\n slots: { [slotId: string]: any };\n}\n\n// This currentContext variable will only be used if the makeSlotClass\n// function is called, which happens only if this is the first copy of the\n// @wry/context package to be imported.\nlet currentContext: Context | null = null;\n\n// This unique internal object is used to denote the absence of a value\n// for a given Slot, and is never exposed to outside code.\nconst MISSING_VALUE: any = {};\n\nlet idCounter = 1;\n\n// Although we can't do anything about the cost of duplicated code from\n// accidentally bundling multiple copies of the @wry/context package, we can\n// avoid creating the Slot class more than once using makeSlotClass.\nconst makeSlotClass = () => class Slot {\n // If you have a Slot object, you can find out its slot.id, but you cannot\n // guess the slot.id of a Slot you don't have access to, thanks to the\n // randomized suffix.\n public readonly id = [\n \"slot\",\n idCounter++,\n Date.now(),\n Math.random().toString(36).slice(2),\n ].join(\":\");\n\n public hasValue() {\n for (let context = currentContext; context; context = context.parent) {\n // We use the Slot object iself as a key to its value, which means the\n // value cannot be obtained without a reference to the Slot object.\n if (this.id in context.slots) {\n const value = context.slots[this.id];\n if (value === MISSING_VALUE) break;\n if (context !== currentContext) {\n // Cache the value in currentContext.slots so the next lookup will\n // be faster. This caching is safe because the tree of contexts and\n // the values of the slots are logically immutable.\n currentContext!.slots[this.id] = value;\n }\n return true;\n }\n }\n if (currentContext) {\n // If a value was not found for this Slot, it's never going to be found\n // no matter how many times we look it up, so we might as well cache\n // the absence of the value, too.\n currentContext.slots[this.id] = MISSING_VALUE;\n }\n return false;\n }\n\n public getValue(): TValue | undefined {\n if (this.hasValue()) {\n return currentContext!.slots[this.id] as TValue;\n }\n }\n\n public withValue(\n value: TValue,\n callback: (this: TThis, ...args: TArgs) => TResult,\n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args?: TArgs,\n thisArg?: TThis,\n ): TResult {\n const slots = {\n __proto__: null,\n [this.id]: value,\n };\n const parent = currentContext;\n currentContext = { parent, slots };\n try {\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg!, args!);\n } finally {\n currentContext = parent;\n }\n }\n\n // Capture the current context and wrap a callback function so that it\n // reestablishes the captured context when called.\n static bind(\n callback: (...args: TArgs) => TResult,\n ) {\n const context = currentContext;\n return function (this: any) {\n const saved = currentContext;\n try {\n currentContext = context;\n return callback.apply(this, arguments as any);\n } finally {\n currentContext = saved;\n }\n } as typeof callback;\n }\n\n // Immediately run a callback function without any captured context.\n static noContext(\n callback: (this: TThis, ...args: TArgs) => TResult,\n // Given the prevalence of arrow functions, specifying arguments is likely\n // to be much more common than specifying `this`, hence this ordering:\n args?: TArgs,\n thisArg?: TThis,\n ) {\n if (currentContext) {\n const saved = currentContext;\n try {\n currentContext = null;\n // Function.prototype.apply allows the arguments array argument to be\n // omitted or undefined, so args! is fine here.\n return callback.apply(thisArg!, args!);\n } finally {\n currentContext = saved;\n }\n } else {\n return callback.apply(thisArg!, args!);\n }\n }\n};\n\n// We store a single global implementation of the Slot class as a permanent\n// non-enumerable symbol property of the Array constructor. This obfuscation\n// does nothing to prevent access to the Slot class, but at least it ensures\n// the implementation (i.e. currentContext) cannot be tampered with, and all\n// copies of the @wry/context package (hopefully just one) will share the\n// same Slot implementation. Since the first copy of the @wry/context package\n// to be imported wins, this technique imposes a very high cost for any\n// future breaking changes to the Slot class.\nconst globalKey = \"@wry/context:Slot\";\nconst host = Array as any;\n\nexport const Slot: ReturnType = host[globalKey] || function () {\n const Slot = makeSlotClass();\n try {\n Object.defineProperty(host, globalKey, {\n value: host[globalKey] = Slot,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n } finally {\n return Slot;\n }\n}();\n","import { Slot } from \"./slot\";\nexport { Slot }\nexport const { bind, noContext } = Slot;\n\n// Like global.setTimeout, except the callback runs with captured context.\nexport { setTimeoutWithContext as setTimeout };\nfunction setTimeoutWithContext(callback: () => any, delay: number) {\n return setTimeout(bind(callback), delay);\n}\n\n// Turn any generator function into an async function (using yield instead\n// of await), with context automatically preserved across yields.\nexport function asyncFromGen(\n genFn: (...args: TArgs) => IterableIterator,\n) {\n return function (this: any) {\n const gen = genFn.apply(this, arguments as any);\n const boundNext = bind(gen.next);\n const boundThrow = bind(gen.throw!);\n type Method = typeof boundNext | typeof boundThrow;\n\n return new Promise((resolve, reject) => {\n function invoke(method: Method, argument: any) {\n try {\n var result = method.call(gen, argument);\n } catch (error) {\n return reject(error);\n }\n const next = result.done ? resolve : invokeNext;\n if (isPromiseLike(result.value)) {\n result.value.then(next, result.done ? reject : invokeThrow);\n } else {\n next(result.value);\n }\n }\n const invokeNext = (value?: any) => invoke(boundNext, value);\n const invokeThrow = (error: any) => invoke(boundThrow, error);\n invokeNext();\n });\n } as (...args: TArgs) => Promise;\n}\n\nfunction isPromiseLike(value: any): value is PromiseLike {\n return value && typeof value.then === \"function\";\n}\n\n// If you use the fibers npm package to implement coroutines in Node.js,\n// you should call this function at least once to ensure context management\n// remains coherent across any yields.\nconst wrappedFibers: Function[] = [];\nexport function wrapYieldingFiberMethods(Fiber: F): F {\n // There can be only one implementation of Fiber per process, so this array\n // should never grow longer than one element.\n if (wrappedFibers.indexOf(Fiber) < 0) {\n const wrap = (obj: any, method: string) => {\n const fn = obj[method];\n obj[method] = function () {\n return noContext(fn, arguments as any, this);\n };\n }\n // These methods can yield, according to\n // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100\n wrap(Fiber, \"yield\");\n wrap(Fiber.prototype, \"run\");\n wrap(Fiber.prototype, \"throwInto\");\n wrappedFibers.push(Fiber);\n }\n return Fiber;\n}\n"],"names":[],"mappings":"AAKA;;;AAGA,IAAI,cAAc,GAAmB,IAAI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A,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAA,CAAC;YAC7D,IAAM,WAAW,GAAG,UAAC,KAAU,IAAK,OAAA,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,GAAA,CAAC;YAC9D,UAAU,EAAE,CAAC;SACd,CAAC,CAAC;KACoC,CAAC;CAC3C;AAED,SAAS,aAAa,CAAC,KAAU;IAC/B,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;CAClD;;;;AAKD,IAAM,aAAa,GAAe,EAAE,CAAC;AACrC,SAAgB,wBAAwB,CAAqB,KAAQ;;;IAGnE,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACpC,IAAM,IAAI,GAAG,UAAC,GAAQ,EAAE,MAAc;YACpC,IAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;YACvB,GAAG,CAAC,MAAM,CAAC,GAAG;gBACZ,OAAO,SAAS,CAAC,EAAE,EAAE,SAAgB,EAAE,IAAI,CAAC,CAAC;aAC9C,CAAC;SACH,CAAA;;;QAGD,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACnC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;IACD,OAAO,KAAK,CAAC;CACd;;;;"} \ No newline at end of file diff --git a/node_modules/@wry/context/lib/context.js b/node_modules/@wry/context/lib/context.js new file mode 100644 index 000000000..f21b28dd7 --- /dev/null +++ b/node_modules/@wry/context/lib/context.js @@ -0,0 +1,207 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// This currentContext variable will only be used if the makeSlotClass +// function is called, which happens only if this is the first copy of the +// @wry/context package to be imported. +var currentContext = null; +// This unique internal object is used to denote the absence of a value +// for a given Slot, and is never exposed to outside code. +var MISSING_VALUE = {}; +var idCounter = 1; +// Although we can't do anything about the cost of duplicated code from +// accidentally bundling multiple copies of the @wry/context package, we can +// avoid creating the Slot class more than once using makeSlotClass. +var makeSlotClass = function () { return /** @class */ (function () { + function Slot() { + // If you have a Slot object, you can find out its slot.id, but you cannot + // guess the slot.id of a Slot you don't have access to, thanks to the + // randomized suffix. + this.id = [ + "slot", + idCounter++, + Date.now(), + Math.random().toString(36).slice(2), + ].join(":"); + } + Slot.prototype.hasValue = function () { + for (var context_1 = currentContext; context_1; context_1 = context_1.parent) { + // We use the Slot object iself as a key to its value, which means the + // value cannot be obtained without a reference to the Slot object. + if (this.id in context_1.slots) { + var value = context_1.slots[this.id]; + if (value === MISSING_VALUE) + break; + if (context_1 !== currentContext) { + // Cache the value in currentContext.slots so the next lookup will + // be faster. This caching is safe because the tree of contexts and + // the values of the slots are logically immutable. + currentContext.slots[this.id] = value; + } + return true; + } + } + if (currentContext) { + // If a value was not found for this Slot, it's never going to be found + // no matter how many times we look it up, so we might as well cache + // the absence of the value, too. + currentContext.slots[this.id] = MISSING_VALUE; + } + return false; + }; + Slot.prototype.getValue = function () { + if (this.hasValue()) { + return currentContext.slots[this.id]; + } + }; + Slot.prototype.withValue = function (value, callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + var _a; + var slots = (_a = { + __proto__: null + }, + _a[this.id] = value, + _a); + var parent = currentContext; + currentContext = { parent: parent, slots: slots }; + try { + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = parent; + } + }; + // Capture the current context and wrap a callback function so that it + // reestablishes the captured context when called. + Slot.bind = function (callback) { + var context = currentContext; + return function () { + var saved = currentContext; + try { + currentContext = context; + return callback.apply(this, arguments); + } + finally { + currentContext = saved; + } + }; + }; + // Immediately run a callback function without any captured context. + Slot.noContext = function (callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + if (currentContext) { + var saved = currentContext; + try { + currentContext = null; + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = saved; + } + } + else { + return callback.apply(thisArg, args); + } + }; + return Slot; +}()); }; +// We store a single global implementation of the Slot class as a permanent +// non-enumerable symbol property of the Array constructor. This obfuscation +// does nothing to prevent access to the Slot class, but at least it ensures +// the implementation (i.e. currentContext) cannot be tampered with, and all +// copies of the @wry/context package (hopefully just one) will share the +// same Slot implementation. Since the first copy of the @wry/context package +// to be imported wins, this technique imposes a very high cost for any +// future breaking changes to the Slot class. +var globalKey = "@wry/context:Slot"; +var host = Array; +var Slot = host[globalKey] || function () { + var Slot = makeSlotClass(); + try { + Object.defineProperty(host, globalKey, { + value: host[globalKey] = Slot, + enumerable: false, + writable: false, + configurable: false, + }); + } + finally { + return Slot; + } +}(); + +var bind = Slot.bind, noContext = Slot.noContext; +function setTimeoutWithContext(callback, delay) { + return setTimeout(bind(callback), delay); +} +// Turn any generator function into an async function (using yield instead +// of await), with context automatically preserved across yields. +function asyncFromGen(genFn) { + return function () { + var gen = genFn.apply(this, arguments); + var boundNext = bind(gen.next); + var boundThrow = bind(gen.throw); + return new Promise(function (resolve, reject) { + function invoke(method, argument) { + try { + var result = method.call(gen, argument); + } + catch (error) { + return reject(error); + } + var next = result.done ? resolve : invokeNext; + if (isPromiseLike(result.value)) { + result.value.then(next, result.done ? reject : invokeThrow); + } + else { + next(result.value); + } + } + var invokeNext = function (value) { return invoke(boundNext, value); }; + var invokeThrow = function (error) { return invoke(boundThrow, error); }; + invokeNext(); + }); + }; +} +function isPromiseLike(value) { + return value && typeof value.then === "function"; +} +// If you use the fibers npm package to implement coroutines in Node.js, +// you should call this function at least once to ensure context management +// remains coherent across any yields. +var wrappedFibers = []; +function wrapYieldingFiberMethods(Fiber) { + // There can be only one implementation of Fiber per process, so this array + // should never grow longer than one element. + if (wrappedFibers.indexOf(Fiber) < 0) { + var wrap = function (obj, method) { + var fn = obj[method]; + obj[method] = function () { + return noContext(fn, arguments, this); + }; + }; + // These methods can yield, according to + // https://github.com/laverdet/node-fibers/blob/ddebed9b8ae3883e57f822e2108e6943e5c8d2a8/fibers.js#L97-L100 + wrap(Fiber, "yield"); + wrap(Fiber.prototype, "run"); + wrap(Fiber.prototype, "throwInto"); + wrappedFibers.push(Fiber); + } + return Fiber; +} + +exports.Slot = Slot; +exports.asyncFromGen = asyncFromGen; +exports.bind = bind; +exports.noContext = noContext; +exports.setTimeout = setTimeoutWithContext; +exports.wrapYieldingFiberMethods = wrapYieldingFiberMethods; diff --git a/node_modules/@wry/context/lib/context.js.map b/node_modules/@wry/context/lib/context.js.map new file mode 100644 index 000000000..80f180853 --- /dev/null +++ b/node_modules/@wry/context/lib/context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AACrB,eADA,WAAI,CACA;AACE,QAAA,IAAI,GAAgB,WAAI,OAAlB,QAAA,SAAS,GAAK,WAAI,WAAC;AAIxC,SAAS,qBAAqB,CAAC,QAAmB,EAAE,KAAa;IAC/D,OAAO,UAAU,CAAC,YAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAHiC,2CAAU;AAK5C,0EAA0E;AAC1E,iEAAiE;AACjE,SAAgB,YAAY,CAC1B,KAAoD;IAEpD,OAAO;QACL,IAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,SAAgB,CAAC,CAAC;QAChD,IAAM,SAAS,GAAG,YAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjC,IAAM,UAAU,GAAG,YAAI,CAAC,GAAG,CAAC,KAAM,CAAC,CAAC;QAGpC,OAAO,IAAI,OAAO,CAAU,UAAC,OAAO,EAAE,MAAM;YAC1C,SAAS,M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Q,EAAE,MAAc;YACpC,IAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;YACvB,GAAG,CAAC,MAAM,CAAC,GAAG;gBACZ,OAAO,iBAAS,CAAC,EAAE,EAAE,SAAgB,EAAE,IAAI,CAAC,CAAC;YAC/C,CAAC,CAAC;QACJ,CAAC,CAAA;QACD,wCAAwC;QACxC,2GAA2G;QAC3G,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACnC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC3B;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAlBD,4DAkBC"} \ No newline at end of file diff --git a/node_modules/@wry/context/lib/slot.d.ts b/node_modules/@wry/context/lib/slot.d.ts new file mode 100644 index 000000000..5937e0a98 --- /dev/null +++ b/node_modules/@wry/context/lib/slot.d.ts @@ -0,0 +1,12 @@ +declare const makeSlotClass: () => { + new (): { + readonly id: string; + hasValue(): boolean; + getValue(): TValue | undefined; + withValue(value: TValue, callback: (this: TThis, ...args: TArgs) => TResult, args?: TArgs | undefined, thisArg?: TThis | undefined): TResult; + }; + bind(callback: (...args: TArgs) => TResult): (...args: TArgs) => TResult; + noContext(callback: (this: TThis, ...args: TArgs) => TResult, args?: TArgs | undefined, thisArg?: TThis | undefined): TResult; +}; +export declare const Slot: ReturnType; +export {}; diff --git a/node_modules/@wry/context/lib/slot.js b/node_modules/@wry/context/lib/slot.js new file mode 100644 index 000000000..e1c64f7e5 --- /dev/null +++ b/node_modules/@wry/context/lib/slot.js @@ -0,0 +1,139 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// This currentContext variable will only be used if the makeSlotClass +// function is called, which happens only if this is the first copy of the +// @wry/context package to be imported. +var currentContext = null; +// This unique internal object is used to denote the absence of a value +// for a given Slot, and is never exposed to outside code. +var MISSING_VALUE = {}; +var idCounter = 1; +// Although we can't do anything about the cost of duplicated code from +// accidentally bundling multiple copies of the @wry/context package, we can +// avoid creating the Slot class more than once using makeSlotClass. +var makeSlotClass = function () { return /** @class */ (function () { + function Slot() { + // If you have a Slot object, you can find out its slot.id, but you cannot + // guess the slot.id of a Slot you don't have access to, thanks to the + // randomized suffix. + this.id = [ + "slot", + idCounter++, + Date.now(), + Math.random().toString(36).slice(2), + ].join(":"); + } + Slot.prototype.hasValue = function () { + for (var context_1 = currentContext; context_1; context_1 = context_1.parent) { + // We use the Slot object iself as a key to its value, which means the + // value cannot be obtained without a reference to the Slot object. + if (this.id in context_1.slots) { + var value = context_1.slots[this.id]; + if (value === MISSING_VALUE) + break; + if (context_1 !== currentContext) { + // Cache the value in currentContext.slots so the next lookup will + // be faster. This caching is safe because the tree of contexts and + // the values of the slots are logically immutable. + currentContext.slots[this.id] = value; + } + return true; + } + } + if (currentContext) { + // If a value was not found for this Slot, it's never going to be found + // no matter how many times we look it up, so we might as well cache + // the absence of the value, too. + currentContext.slots[this.id] = MISSING_VALUE; + } + return false; + }; + Slot.prototype.getValue = function () { + if (this.hasValue()) { + return currentContext.slots[this.id]; + } + }; + Slot.prototype.withValue = function (value, callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + var _a; + var slots = (_a = { + __proto__: null + }, + _a[this.id] = value, + _a); + var parent = currentContext; + currentContext = { parent: parent, slots: slots }; + try { + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = parent; + } + }; + // Capture the current context and wrap a callback function so that it + // reestablishes the captured context when called. + Slot.bind = function (callback) { + var context = currentContext; + return function () { + var saved = currentContext; + try { + currentContext = context; + return callback.apply(this, arguments); + } + finally { + currentContext = saved; + } + }; + }; + // Immediately run a callback function without any captured context. + Slot.noContext = function (callback, + // Given the prevalence of arrow functions, specifying arguments is likely + // to be much more common than specifying `this`, hence this ordering: + args, thisArg) { + if (currentContext) { + var saved = currentContext; + try { + currentContext = null; + // Function.prototype.apply allows the arguments array argument to be + // omitted or undefined, so args! is fine here. + return callback.apply(thisArg, args); + } + finally { + currentContext = saved; + } + } + else { + return callback.apply(thisArg, args); + } + }; + return Slot; +}()); }; +// We store a single global implementation of the Slot class as a permanent +// non-enumerable symbol property of the Array constructor. This obfuscation +// does nothing to prevent access to the Slot class, but at least it ensures +// the implementation (i.e. currentContext) cannot be tampered with, and all +// copies of the @wry/context package (hopefully just one) will share the +// same Slot implementation. Since the first copy of the @wry/context package +// to be imported wins, this technique imposes a very high cost for any +// future breaking changes to the Slot class. +var globalKey = "@wry/context:Slot"; +var host = Array; +exports.Slot = host[globalKey] || function () { + var Slot = makeSlotClass(); + try { + Object.defineProperty(host, globalKey, { + value: host[globalKey] = Slot, + enumerable: false, + writable: false, + configurable: false, + }); + } + finally { + return Slot; + } +}(); +//# sourceMappingURL=slot.js.map \ No newline at end of file diff --git a/node_modules/@wry/context/lib/slot.js.map b/node_modules/@wry/context/lib/slot.js.map new file mode 100644 index 000000000..217f845da --- /dev/null +++ b/node_modules/@wry/context/lib/slot.js.map @@ -0,0 +1 @@ +{"version":3,"file":"slot.js","sourceRoot":"","sources":["../src/slot.ts"],"names":[],"mappings":";;AAKA,sEAAsE;AACtE,0EAA0E;AAC1E,uCAAuC;AACvC,IAAI,cAAc,GAAmB,IAAI,CAAC;AAE1C,uEAAuE;AACvE,0DAA0D;AAC1D,IAAM,aAAa,GAAQ,EAAE,CAAC;AAE9B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,uEAAuE;AACvE,4EAA4E;AAC5E,oEAAoE;AACpE,IAAM,aAAa,GAAG,cAAM;IAAA;QAC1B,0EAA0E;QAC1E,sEAAsE;QACtE,qBAAqB;QACL,OAAE,GAAG;YACnB,MAAM;YACN,SAAS,EAAE;YACX,IAAI,CAAC,GAAG,EAAE;YACV,IA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AM,IAAI,GAAG,KAAY,CAAC;AAEb,QAAA,IAAI,GAAqC,IAAI,CAAC,SAAS,CAAC,IAAI;IACvE,IAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,IAAI;QACF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACrC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI;YAC7B,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;KACJ;YAAS;QACR,OAAO,IAAI,CAAC;KACb;AACH,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@wry/context/package.json b/node_modules/@wry/context/package.json new file mode 100644 index 000000000..e72a8338f --- /dev/null +++ b/node_modules/@wry/context/package.json @@ -0,0 +1,33 @@ +{ + "name": "@wry/context", + "version": "0.4.4", + "author": "Ben Newman ", + "description": "Manage contextual information needed by (a)synchronous tasks without explicitly passing objects around", + "license": "MIT", + "main": "lib/context.js", + "module": "lib/context.esm.js", + "types": "lib/context.d.ts", + "keywords": [], + "homepage": "https://github.com/benjamn/wryware", + "repository": { + "type": "git", + "url": "git+https://github.com/benjamn/wryware.git" + }, + "bugs": { + "url": "https://github.com/benjamn/wryware/issues" + }, + "scripts": { + "clean": "../../node_modules/.bin/rimraf lib", + "tsc": "../../node_modules/.bin/tsc", + "rollup": "../../node_modules/.bin/rollup -c", + "build": "npm run clean && npm run tsc && npm run rollup", + "mocha": "../../scripts/test.sh lib/tests.js", + "prepublish": "npm run build", + "test": "npm run build && npm run mocha" + }, + "dependencies": { + "@types/node": ">=6", + "tslib": "^1.9.3" + }, + "gitHead": "50e7d6181b0b937ad54b543118e823ad98e2bca9" +} diff --git a/node_modules/@wry/context/rollup.config.js b/node_modules/@wry/context/rollup.config.js new file mode 100644 index 000000000..10eff1625 --- /dev/null +++ b/node_modules/@wry/context/rollup.config.js @@ -0,0 +1,40 @@ +import typescriptPlugin from 'rollup-plugin-typescript2'; +import typescript from 'typescript'; + +const globals = { + __proto__: null, + tslib: "tslib", +}; + +function external(id) { + return id in globals; +} + +export default [{ + input: "src/context.ts", + external, + output: { + file: "lib/context.esm.js", + format: "esm", + sourcemap: true, + globals, + }, + plugins: [ + typescriptPlugin({ + typescript, + tsconfig: "./tsconfig.rollup.json", + }), + ], +}, { + input: "lib/context.esm.js", + external, + output: { + // Intentionally overwrite the context.js file written by tsc: + file: "lib/context.js", + format: "cjs", + exports: "named", + sourceMap: true, + name: "context", + globals, + }, +}]; diff --git a/node_modules/@wry/context/tsconfig.json b/node_modules/@wry/context/tsconfig.json new file mode 100644 index 000000000..1a79ad1e2 --- /dev/null +++ b/node_modules/@wry/context/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} diff --git a/node_modules/@wry/context/tsconfig.rollup.json b/node_modules/@wry/context/tsconfig.rollup.json new file mode 100644 index 000000000..02085be65 --- /dev/null +++ b/node_modules/@wry/context/tsconfig.rollup.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2015", + }, +} diff --git a/node_modules/@wry/equality/LICENSE b/node_modules/@wry/equality/LICENSE new file mode 100644 index 000000000..306c285a4 --- /dev/null +++ b/node_modules/@wry/equality/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Ben Newman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@wry/equality/README.md b/node_modules/@wry/equality/README.md new file mode 100644 index 000000000..4505ebc6a --- /dev/null +++ b/node_modules/@wry/equality/README.md @@ -0,0 +1,4 @@ +# @wry/equality + +Structural equality checking for JavaScript values, with correct handling +of cyclic references, and minimal bundle size. diff --git a/node_modules/@wry/equality/lib/equality.d.ts b/node_modules/@wry/equality/lib/equality.d.ts new file mode 100644 index 000000000..fa9e8a4fa --- /dev/null +++ b/node_modules/@wry/equality/lib/equality.d.ts @@ -0,0 +1,5 @@ +/** + * Performs a deep equality check on two JavaScript values, tolerating cycles. + */ +export declare function equal(a: any, b: any): boolean; +export default equal; diff --git a/node_modules/@wry/equality/lib/equality.esm.js b/node_modules/@wry/equality/lib/equality.esm.js new file mode 100644 index 000000000..926da2ebc --- /dev/null +++ b/node_modules/@wry/equality/lib/equality.esm.js @@ -0,0 +1,129 @@ +var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty; +var previousComparisons = new Map(); +/** + * Performs a deep equality check on two JavaScript values, tolerating cycles. + */ +function equal(a, b) { + try { + return check(a, b); + } + finally { + previousComparisons.clear(); + } +} +function check(a, b) { + // If the two values are strictly equal, our job is easy. + if (a === b) { + return true; + } + // Object.prototype.toString returns a representation of the runtime type of + // the given value that is considerably more precise than typeof. + var aTag = toString.call(a); + var bTag = toString.call(b); + // If the runtime types of a and b are different, they could maybe be equal + // under some interpretation of equality, but for simplicity and performance + // we just return false instead. + if (aTag !== bTag) { + return false; + } + switch (aTag) { + case '[object Array]': + // Arrays are a lot like other objects, but we can cheaply compare their + // lengths as a short-cut before comparing their elements. + if (a.length !== b.length) + return false; + // Fall through to object case... + case '[object Object]': { + if (previouslyCompared(a, b)) + return true; + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + // If `a` and `b` have a different number of enumerable keys, they + // must be different. + var keyCount = aKeys.length; + if (keyCount !== bKeys.length) + return false; + // Now make sure they have the same keys. + for (var k = 0; k < keyCount; ++k) { + if (!hasOwnProperty.call(b, aKeys[k])) { + return false; + } + } + // Finally, check deep equality of all child properties. + for (var k = 0; k < keyCount; ++k) { + var key = aKeys[k]; + if (!check(a[key], b[key])) { + return false; + } + } + return true; + } + case '[object Error]': + return a.name === b.name && a.message === b.message; + case '[object Number]': + // Handle NaN, which is !== itself. + if (a !== a) + return b !== b; + // Fall through to shared +a === +b case... + case '[object Boolean]': + case '[object Date]': + return +a === +b; + case '[object RegExp]': + case '[object String]': + return a == "" + b; + case '[object Map]': + case '[object Set]': { + if (a.size !== b.size) + return false; + if (previouslyCompared(a, b)) + return true; + var aIterator = a.entries(); + var isMap = aTag === '[object Map]'; + while (true) { + var info = aIterator.next(); + if (info.done) + break; + // If a instanceof Set, aValue === aKey. + var _a = info.value, aKey = _a[0], aValue = _a[1]; + // So this works the same way for both Set and Map. + if (!b.has(aKey)) { + return false; + } + // However, we care about deep equality of values only when dealing + // with Map structures. + if (isMap && !check(aValue, b.get(aKey))) { + return false; + } + } + return true; + } + } + // Otherwise the values are not equal. + return false; +} +function previouslyCompared(a, b) { + // Though cyclic references can make an object graph appear infinite from the + // perspective of a depth-first traversal, the graph still contains a finite + // number of distinct object references. We use the previousComparisons cache + // to avoid comparing the same pair of object references more than once, which + // guarantees termination (even if we end up comparing every object in one + // graph to every object in the other graph, which is extremely unlikely), + // while still allowing weird isomorphic structures (like rings with different + // lengths) a chance to pass the equality test. + var bSet = previousComparisons.get(a); + if (bSet) { + // Return true here because we can be sure false will be returned somewhere + // else if the objects are not equivalent. + if (bSet.has(b)) + return true; + } + else { + previousComparisons.set(a, bSet = new Set); + } + bSet.add(b); + return false; +} + +export default equal; +export { equal }; +//# sourceMappingURL=equality.esm.js.map diff --git a/node_modules/@wry/equality/lib/equality.esm.js.map b/node_modules/@wry/equality/lib/equality.esm.js.map new file mode 100644 index 000000000..79caa7db6 --- /dev/null +++ b/node_modules/@wry/equality/lib/equality.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"equality.esm.js","sources":["../src/equality.ts"],"sourcesContent":["const { toString, hasOwnProperty } = Object.prototype;\nconst previousComparisons = new Map>();\n\n/**\n * Performs a deep equality check on two JavaScript values, tolerating cycles.\n */\nexport function equal(a: any, b: any): boolean {\n try {\n return check(a, b);\n } finally {\n previousComparisons.clear();\n }\n}\n\n// Allow default imports as well.\nexport default equal;\n\nfunction check(a: any, b: any): boolean {\n // If the two values are strictly equal, our job is easy.\n if (a === b) {\n return true;\n }\n\n // Object.prototype.toString returns a representation of the runtime type of\n // the given value that is considerably more precise than typeof.\n const aTag = toString.call(a);\n const bTag = toString.call(b);\n\n // If the runtime types of a and b are different, they could maybe be equal\n // under some interpretation of equality, but for simplicity and performance\n // we just return false instead.\n if (aTag !== bTag) {\n return false;\n }\n\n switch (aTag) {\n case '[object Array]':\n // Arrays are a lot like other objects, but we can cheaply compare their\n // lengths as a short-cut before comparing their elements.\n if (a.length !== b.length) return false;\n // Fall through to object case...\n case '[object Object]': {\n if (previouslyCompared(a, b)) return true;\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n\n // If `a` and `b` have a different number of enumerable keys, they\n // must be different.\n const keyCount = aKeys.length;\n if (keyCount !== bKeys.length) return false;\n\n // Now make sure they have the same keys.\n for (let k = 0; k < keyCount; ++k) {\n if (!hasOwnProperty.call(b, aKeys[k])) {\n return false;\n }\n }\n\n // Finally, check deep equality of all child properties.\n for (let k = 0; k < keyCount; ++k) {\n const key = aKeys[k];\n if (!check(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n case '[object Error]':\n return a.name === b.name && a.message === b.message;\n\n case '[object Number]':\n // Handle NaN, which is !== itself.\n if (a !== a) return b !== b;\n // Fall through to shared +a === +b case...\n case '[object Boolean]':\n case '[object Date]':\n return +a === +b;\n\n case '[object RegExp]':\n case '[object String]':\n return a == `${b}`;\n\n case '[object Map]':\n case '[object Set]': {\n if (a.size !== b.size) return false;\n if (previouslyCompared(a, b)) return true;\n\n const aIterator = a.entries();\n const isMap = aTag === '[object Map]';\n\n while (true) {\n const info = aIterator.next();\n if (info.done) break;\n\n // If a instanceof Set, aValue === aKey.\n const [aKey, aValue] = info.value;\n\n // So this works the same way for both Set and Map.\n if (!b.has(aKey)) {\n return false;\n }\n\n // However, we care about deep equality of values only when dealing\n // with Map structures.\n if (isMap && !check(aValue, b.get(aKey))) {\n return false;\n }\n }\n\n return true;\n }\n }\n\n // Otherwise the values are not equal.\n return false;\n}\n\nfunction previouslyCompared(a: object, b: object): boolean {\n // Though cyclic references can make an object graph appear infinite from the\n // perspective of a depth-first traversal, the graph still contains a finite\n // number of distinct object references. We use the previousComparisons cache\n // to avoid comparing the same pair of object references more than once, which\n // guarantees termination (even if we end up comparing every object in one\n // graph to every object in the other graph, which is extremely unlikely),\n // while still allowing weird isomorphic structures (like rings with different\n // lengths) a chance to pass the equality test.\n let bSet = previousComparisons.get(a);\n if (bSet) {\n // Return true here because we can be sure false will be returned somewhere\n // else if the objects are not equivalent.\n if (bSet.has(b)) return true;\n } else {\n previousComparisons.set(a, bSet = new Set);\n }\n bSet.add(b);\n return false;\n}\n"],"names":[],"mappings":"AAAM,IAAA,qBAA+C,EAA7C,sBAAQ,EAAE,kCAAmC,CAAC;AACtD,IAAM,mBAAmB,GAAG,IAAI,GAAG,EAAuB,CAAC;;;;AAK3D,SAAgB,KAAK,CAAC,CAAM,EAAE,CAAM;IAClC,IAAI;QACF,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACpB;YAAS;QACR,mBAAmB,CAAC,KAAK,EAAE,CAAC;KAC7B;CACF;AAED,AAGA,SAAS,KA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IAGD,OAAO,KAAK,CAAC;CACd;AAED,SAAS,kBAAkB,CAAC,CAAS,EAAE,CAAS;;;;;;;;;IAS9C,IAAI,IAAI,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,IAAI,IAAI,EAAE;;;QAGR,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;KAC9B;SAAM;QACL,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;KAC5C;IACD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,OAAO,KAAK,CAAC;CACd;;;;;"} \ No newline at end of file diff --git a/node_modules/@wry/equality/lib/equality.js b/node_modules/@wry/equality/lib/equality.js new file mode 100644 index 000000000..f4744de4e --- /dev/null +++ b/node_modules/@wry/equality/lib/equality.js @@ -0,0 +1,132 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var _a = Object.prototype, toString = _a.toString, hasOwnProperty = _a.hasOwnProperty; +var previousComparisons = new Map(); +/** + * Performs a deep equality check on two JavaScript values, tolerating cycles. + */ +function equal(a, b) { + try { + return check(a, b); + } + finally { + previousComparisons.clear(); + } +} +function check(a, b) { + // If the two values are strictly equal, our job is easy. + if (a === b) { + return true; + } + // Object.prototype.toString returns a representation of the runtime type of + // the given value that is considerably more precise than typeof. + var aTag = toString.call(a); + var bTag = toString.call(b); + // If the runtime types of a and b are different, they could maybe be equal + // under some interpretation of equality, but for simplicity and performance + // we just return false instead. + if (aTag !== bTag) { + return false; + } + switch (aTag) { + case '[object Array]': + // Arrays are a lot like other objects, but we can cheaply compare their + // lengths as a short-cut before comparing their elements. + if (a.length !== b.length) + return false; + // Fall through to object case... + case '[object Object]': { + if (previouslyCompared(a, b)) + return true; + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + // If `a` and `b` have a different number of enumerable keys, they + // must be different. + var keyCount = aKeys.length; + if (keyCount !== bKeys.length) + return false; + // Now make sure they have the same keys. + for (var k = 0; k < keyCount; ++k) { + if (!hasOwnProperty.call(b, aKeys[k])) { + return false; + } + } + // Finally, check deep equality of all child properties. + for (var k = 0; k < keyCount; ++k) { + var key = aKeys[k]; + if (!check(a[key], b[key])) { + return false; + } + } + return true; + } + case '[object Error]': + return a.name === b.name && a.message === b.message; + case '[object Number]': + // Handle NaN, which is !== itself. + if (a !== a) + return b !== b; + // Fall through to shared +a === +b case... + case '[object Boolean]': + case '[object Date]': + return +a === +b; + case '[object RegExp]': + case '[object String]': + return a == "" + b; + case '[object Map]': + case '[object Set]': { + if (a.size !== b.size) + return false; + if (previouslyCompared(a, b)) + return true; + var aIterator = a.entries(); + var isMap = aTag === '[object Map]'; + while (true) { + var info = aIterator.next(); + if (info.done) + break; + // If a instanceof Set, aValue === aKey. + var _a = info.value, aKey = _a[0], aValue = _a[1]; + // So this works the same way for both Set and Map. + if (!b.has(aKey)) { + return false; + } + // However, we care about deep equality of values only when dealing + // with Map structures. + if (isMap && !check(aValue, b.get(aKey))) { + return false; + } + } + return true; + } + } + // Otherwise the values are not equal. + return false; +} +function previouslyCompared(a, b) { + // Though cyclic references can make an object graph appear infinite from the + // perspective of a depth-first traversal, the graph still contains a finite + // number of distinct object references. We use the previousComparisons cache + // to avoid comparing the same pair of object references more than once, which + // guarantees termination (even if we end up comparing every object in one + // graph to every object in the other graph, which is extremely unlikely), + // while still allowing weird isomorphic structures (like rings with different + // lengths) a chance to pass the equality test. + var bSet = previousComparisons.get(a); + if (bSet) { + // Return true here because we can be sure false will be returned somewhere + // else if the objects are not equivalent. + if (bSet.has(b)) + return true; + } + else { + previousComparisons.set(a, bSet = new Set); + } + bSet.add(b); + return false; +} + +exports.default = equal; +exports.equal = equal; diff --git a/node_modules/@wry/equality/lib/equality.js.map b/node_modules/@wry/equality/lib/equality.js.map new file mode 100644 index 000000000..9b8f42cae --- /dev/null +++ b/node_modules/@wry/equality/lib/equality.js.map @@ -0,0 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C,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@wry/equality/package.json b/node_modules/@wry/equality/package.json new file mode 100644 index 000000000..2a0ebf45c --- /dev/null +++ b/node_modules/@wry/equality/package.json @@ -0,0 +1,32 @@ +{ + "name": "@wry/equality", + "version": "0.1.9", + "author": "Ben Newman ", + "description": "Structural equality checking for JavaScript values", + "license": "MIT", + "main": "lib/equality.js", + "module": "lib/equality.esm.js", + "types": "lib/equality.d.ts", + "keywords": [], + "homepage": "https://github.com/benjamn/wryware", + "repository": { + "type": "git", + "url": "git+https://github.com/benjamn/wryware.git" + }, + "bugs": { + "url": "https://github.com/benjamn/wryware/issues" + }, + "scripts": { + "clean": "../../node_modules/.bin/rimraf lib", + "tsc": "../../node_modules/.bin/tsc", + "rollup": "../../node_modules/.bin/rollup -c", + "build": "npm run clean && npm run tsc && npm run rollup", + "mocha": "../../scripts/test.sh lib/tests.js", + "prepublish": "npm run build", + "test": "npm run build && npm run mocha" + }, + "dependencies": { + "tslib": "^1.9.3" + }, + "gitHead": "50e7d6181b0b937ad54b543118e823ad98e2bca9" +} diff --git a/node_modules/@wry/equality/rollup.config.js b/node_modules/@wry/equality/rollup.config.js new file mode 100644 index 000000000..78c338ca0 --- /dev/null +++ b/node_modules/@wry/equality/rollup.config.js @@ -0,0 +1,40 @@ +import typescriptPlugin from 'rollup-plugin-typescript2'; +import typescript from 'typescript'; + +const globals = { + __proto__: null, + tslib: "tslib", +}; + +function external(id) { + return id in globals; +} + +export default [{ + input: "src/equality.ts", + external, + output: { + file: "lib/equality.esm.js", + format: "esm", + sourcemap: true, + globals, + }, + plugins: [ + typescriptPlugin({ + typescript, + tsconfig: "./tsconfig.rollup.json", + }), + ], +}, { + input: "lib/equality.esm.js", + external, + output: { + // Intentionally overwrite the equality.js file written by tsc: + file: "lib/equality.js", + format: "cjs", + exports: "named", + sourceMap: true, + name: "equality", + globals, + }, +}]; diff --git a/node_modules/@wry/equality/tsconfig.json b/node_modules/@wry/equality/tsconfig.json new file mode 100644 index 000000000..1a79ad1e2 --- /dev/null +++ b/node_modules/@wry/equality/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} diff --git a/node_modules/@wry/equality/tsconfig.rollup.json b/node_modules/@wry/equality/tsconfig.rollup.json new file mode 100644 index 000000000..02085be65 --- /dev/null +++ b/node_modules/@wry/equality/tsconfig.rollup.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2015", + }, +} diff --git a/node_modules/apollo-boost/CHANGELOG.md b/node_modules/apollo-boost/CHANGELOG.md new file mode 100644 index 000000000..091fb36af --- /dev/null +++ b/node_modules/apollo-boost/CHANGELOG.md @@ -0,0 +1,38 @@ +# CHANGELOG + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). + +---- + +### vNext + +- Allow `fetch` to be given as a configuration option to ApolloBoost. + [Issue #3578](https://github.com/apollographql/apollo-client/issues/3578) + [PR #3590](https://github.com/apollographql/apollo-client/pull/3590) +- The `apollo-boost` `ApolloClient` constructor warns about unsupported options. + [PR #3551](https://github.com/apollographql/apollo-client/pull/3551) + +### 0.1.10 + +- No changes. + +### 0.1.9 + +- No changes. + +### 0.1.8 + +- Allow `cache` to be given as a configuration option to `ApolloBoost`. + [Issue #3220](https://github.com/apollographql/apollo-client/issues/3220) + [PR #3561](https://github.com/apollographql/apollo-client/pull/3561) +- Allow `headers` and `credentials` to be passed in as configuration + parameters to the `apollo-boost` `ApolloClient` constructor. + [PR #3098](https://github.com/apollographql/apollo-client/pull/3098) + +### 0.1.7 + +- No public facing functionality changes. +- Various internal code cleanup, tooling and dependency changes. diff --git a/node_modules/apollo-boost/LICENSE b/node_modules/apollo-boost/LICENSE new file mode 100644 index 000000000..278ee9d8c --- /dev/null +++ b/node_modules/apollo-boost/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/apollo-boost/README.md b/node_modules/apollo-boost/README.md new file mode 100644 index 000000000..69d955e89 --- /dev/null +++ b/node_modules/apollo-boost/README.md @@ -0,0 +1,78 @@ +# apollo-boost + +The fastest, easiest way to get started with Apollo Client! + +Apollo Boost is a zero-config way to start using Apollo Client. It includes some sensible defaults, such as our recommended `InMemoryCache` and `HttpLink`, which come configured for you with our recommended settings. + +## Quick start + +First, install `apollo-boost`. If you don't have `graphql` & `react-apollo` already in your project, please install those too. + +```shell +npm i apollo-boost graphql react-apollo -S +``` + +Next, create your client. Once you create your client, hook it up to your app by passing it to the `ApolloProvider` exported from `react-apollo`. + +```js +import React from 'react'; +import { render } from 'react-dom'; +import ApolloClient from 'apollo-boost'; +import { ApolloProvider } from 'react-apollo'; + +// Pass your GraphQL endpoint to uri +const client = new ApolloClient({ uri: 'https://nx9zvp49q7.lp.gql.zone/graphql' }); + +const ApolloApp = AppComponent => ( + + + +); + +render(ApolloApp(App), document.getElementById('root')); +``` + +Awesome! Your ApolloClient is now connected to your app. Let's create our `` component and make our first query: + +```js +import React from 'react'; +import { gql } from 'apollo-boost'; +import { Query } from 'react-apollo'; + +const GET_MOVIES = gql` + query { + movie(id: 1) { + id + title + } + } +` + +const App = () => ( + + {({ loading, error, data }) => { + if (loading) return
Loading...
; + if (error) return
Error :(
; + + return ( + + ) + }} +
+) +``` + +Time to celebrate! 🎉 You just made your first Query component. The Query component binds your GraphQL query to your UI so Apollo Client can take care of fetching your data, tracking loading & error states, and updating your UI via the `data` prop. + +## What's in Apollo Boost + +Apollo Boost includes some packages that we think are essential to developing with Apollo Client. Here's what's in the box: + +- `apollo-client`: Where all the magic happens +- `apollo-cache-inmemory`: Our recommended cache +- `apollo-link-http`: An Apollo Link for remote data fetching +- `apollo-link-error`: An Apollo Link for error handling +- `apollo-link-state`: An Apollo Link for local state management +- `graphql-tag`: Exports the `gql` function for your queries & mutations + +The awesome thing about Apollo Boost is that you don't have to set any of this up yourself! Just specify a few options if you'd like to use these features and we'll take care of the rest. For a full list of available options, please refer to the Apollo Boost [configuration options](https://www.apollographql.com/docs/react/essentials/get-started.html#configuration) documentation. diff --git a/node_modules/apollo-boost/jest.config.js b/node_modules/apollo-boost/jest.config.js new file mode 100644 index 000000000..48f0a891e --- /dev/null +++ b/node_modules/apollo-boost/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../../config/jest.config.settings'), +}; diff --git a/node_modules/apollo-boost/lib/bundle.cjs.js b/node_modules/apollo-boost/lib/bundle.cjs.js new file mode 100644 index 000000000..65a160c8d --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.cjs.js @@ -0,0 +1,176 @@ +exports.__esModule = true; +var _exportNames = { + gql: true, + HttpLink: true +}; +exports.default = exports.gql = void 0; + +var _tslib = require("tslib"); + +var _apolloClient = _interopRequireWildcard(require("apollo-client")); + +Object.keys(_apolloClient).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _apolloClient[key]; +}); + +var _apolloLink = require("apollo-link"); + +Object.keys(_apolloLink).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _apolloLink[key]; +}); + +var _apolloCacheInmemory = require("apollo-cache-inmemory"); + +Object.keys(_apolloCacheInmemory).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + exports[key] = _apolloCacheInmemory[key]; +}); + +var _apolloLinkHttp = require("apollo-link-http"); + +exports.HttpLink = _apolloLinkHttp.HttpLink; + +var _apolloLinkError = require("apollo-link-error"); + +var _graphqlTag = _interopRequireDefault(require("graphql-tag")); + +exports.gql = _graphqlTag.default; + +var _tsInvariant = require("ts-invariant"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + +var PRESET_CONFIG_KEYS = ['request', 'uri', 'credentials', 'headers', 'fetch', 'fetchOptions', 'clientState', 'onError', 'cacheRedirects', 'cache', 'name', 'version', 'resolvers', 'typeDefs', 'fragmentMatcher']; + +var DefaultClient = function (_super) { + (0, _tslib.__extends)(DefaultClient, _super); + + function DefaultClient(config) { + if (config === void 0) { + config = {}; + } + + var _this = this; + + if (config) { + var diff = Object.keys(config).filter(function (key) { + return PRESET_CONFIG_KEYS.indexOf(key) === -1; + }); + + if (diff.length > 0) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('ApolloBoost was initialized with unsupported options: ' + ("" + diff.join(' '))); + } + } + + var request = config.request, + uri = config.uri, + credentials = config.credentials, + headers = config.headers, + fetch = config.fetch, + fetchOptions = config.fetchOptions, + clientState = config.clientState, + cacheRedirects = config.cacheRedirects, + errorCallback = config.onError, + name = config.name, + version = config.version, + resolvers = config.resolvers, + typeDefs = config.typeDefs, + fragmentMatcher = config.fragmentMatcher; + var cache = config.cache; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!cache || !cacheRedirects, 1) : (0, _tsInvariant.invariant)(!cache || !cacheRedirects, 'Incompatible cache configuration. When not providing `cache`, ' + 'configure the provided instance with `cacheRedirects` instead.'); + + if (!cache) { + cache = cacheRedirects ? new _apolloCacheInmemory.InMemoryCache({ + cacheRedirects: cacheRedirects + }) : new _apolloCacheInmemory.InMemoryCache(); + } + + var errorLink = errorCallback ? (0, _apolloLinkError.onError)(errorCallback) : (0, _apolloLinkError.onError)(function (_a) { + var graphQLErrors = _a.graphQLErrors, + networkError = _a.networkError; + + if (graphQLErrors) { + graphQLErrors.map(function (_a) { + var message = _a.message, + locations = _a.locations, + path = _a.path; + return process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("[GraphQL error]: Message: " + message + ", Location: " + (locations + ", Path: " + path)); + }); + } + + if (networkError) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("[Network error]: " + networkError); + } + }); + var requestHandler = request ? new _apolloLink.ApolloLink(function (operation, forward) { + return new _apolloLink.Observable(function (observer) { + var handle; + Promise.resolve(operation).then(function (oper) { + return request(oper); + }).then(function () { + handle = forward(operation).subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer) + }); + }).catch(observer.error.bind(observer)); + return function () { + if (handle) { + handle.unsubscribe(); + } + }; + }); + }) : false; + var httpLink = new _apolloLinkHttp.HttpLink({ + uri: uri || '/graphql', + fetch: fetch, + fetchOptions: fetchOptions || {}, + credentials: credentials || 'same-origin', + headers: headers || {} + }); + + var link = _apolloLink.ApolloLink.from([errorLink, requestHandler, httpLink].filter(function (x) { + return !!x; + })); + + var activeResolvers = resolvers; + var activeTypeDefs = typeDefs; + var activeFragmentMatcher = fragmentMatcher; + + if (clientState) { + if (clientState.defaults) { + cache.writeData({ + data: clientState.defaults + }); + } + + activeResolvers = clientState.resolvers; + activeTypeDefs = clientState.typeDefs; + activeFragmentMatcher = clientState.fragmentMatcher; + } + + _this = _super.call(this, { + cache: cache, + link: link, + name: name, + version: version, + resolvers: activeResolvers, + typeDefs: activeTypeDefs, + fragmentMatcher: activeFragmentMatcher + }) || this; + return _this; + } + + return DefaultClient; +}(_apolloClient.default); + +var _default = DefaultClient; + +exports.default = _default; diff --git a/node_modules/apollo-boost/lib/bundle.cjs.js.map b/node_modules/apollo-boost/lib/bundle.cjs.js.map new file mode 100644 index 000000000..75dfbf4ff --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.ts"],"names":["ApolloClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,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,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ACD;;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;\n defaults?: Record;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\n};\n\nexport interface PresetConfig {\n request?: (operation: Operation) => Promise | void;\n uri?: string | UriFunction;\n credentials?: string;\n headers?: any;\n fetch?: GlobalFetch['fetch'];\n fetchOptions?: HttpLink.Options;\n clientState?: ClientStateConfig;\n onError?: ErrorLink.ErrorHandler;\n cacheRedirects?: CacheResolverMap;\n cache?: ApolloCache;\n name?: string;\n version?: string;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\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 extends ApolloClient {\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.map(({ 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"]} \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/bundle.cjs.min.js b/node_modules/apollo-boost/lib/bundle.cjs.min.js new file mode 100644 index 000000000..9d89d2d08 --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.cjs.min.js @@ -0,0 +1 @@ +exports.__esModule=!0;var e={gql:!0,HttpLink:!0};exports.default=exports.gql=void 0;var r=require("tslib"),t=function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,t):{};n.get||n.set?Object.defineProperty(r,t,n):r[t]=e[t]}return r.default=e,r}(require("apollo-client"));Object.keys(t).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=t[r]))});var n=require("apollo-link");Object.keys(n).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=n[r]))});var o=require("apollo-cache-inmemory");Object.keys(o).forEach(function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||(exports[r]=o[r]))});var a=require("apollo-link-http");exports.HttpLink=a.HttpLink;var i,c=require("apollo-link-error"),s=(i=require("graphql-tag"))&&i.__esModule?i:{default:i};exports.gql=s.default;var l=require("ts-invariant");var u=["request","uri","credentials","headers","fetch","fetchOptions","clientState","onError","cacheRedirects","cache","name","version","resolvers","typeDefs","fragmentMatcher"],f=function(e){function t(r){void 0===r&&(r={});if(r){var t=Object.keys(r).filter(function(e){return-1===u.indexOf(e)});t.length}var i=r.request,s=r.uri,f=r.credentials,p=r.headers,h=r.fetch,d=r.fetchOptions,v=r.clientState,b=r.cacheRedirects,y=r.onError,O=r.name,m=r.version,g=r.resolvers,k=r.typeDefs,q=r.fragmentMatcher,_=r.cache;(0,l.invariant)(!_||!b,1),_||(_=b?new o.InMemoryCache({cacheRedirects:b}):new o.InMemoryCache);var w=y?(0,c.onError)(y):(0,c.onError)(function(e){var r=e.graphQLErrors;e.networkError;r&&r.map(function(e){e.message,e.locations,e.path;return!0})}),x=!!i&&new n.ApolloLink(function(e,r){return new n.Observable(function(t){var n;return Promise.resolve(e).then(function(e){return i(e)}).then(function(){n=r(e).subscribe({next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)})}).catch(t.error.bind(t)),function(){n&&n.unsubscribe()}})}),j=new a.HttpLink({uri:s||"/graphql",fetch:h,fetchOptions:d||{},credentials:f||"same-origin",headers:p||{}}),M=n.ApolloLink.from([w,x,j].filter(function(e){return!!e})),E=g,P=k,D=q;return v&&(v.defaults&&_.writeData({data:v.defaults}),E=v.resolvers,P=v.typeDefs,D=v.fragmentMatcher),e.call(this,{cache:_,link:M,name:O,version:m,resolvers:E,typeDefs:P,fragmentMatcher:D})||this}return(0,r.__extends)(t,e),t}(t.default);exports.default=f; diff --git a/node_modules/apollo-boost/lib/bundle.esm.js b/node_modules/apollo-boost/lib/bundle.esm.js new file mode 100644 index 000000000..eea5fdc11 --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.esm.js @@ -0,0 +1,125 @@ +import { __extends } from 'tslib'; +import ApolloClient__default from 'apollo-client'; +export * from 'apollo-client'; +import { ApolloLink, Observable } from 'apollo-link'; +export * from 'apollo-link'; +import { InMemoryCache } from 'apollo-cache-inmemory'; +export * from 'apollo-cache-inmemory'; +import { HttpLink } from 'apollo-link-http'; +export { HttpLink } from 'apollo-link-http'; +import { onError } from 'apollo-link-error'; +export { default as gql } from 'graphql-tag'; +import { invariant } from 'ts-invariant'; + +var PRESET_CONFIG_KEYS = [ + 'request', + 'uri', + 'credentials', + 'headers', + 'fetch', + 'fetchOptions', + 'clientState', + 'onError', + 'cacheRedirects', + 'cache', + 'name', + 'version', + 'resolvers', + 'typeDefs', + 'fragmentMatcher', +]; +var DefaultClient = (function (_super) { + __extends(DefaultClient, _super); + function DefaultClient(config) { + if (config === void 0) { config = {}; } + var _this = this; + if (config) { + var diff = Object.keys(config).filter(function (key) { return PRESET_CONFIG_KEYS.indexOf(key) === -1; }); + if (diff.length > 0) { + process.env.NODE_ENV === "production" || invariant.warn('ApolloBoost was initialized with unsupported options: ' + + ("" + diff.join(' '))); + } + } + var request = config.request, uri = config.uri, credentials = config.credentials, headers = config.headers, fetch = config.fetch, fetchOptions = config.fetchOptions, clientState = config.clientState, cacheRedirects = config.cacheRedirects, errorCallback = config.onError, name = config.name, version = config.version, resolvers = config.resolvers, typeDefs = config.typeDefs, fragmentMatcher = config.fragmentMatcher; + var cache = config.cache; + process.env.NODE_ENV === "production" ? invariant(!cache || !cacheRedirects, 1) : invariant(!cache || !cacheRedirects, 'Incompatible cache configuration. When not providing `cache`, ' + + 'configure the provided instance with `cacheRedirects` instead.'); + if (!cache) { + cache = cacheRedirects + ? new InMemoryCache({ cacheRedirects: cacheRedirects }) + : new InMemoryCache(); + } + var errorLink = errorCallback + ? onError(errorCallback) + : onError(function (_a) { + var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError; + if (graphQLErrors) { + graphQLErrors.map(function (_a) { + var message = _a.message, locations = _a.locations, path = _a.path; + return process.env.NODE_ENV === "production" || invariant.warn("[GraphQL error]: Message: " + message + ", Location: " + + (locations + ", Path: " + path)); + }); + } + if (networkError) { + process.env.NODE_ENV === "production" || invariant.warn("[Network error]: " + networkError); + } + }); + var requestHandler = request + ? new ApolloLink(function (operation, forward) { + return new Observable(function (observer) { + var handle; + Promise.resolve(operation) + .then(function (oper) { return request(oper); }) + .then(function () { + handle = forward(operation).subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + }) + .catch(observer.error.bind(observer)); + return function () { + if (handle) { + handle.unsubscribe(); + } + }; + }); + }) + : false; + var httpLink = new HttpLink({ + uri: uri || '/graphql', + fetch: fetch, + fetchOptions: fetchOptions || {}, + credentials: credentials || 'same-origin', + headers: headers || {}, + }); + var link = ApolloLink.from([errorLink, requestHandler, httpLink].filter(function (x) { return !!x; })); + var activeResolvers = resolvers; + var activeTypeDefs = typeDefs; + var activeFragmentMatcher = fragmentMatcher; + if (clientState) { + if (clientState.defaults) { + cache.writeData({ + data: clientState.defaults, + }); + } + activeResolvers = clientState.resolvers; + activeTypeDefs = clientState.typeDefs; + activeFragmentMatcher = clientState.fragmentMatcher; + } + _this = _super.call(this, { + cache: cache, + link: link, + name: name, + version: version, + resolvers: activeResolvers, + typeDefs: activeTypeDefs, + fragmentMatcher: activeFragmentMatcher, + }) || this; + return _this; + } + return DefaultClient; +}(ApolloClient__default)); + +export default DefaultClient; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-boost/lib/bundle.esm.js.map b/node_modules/apollo-boost/lib/bundle.esm.js.map new file mode 100644 index 000000000..3b2fd776a --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"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;\n defaults?: Record;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\n};\n\nexport interface PresetConfig {\n request?: (operation: Operation) => Promise | void;\n uri?: string | UriFunction;\n credentials?: string;\n headers?: any;\n fetch?: GlobalFetch['fetch'];\n fetchOptions?: HttpLink.Options;\n clientState?: ClientStateConfig;\n onError?: ErrorLink.ErrorHandler;\n cacheRedirects?: CacheResolverMap;\n cache?: ApolloCache;\n name?: string;\n version?: string;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\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 extends ApolloClient {\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.map(({ 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"],"names":["tslib_1.__extends","ApolloClient"],"mappings":";;;;;;;;;;;;;AAwDA,IAAM,kBAAkB,GAAG;IACzB,SAAS;IACT,KAAK;IACL,aAAa;IACb,SAAS;IACT,OAAO;IACP,cAAc;IACd,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,UAAU;IACV,iBAAiB;CAClB,CAAC;AAEF;IAAmDA,iCAAoB;IACrE,uBAAY,MAAyB;QAAzB,uBAAA,EAAA,WAAyB;QAArC,iBA4HC;QA3HC,IAAI,MAAM,EAAE;YACV,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CACrC,UAAA,GAAG,IAAI,OAAA,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAA,CAC9C,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnB;qBAEI,KAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAG,CAAA,CACtB,CAAC;aACH;SACF;QAGC,IAA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I,MAAA;YACJ,OAAO,SAAA;YACP,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,cAAc;YACxB,eAAe,EAAE,qBAAqB;SAChC,CAAC,SAAC;;KACX;IACH,oBAAC;CA9HD,CAAmDC,qBAAY,GA8H9D;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/bundle.umd.js b/node_modules/apollo-boost/lib/bundle.umd.js new file mode 100644 index 000000000..f0eba4236 --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.umd.js @@ -0,0 +1,172 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "tslib", "apollo-client", "apollo-link", "apollo-cache-inmemory", "apollo-link-http", "apollo-link-error", "graphql-tag", "ts-invariant"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("tslib"), require("apollo-client"), require("apollo-link"), require("apollo-cache-inmemory"), require("apollo-link-http"), require("apollo-link-error"), require("graphql-tag"), require("ts-invariant")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.tslib, global.apolloClient, global.apolloLink, global.apolloCacheInmemory, global.apolloLinkHttp, global.apolloLinkError, global.graphqlTag, global.tsInvariant); + global.unknown = mod.exports; + } +})(this, function (_exports, _tslib, _apolloClient, _apolloLink, _apolloCacheInmemory, _apolloLinkHttp, _apolloLinkError, _graphqlTag, _tsInvariant) { + + _exports.__esModule = true; + var _exportNames = { + gql: true, + HttpLink: true + }; + _exports.default = _exports.gql = void 0; + _apolloClient = _interopRequireWildcard(_apolloClient); + Object.keys(_apolloClient).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + _exports[key] = _apolloClient[key]; + }); + Object.keys(_apolloLink).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + _exports[key] = _apolloLink[key]; + }); + Object.keys(_apolloCacheInmemory).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + _exports[key] = _apolloCacheInmemory[key]; + }); + _exports.HttpLink = _apolloLinkHttp.HttpLink; + _graphqlTag = _interopRequireDefault(_graphqlTag); + _exports.gql = _graphqlTag.default; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } + + var PRESET_CONFIG_KEYS = ['request', 'uri', 'credentials', 'headers', 'fetch', 'fetchOptions', 'clientState', 'onError', 'cacheRedirects', 'cache', 'name', 'version', 'resolvers', 'typeDefs', 'fragmentMatcher']; + + var DefaultClient = function (_super) { + (0, _tslib.__extends)(DefaultClient, _super); + + function DefaultClient(config) { + if (config === void 0) { + config = {}; + } + + var _this = this; + + if (config) { + var diff = Object.keys(config).filter(function (key) { + return PRESET_CONFIG_KEYS.indexOf(key) === -1; + }); + + if (diff.length > 0) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('ApolloBoost was initialized with unsupported options: ' + ("" + diff.join(' '))); + } + } + + var request = config.request, + uri = config.uri, + credentials = config.credentials, + headers = config.headers, + fetch = config.fetch, + fetchOptions = config.fetchOptions, + clientState = config.clientState, + cacheRedirects = config.cacheRedirects, + errorCallback = config.onError, + name = config.name, + version = config.version, + resolvers = config.resolvers, + typeDefs = config.typeDefs, + fragmentMatcher = config.fragmentMatcher; + var cache = config.cache; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!cache || !cacheRedirects, 1) : (0, _tsInvariant.invariant)(!cache || !cacheRedirects, 'Incompatible cache configuration. When not providing `cache`, ' + 'configure the provided instance with `cacheRedirects` instead.'); + + if (!cache) { + cache = cacheRedirects ? new _apolloCacheInmemory.InMemoryCache({ + cacheRedirects: cacheRedirects + }) : new _apolloCacheInmemory.InMemoryCache(); + } + + var errorLink = errorCallback ? (0, _apolloLinkError.onError)(errorCallback) : (0, _apolloLinkError.onError)(function (_a) { + var graphQLErrors = _a.graphQLErrors, + networkError = _a.networkError; + + if (graphQLErrors) { + graphQLErrors.map(function (_a) { + var message = _a.message, + locations = _a.locations, + path = _a.path; + return process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("[GraphQL error]: Message: " + message + ", Location: " + (locations + ", Path: " + path)); + }); + } + + if (networkError) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("[Network error]: " + networkError); + } + }); + var requestHandler = request ? new _apolloLink.ApolloLink(function (operation, forward) { + return new _apolloLink.Observable(function (observer) { + var handle; + Promise.resolve(operation).then(function (oper) { + return request(oper); + }).then(function () { + handle = forward(operation).subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer) + }); + }).catch(observer.error.bind(observer)); + return function () { + if (handle) { + handle.unsubscribe(); + } + }; + }); + }) : false; + var httpLink = new _apolloLinkHttp.HttpLink({ + uri: uri || '/graphql', + fetch: fetch, + fetchOptions: fetchOptions || {}, + credentials: credentials || 'same-origin', + headers: headers || {} + }); + + var link = _apolloLink.ApolloLink.from([errorLink, requestHandler, httpLink].filter(function (x) { + return !!x; + })); + + var activeResolvers = resolvers; + var activeTypeDefs = typeDefs; + var activeFragmentMatcher = fragmentMatcher; + + if (clientState) { + if (clientState.defaults) { + cache.writeData({ + data: clientState.defaults + }); + } + + activeResolvers = clientState.resolvers; + activeTypeDefs = clientState.typeDefs; + activeFragmentMatcher = clientState.fragmentMatcher; + } + + _this = _super.call(this, { + cache: cache, + link: link, + name: name, + version: version, + resolvers: activeResolvers, + typeDefs: activeTypeDefs, + fragmentMatcher: activeFragmentMatcher + }) || this; + return _this; + } + + return DefaultClient; + }(_apolloClient.default); + + var _default = DefaultClient; + + _exports.default = _default; +}); diff --git a/node_modules/apollo-boost/lib/bundle.umd.js.map b/node_modules/apollo-boost/lib/bundle.umd.js.map new file mode 100644 index 000000000..16520feb7 --- /dev/null +++ b/node_modules/apollo-boost/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/index.ts"],"names":["ApolloClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,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,MAAA,aAAA,GAAA,UAAA,MAAA,EAAA;AAAmDA,0BAAAA,aAAAA,EAAAA,MAAAA;;AACjD,aAAA,aAAA,CAAY,MAAZ,EAAqC;AAAzB,UAAA,MAAA,KAAA,KAAA,CAAA,EAAA;AAAA,QAAA,MAAA,GAAA,EAAA;AAAyB;;AAArC,UAAA,KAAA,GAAA,IAAA;;AACE,UAAI,MAAJ,EAAY;AACV,YAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,MAAZ,EAAoB,MAApB,CACX,UAAA,GAAA,EAAG;AAAI,iBAAA,kBAAkB,CAAC,OAAnB,CAA2B,GAA3B,MAAoC,CAAC,CAArC;AAAsC,SADlC,CAAb;;AAIA,YAAI,IAAI,CAAC,MAAL,GAAc,CAAlB,EAAqB;AACnB,UAAA,OAAA,CAAA,GAAA,CAAA,QAAA,KAAA,YAAA,IAAA,uBAAA,IAAA,CAAA,4DAEI,KAAG,IAAI,CAAC,IAAL,CAAU,GAAV,CAFP,CAAA,CAAA;AAID;AACF;;AAGC,UAAA,OAAA,GAAA,MAAA,CAAA,OAAA;AAAA,UACA,GAAA,GAAA,MAAA,CAA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J,CAAa;AAC5B,QAAA,GAAG,EAAE,GAAG,IAAI,UADgB;AAE5B,QAAA,KAAK,EAAA,KAFuB;AAG5B,QAAA,YAAY,EAAE,YAAY,IAAI,EAHF;AAI5B,QAAA,WAAW,EAAE,WAAW,IAAI,aAJA;AAK5B,QAAA,OAAO,EAAE,OAAO,IAAI;AALQ,OAAb,CAAjB;;AAQA,UAAM,IAAI,GAAG,uBAAW,IAAX,CAAgB,CAAC,SAAD,EAAY,cAAZ,EAA4B,QAA5B,EAAsC,MAAtC,CAC3B,UAAA,CAAA,EAAC;AAAI,eAAA,CAAC,CAAC,CAAF;AAAG,OADmB,CAAhB,CAAb;;AAIA,UAAI,eAAe,GAAG,SAAtB;AACA,UAAI,cAAc,GAAG,QAArB;AACA,UAAI,qBAAqB,GAAG,eAA5B;;AACA,UAAI,WAAJ,EAAiB;AACf,YAAI,WAAW,CAAC,QAAhB,EAA0B;AACxB,UAAA,KAAK,CAAC,SAAN,CAAgB;AACd,YAAA,IAAI,EAAE,WAAW,CAAC;AADJ,WAAhB;AAGD;;AACD,QAAA,eAAe,GAAG,WAAW,CAAC,SAA9B;AACA,QAAA,cAAc,GAAG,WAAW,CAAC,QAA7B;AACA,QAAA,qBAAqB,GAAG,WAAW,CAAC,eAApC;AACD;;AAGD,MAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM;AACJ,QAAA,KAAK,EAAA,KADD;AAEJ,QAAA,IAAI,EAAA,IAFA;AAGJ,QAAA,IAAI,EAAA,IAHA;AAIJ,QAAA,OAAO,EAAA,OAJH;AAKJ,QAAA,SAAS,EAAE,eALP;AAMJ,QAAA,QAAQ,EAAE,cANN;AAOJ,QAAA,eAAe,EAAE;AAPb,OAAN,KAQS,IART;;AASD;;AACH,WAAA,aAAA;AA9HA,GAAA,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;\n defaults?: Record;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\n};\n\nexport interface PresetConfig {\n request?: (operation: Operation) => Promise | void;\n uri?: string | UriFunction;\n credentials?: string;\n headers?: any;\n fetch?: GlobalFetch['fetch'];\n fetchOptions?: HttpLink.Options;\n clientState?: ClientStateConfig;\n onError?: ErrorLink.ErrorHandler;\n cacheRedirects?: CacheResolverMap;\n cache?: ApolloCache;\n name?: string;\n version?: string;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\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 extends ApolloClient {\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.map(({ 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"]} \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/index.d.ts b/node_modules/apollo-boost/lib/index.d.ts new file mode 100644 index 000000000..ce85dd53f --- /dev/null +++ b/node_modules/apollo-boost/lib/index.d.ts @@ -0,0 +1,40 @@ +export * from 'apollo-client'; +export * from 'apollo-link'; +export * from 'apollo-cache-inmemory'; +import { Operation } from 'apollo-link'; +import { HttpLink, UriFunction } from 'apollo-link-http'; +import { ErrorLink } from 'apollo-link-error'; +import { ApolloCache } from 'apollo-cache'; +import { CacheResolverMap } from 'apollo-cache-inmemory'; +import gql from 'graphql-tag'; +import ApolloClient, { Resolvers, LocalStateFragmentMatcher } from 'apollo-client'; +import { DocumentNode } from 'graphql'; +export { gql, HttpLink }; +declare type ClientStateConfig = { + cache?: ApolloCache; + defaults?: Record; + resolvers?: Resolvers | Resolvers[]; + typeDefs?: string | string[] | DocumentNode | DocumentNode[]; + fragmentMatcher?: LocalStateFragmentMatcher; +}; +export interface PresetConfig { + request?: (operation: Operation) => Promise | void; + uri?: string | UriFunction; + credentials?: string; + headers?: any; + fetch?: GlobalFetch['fetch']; + fetchOptions?: HttpLink.Options; + clientState?: ClientStateConfig; + onError?: ErrorLink.ErrorHandler; + cacheRedirects?: CacheResolverMap; + cache?: ApolloCache; + name?: string; + version?: string; + resolvers?: Resolvers | Resolvers[]; + typeDefs?: string | string[] | DocumentNode | DocumentNode[]; + fragmentMatcher?: LocalStateFragmentMatcher; +} +export default class DefaultClient extends ApolloClient { + constructor(config?: PresetConfig); +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/index.d.ts.map b/node_modules/apollo-boost/lib/index.d.ts.map new file mode 100644 index 000000000..c3cd8b4cd --- /dev/null +++ b/node_modules/apollo-boost/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,SAAS,EAA0B,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAW,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAiB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,YAAY,EAAE,EACnB,SAAS,EACT,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAEzB,aAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;IAC7D,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzD,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC;IACjC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,KAAK,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY,GAAG,YAAY,EAAE,CAAC;IAC7D,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AA8BD,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,MAAM,CAAE,SAAQ,YAAY,CAAC,MAAM,CAAC;gBACzD,MAAM,GAAE,YAAiB;CA6HtC"} \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/index.js b/node_modules/apollo-boost/lib/index.js new file mode 100644 index 000000000..2f2081775 --- /dev/null +++ b/node_modules/apollo-boost/lib/index.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("apollo-client"), exports); +tslib_1.__exportStar(require("apollo-link"), exports); +tslib_1.__exportStar(require("apollo-cache-inmemory"), exports); +var apollo_link_1 = require("apollo-link"); +var apollo_link_http_1 = require("apollo-link-http"); +exports.HttpLink = apollo_link_http_1.HttpLink; +var apollo_link_error_1 = require("apollo-link-error"); +var apollo_cache_inmemory_1 = require("apollo-cache-inmemory"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +exports.gql = graphql_tag_1.default; +var apollo_client_1 = tslib_1.__importDefault(require("apollo-client")); +var ts_invariant_1 = require("ts-invariant"); +var PRESET_CONFIG_KEYS = [ + 'request', + 'uri', + 'credentials', + 'headers', + 'fetch', + 'fetchOptions', + 'clientState', + 'onError', + 'cacheRedirects', + 'cache', + 'name', + 'version', + 'resolvers', + 'typeDefs', + 'fragmentMatcher', +]; +var DefaultClient = (function (_super) { + tslib_1.__extends(DefaultClient, _super); + function DefaultClient(config) { + if (config === void 0) { config = {}; } + var _this = this; + if (config) { + var diff = Object.keys(config).filter(function (key) { return PRESET_CONFIG_KEYS.indexOf(key) === -1; }); + if (diff.length > 0) { + ts_invariant_1.invariant.warn('ApolloBoost was initialized with unsupported options: ' + + ("" + diff.join(' '))); + } + } + var request = config.request, uri = config.uri, credentials = config.credentials, headers = config.headers, fetch = config.fetch, fetchOptions = config.fetchOptions, clientState = config.clientState, cacheRedirects = config.cacheRedirects, errorCallback = config.onError, name = config.name, version = config.version, resolvers = config.resolvers, typeDefs = config.typeDefs, fragmentMatcher = config.fragmentMatcher; + var cache = config.cache; + ts_invariant_1.invariant(!cache || !cacheRedirects, 'Incompatible cache configuration. When not providing `cache`, ' + + 'configure the provided instance with `cacheRedirects` instead.'); + if (!cache) { + cache = cacheRedirects + ? new apollo_cache_inmemory_1.InMemoryCache({ cacheRedirects: cacheRedirects }) + : new apollo_cache_inmemory_1.InMemoryCache(); + } + var errorLink = errorCallback + ? apollo_link_error_1.onError(errorCallback) + : apollo_link_error_1.onError(function (_a) { + var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError; + if (graphQLErrors) { + graphQLErrors.map(function (_a) { + var message = _a.message, locations = _a.locations, path = _a.path; + return ts_invariant_1.invariant.warn("[GraphQL error]: Message: " + message + ", Location: " + + (locations + ", Path: " + path)); + }); + } + if (networkError) { + ts_invariant_1.invariant.warn("[Network error]: " + networkError); + } + }); + var requestHandler = request + ? new apollo_link_1.ApolloLink(function (operation, forward) { + return new apollo_link_1.Observable(function (observer) { + var handle; + Promise.resolve(operation) + .then(function (oper) { return request(oper); }) + .then(function () { + handle = forward(operation).subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + }) + .catch(observer.error.bind(observer)); + return function () { + if (handle) { + handle.unsubscribe(); + } + }; + }); + }) + : false; + var httpLink = new apollo_link_http_1.HttpLink({ + uri: uri || '/graphql', + fetch: fetch, + fetchOptions: fetchOptions || {}, + credentials: credentials || 'same-origin', + headers: headers || {}, + }); + var link = apollo_link_1.ApolloLink.from([errorLink, requestHandler, httpLink].filter(function (x) { return !!x; })); + var activeResolvers = resolvers; + var activeTypeDefs = typeDefs; + var activeFragmentMatcher = fragmentMatcher; + if (clientState) { + if (clientState.defaults) { + cache.writeData({ + data: clientState.defaults, + }); + } + activeResolvers = clientState.resolvers; + activeTypeDefs = clientState.typeDefs; + activeFragmentMatcher = clientState.fragmentMatcher; + } + _this = _super.call(this, { + cache: cache, + link: link, + name: name, + version: version, + resolvers: activeResolvers, + typeDefs: activeTypeDefs, + fragmentMatcher: activeFragmentMatcher, + }) || this; + return _this; + } + return DefaultClient; +}(apollo_client_1.default)); +exports.default = DefaultClient; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-boost/lib/index.js.map b/node_modules/apollo-boost/lib/index.js.map new file mode 100644 index 000000000..97a1cf830 --- /dev/null +++ b/node_modules/apollo-boost/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,wDAA8B;AAC9B,sDAA4B;AAC5B,gEAAsC;AAEtC,2CAAgE;AAChE,qDAAyD;AAY3C,mBAZL,2BAAQ,CAYK;AAXtB,uDAAuD;AAEvD,+DAAwE;AACxE,oEAA8B;AAQr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new file mode 100644 index 000000000..bab4efd15 --- /dev/null +++ b/node_modules/apollo-boost/package.json @@ -0,0 +1,52 @@ +{ + "name": "apollo-boost", + "version": "0.4.3", + "description": "The easiest way to get started with Apollo Client", + "author": "Peggy Rayzis ", + "contributors": [ + "James Baxley ", + "Sashko Stubailo ", + "James Burgess " + ], + "license": "MIT", + "main": "./lib/bundle.cjs.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-client.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-client/issues" + }, + "homepage": "https://github.com/apollographql/apollo-client#readme", + "scripts": { + "prepare": "npm run lint && npm run build", + "test": "tsc -p tsconfig.json --noEmit && jest", + "coverage": "jest --coverage", + "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts", + "prebuild": "npm run clean", + "build": "tsc -b .", + "postbuild": "npm run bundle", + "watch": "tsc -w -p .", + "clean": "rm -rf coverage/* lib/*", + "prepublishOnly": "npm run build", + "bundle": "../../node_modules/rollup/bin/rollup -c rollup.config.js" + }, + "dependencies": { + "apollo-cache": "^1.3.2", + "apollo-cache-inmemory": "^1.6.2", + "apollo-client": "^2.6.3", + "apollo-link": "^1.0.6", + "apollo-link-error": "^1.0.3", + "apollo-link-http": "^1.3.1", + "graphql-tag": "^2.4.2", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "peerDependencies": { + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "gitHead": "eb75e0e40224b78026234b0d133f6718cf83880f" +} diff --git a/node_modules/apollo-boost/src/__tests__/__snapshots__/config.ts.snap b/node_modules/apollo-boost/src/__tests__/__snapshots__/config.ts.snap new file mode 100644 index 000000000..495a3b731 --- /dev/null +++ b/node_modules/apollo-boost/src/__tests__/__snapshots__/config.ts.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`config warns about unsupported parameter 1`] = ` +Array [ + Array [ + "ApolloBoost was initialized with unsupported options: link", + ], +] +`; diff --git a/node_modules/apollo-boost/src/__tests__/config.ts b/node_modules/apollo-boost/src/__tests__/config.ts new file mode 100644 index 000000000..74ac8dee5 --- /dev/null +++ b/node_modules/apollo-boost/src/__tests__/config.ts @@ -0,0 +1,225 @@ +import ApolloClient, { gql, InMemoryCache } from '../'; +import { stripSymbols } from 'apollo-utilities'; +import fetchMock from 'fetch-mock'; + +global.fetch = jest.fn(() => + Promise.resolve({ json: () => Promise.resolve({}) }), +); + +const sleep = ms => new Promise(res => setTimeout(res, ms)); + +describe('config', () => { + const query = gql` + { + foo @client + } + `; + + const remoteQuery = gql` + { + foo + } + `; + + const resolvers = { + Query: { + foo: () => 'woo', + }, + }; + + it('warns about unsupported parameter', () => { + jest.spyOn(global.console, 'warn'); + + const client = new ApolloClient({ + link: [], + }); + + expect(global.console.warn.mock.calls).toMatchSnapshot(); + }); + + it('allows you to pass in a custom fetcher', () => { + const customFetcher = jest.fn(() => + Promise.resolve({ + text: () => Promise.resolve('{"data": {"foo": "bar" }}'), + }), + ); + + const client = new ApolloClient({ + fetch: customFetcher, + }); + + client.query({ query }).then(({ data }) => { + expect(customFetcher).toHaveBeenCalledTimes(1); + expect(stripSymbols(data)).toEqual({ foo: 'bar' }); + }); + }); + + it('allows you to pass in a request handler', () => { + const customFetcher = jest.fn(() => + Promise.resolve({ + text: () => Promise.resolve('{"data": {"foo": "woo" }}'), + }), + ); + + let requestCalled; + + const client = new ApolloClient({ + request: () => { + requestCalled = true; + }, + fetch: customFetcher, + }); + + return client + .query({ query: remoteQuery, fetchPolicy: 'network-only' }) + .then(({ data }) => { + expect(stripSymbols(data)).toEqual({ foo: 'woo' }); + expect(requestCalled).toEqual(true); + }); + }); + + it('allows you to pass in an async request handler', () => { + const customFetcher = jest.fn(() => + Promise.resolve({ + text: () => Promise.resolve('{"data": {"foo": "woo" }}'), + }), + ); + + let requestCalled; + + const client = new ApolloClient({ + request: () => { + Promise.resolve().then(() => { + requestCalled = true; + }); + }, + fetch: customFetcher, + }); + + return client + .query({ query: remoteQuery, fetchPolicy: 'network-only' }) + .then(({ data }) => { + expect(stripSymbols(data)).toEqual({ foo: 'woo' }); + expect(requestCalled).toEqual(true); + }); + }); + + it('throws if passed cache and cacheRedirects', () => { + const cache = new InMemoryCache(); + const cacheRedirects = { Query: { foo: () => 'woo' } }; + + expect(_ => { + const client = new ApolloClient({ + cache, + cacheRedirects, + }); + }).toThrow('Incompatible cache configuration'); + }); + + it('allows you to pass in cache', () => { + const cache = new InMemoryCache(); + + const client = new ApolloClient({ + cache, + }); + + expect(client.cache).toBe(cache); + }); + + it('allows you to pass in cacheRedirects', () => { + const cacheRedirects = { Query: { foo: () => 'woo' } }; + + const client = new ApolloClient({ + cacheRedirects, + }); + + expect(client.cache.config.cacheRedirects).toEqual(cacheRedirects); + }); + + it('allows you to pass in name and version', () => { + const name = 'client-name'; + const version = 'client-version'; + + const client = new ApolloClient({ + name, + version, + }); + + const { clientAwareness } = client.queryManager as any; + expect(clientAwareness.name).toEqual(name); + expect(clientAwareness.version).toEqual(version); + }); + + const makePromise = res => + new Promise((resolve, reject) => setTimeout(() => resolve(res))); + const data = { data: { hello: 'world' } }; + + describe('credentials', () => { + beforeEach(() => { + fetchMock.restore(); + fetchMock.post('/graphql', makePromise(data)); + }); + + afterEach(() => { + fetchMock.restore(); + }); + + it('should set `credentials` to `same-origin` by default', () => { + const client = new ApolloClient({}); + client.query({ query: remoteQuery, errorPolicy: 'ignore' }); + const [uri, options] = fetchMock.lastCall(); + expect(options.credentials).toEqual('same-origin'); + }); + + it('should set `credentials` to `config.credentials` if supplied', () => { + const client = new ApolloClient({ + credentials: 'some-new-value', + }); + client.query({ query: remoteQuery, errorPolicy: 'ignore' }); + const [uri, options] = fetchMock.lastCall(); + expect(options.credentials).toEqual('some-new-value'); + }); + }); + + describe('headers', () => { + beforeEach(() => { + fetchMock.restore(); + fetchMock.post('/graphql', makePromise(data)); + }); + + afterEach(() => { + fetchMock.restore(); + }); + + it( + 'should leave existing `headers` in place if no new headers are ' + + 'provided', + () => { + const client = new ApolloClient({}); + client.query({ query: remoteQuery, errorPolicy: 'ignore' }); + const [uri, options] = fetchMock.lastCall(); + expect(options.headers).toEqual({ + accept: '*/*', + 'content-type': 'application/json', + }); + }, + ); + + it('should add new `config.headers` to existing headers', () => { + const client = new ApolloClient({ + headers: { + 'new-header1': 'value1', + 'new-header2': 'value2', + }, + }); + client.query({ query: remoteQuery, errorPolicy: 'ignore' }); + const [uri, options] = fetchMock.lastCall(); + expect(options.headers).toEqual({ + accept: '*/*', + 'content-type': 'application/json', + 'new-header1': 'value1', + 'new-header2': 'value2', + }); + }); + }); +}); diff --git a/node_modules/apollo-boost/src/__tests__/smoke.ts b/node_modules/apollo-boost/src/__tests__/smoke.ts new file mode 100644 index 000000000..d7048301e --- /dev/null +++ b/node_modules/apollo-boost/src/__tests__/smoke.ts @@ -0,0 +1,17 @@ +import ApolloClient, { gql, HttpLink, InMemoryCache } from '../'; + +global.fetch = jest.fn(() => + Promise.resolve({ json: () => Promise.resolve({}) }), +); +it('should have the required exports', () => { + expect(ApolloClient).toBeDefined(); + expect(gql).toBeDefined(); + expect(HttpLink).toBeDefined(); + expect(InMemoryCache).toBeDefined(); +}); + +it('should make a client with defaults', () => { + const client = new ApolloClient(); + expect(client.link).toBeDefined(); + expect(client.store.cache).toBeDefined(); +}); diff --git a/node_modules/apollo-boost/src/index.ts b/node_modules/apollo-boost/src/index.ts new file mode 100644 index 000000000..c9f075127 --- /dev/null +++ b/node_modules/apollo-boost/src/index.ts @@ -0,0 +1,201 @@ +/* necessary for backward compat */ +export * from 'apollo-client'; +export * from 'apollo-link'; +export * from 'apollo-cache-inmemory'; + +import { Operation, ApolloLink, Observable } from 'apollo-link'; +import { HttpLink, UriFunction } from 'apollo-link-http'; +import { onError, ErrorLink } from 'apollo-link-error'; +import { ApolloCache } from 'apollo-cache'; +import { InMemoryCache, CacheResolverMap } from 'apollo-cache-inmemory'; +import gql from 'graphql-tag'; +import ApolloClient, { + Resolvers, + LocalStateFragmentMatcher, +} from 'apollo-client'; +import { DocumentNode } from 'graphql'; +import { invariant } from 'ts-invariant'; + +export { gql, HttpLink }; + +type ClientStateConfig = { + cache?: ApolloCache; + defaults?: Record; + resolvers?: Resolvers | Resolvers[]; + typeDefs?: string | string[] | DocumentNode | DocumentNode[]; + fragmentMatcher?: LocalStateFragmentMatcher; +}; + +export interface PresetConfig { + request?: (operation: Operation) => Promise | void; + uri?: string | UriFunction; + credentials?: string; + headers?: any; + fetch?: GlobalFetch['fetch']; + fetchOptions?: HttpLink.Options; + clientState?: ClientStateConfig; + onError?: ErrorLink.ErrorHandler; + cacheRedirects?: CacheResolverMap; + cache?: ApolloCache; + name?: string; + version?: string; + resolvers?: Resolvers | Resolvers[]; + typeDefs?: string | string[] | DocumentNode | DocumentNode[]; + fragmentMatcher?: LocalStateFragmentMatcher; +} + +// Yes, these are the exact same as the `PresetConfig` interface. We're +// defining these again so they can be used to verify that valid config +// options are being used in the `DefaultClient` constructor, for clients +// that aren't using Typescript. This duplication is unfortunate, and at +// some point can likely be adjusted so these items are inferred from +// the `PresetConfig` interface using a Typescript transform at compilation +// time. Unfortunately, TS transforms with rollup don't appear to be quite +// working properly, so this will have to be re-visited at some point. +// For now, when updating the properties of the `PresetConfig` interface, +// please also update this constant. +const PRESET_CONFIG_KEYS = [ + 'request', + 'uri', + 'credentials', + 'headers', + 'fetch', + 'fetchOptions', + 'clientState', + 'onError', + 'cacheRedirects', + 'cache', + 'name', + 'version', + 'resolvers', + 'typeDefs', + 'fragmentMatcher', +]; + +export default class DefaultClient extends ApolloClient { + constructor(config: PresetConfig = {}) { + if (config) { + const diff = Object.keys(config).filter( + key => PRESET_CONFIG_KEYS.indexOf(key) === -1, + ); + + if (diff.length > 0) { + invariant.warn( + 'ApolloBoost was initialized with unsupported options: ' + + `${diff.join(' ')}`, + ); + } + } + + const { + request, + uri, + credentials, + headers, + fetch, + fetchOptions, + clientState, + cacheRedirects, + onError: errorCallback, + name, + version, + resolvers, + typeDefs, + fragmentMatcher, + } = config; + + let { cache } = config; + + invariant( + !cache || !cacheRedirects, + 'Incompatible cache configuration. When not providing `cache`, ' + + 'configure the provided instance with `cacheRedirects` instead.', + ); + + if (!cache) { + cache = cacheRedirects + ? new InMemoryCache({ cacheRedirects }) + : new InMemoryCache(); + } + + const errorLink = errorCallback + ? onError(errorCallback) + : onError(({ graphQLErrors, networkError }) => { + if (graphQLErrors) { + graphQLErrors.map(({ message, locations, path }) => + // tslint:disable-next-line + invariant.warn( + `[GraphQL error]: Message: ${message}, Location: ` + + `${locations}, Path: ${path}`, + ), + ); + } + if (networkError) { + // tslint:disable-next-line + invariant.warn(`[Network error]: ${networkError}`); + } + }); + + const requestHandler = request + ? new ApolloLink( + (operation, forward) => + new Observable(observer => { + let handle: any; + Promise.resolve(operation) + .then(oper => request(oper)) + .then(() => { + handle = forward(operation).subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + }) + .catch(observer.error.bind(observer)); + + return () => { + if (handle) { + handle.unsubscribe(); + } + }; + }), + ) + : false; + + const httpLink = new HttpLink({ + uri: uri || '/graphql', + fetch, + fetchOptions: fetchOptions || {}, + credentials: credentials || 'same-origin', + headers: headers || {}, + }); + + const link = ApolloLink.from([errorLink, requestHandler, httpLink].filter( + x => !!x, + ) as ApolloLink[]); + + let activeResolvers = resolvers; + let activeTypeDefs = typeDefs; + let activeFragmentMatcher = fragmentMatcher; + if (clientState) { + if (clientState.defaults) { + cache.writeData({ + data: clientState.defaults, + }); + } + activeResolvers = clientState.resolvers; + activeTypeDefs = clientState.typeDefs; + activeFragmentMatcher = clientState.fragmentMatcher; + } + + // super hacky, we will fix the types eventually + super({ + cache, + link, + name, + version, + resolvers: activeResolvers, + typeDefs: activeTypeDefs, + fragmentMatcher: activeFragmentMatcher, + } as any); + } +} diff --git a/node_modules/apollo-cache-inmemory/CHANGELOG.md b/node_modules/apollo-cache-inmemory/CHANGELOG.md new file mode 100644 index 000000000..47c77f14f --- /dev/null +++ b/node_modules/apollo-cache-inmemory/CHANGELOG.md @@ -0,0 +1,153 @@ +# CHANGELOG + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). + +---- + +### 1.3.0 + +- Optimize repeated `apollo-cache-inmemory` reads by caching partial query + results. As a consequence, watched queries will not be rebroadcast unless the + data have changed. + [PR #3394](https://github.com/apollographql/apollo-client/pull/3394) + +### 1.2.5 + +- No changes. + +### 1.2.4 + +- No changes. + +### 1.2.3 + +- Added optional generics to cache manipulation methods (typescript). + [PR #3541](https://github.com/apollographql/apollo-client/pull/3541) +- Restore non-enumerability of `resultFields[ID_KEY]`. + [PR #3544](https://github.com/apollographql/apollo-client/pull/3544) +- Cache query documents transformed by InMemoryCache. + [PR #3553](https://github.com/apollographql/apollo-client/pull/3553) + +### 1.2.2 + +- Fixed an issue that caused fragment only queries to sometimes fail. + [Issue #3402](https://github.com/apollographql/apollo-client/issues/3402) + [PR #3507](https://github.com/apollographql/apollo-client/pull/3507) +- Fixed cache invalidation for inlined mixed types in union fields within + arrays. + [PR #3422](https://github.com/apollographql/apollo-client/pull/3422) + +### 1.2.1 + +- Not documented + +### vNEXT +- Optimize repeated `apollo-cache-inmemory` reads by caching partial query results + [#3394](https://github.com/apollographql/apollo-client/pull/3394) + +### 1.2.0 + +- Various optimizations for cache read performance + [PR #3300](https://github.com/apollographql/apollo-client/pull/3300) +- Fix typo in documentation + +### 1.1.12 + +- Fix an edge case where fields that were unions of two types, one with an + `id`, one without an `id`, would cause the cache to throw while saving the + result + [PR #3159](https://github.com/apollographql/apollo-client/pull/3159) +- Map coverage to original source +- Fixed bug with cacheRedirects not getting attached + [PR #3016](https://github.com/apollographql/apollo-client/pull/3016) + +### 1.1.9 + +- Added `getCacheKey` function to cacheResolver context + [PR #2998](https://github.com/apollographql/apollo-client/pull/2998) +- Changed `cacheResolvers` to `cacheRedirects`, added deprecation warning + [PR #3001](https://github.com/apollographql/apollo-client/pull/3001) + +### 1.1.8 + +- Dependency updates +- Fix IntrospectionResultData type definition + [Issue #2959](https://github.com/apollographql/apollo-client/issues/2959) + +### 1.1.7 + +- Update to latest apollo-utilities to support directives in cache + +### 1.1.6 (unpublished) + +- Update to latest apollo-utilities + +### 1.1.5 + +- Update to latest apollo-cache base + [PR #2818](https://github.com/apollographql/apollo-client/pull/2818) + +### 1.1.4 + +- Change access modifier for data from "private" to "protected", to allow + InMemoryCache subclasses to access it. + +### 1.1.3 + +- Improves performance of in memory cache + +### 1.1.2 + +- Ensure that heuristics warnings do not fire in production + [PR #2611](https://github.com/apollographql/apollo-client/pull/2611) + +### 1.1.1 + +- Change some access modifiers "private" to "protected" to allow code reuse by + InMemoryCache subclasses. +- Improved rollup builds + +### 1.1.0 + +- Improve errors for id mismatch when writing to the store +- Make it possible to swap the cache implementation. For example, you might + want to use a `Map` to store the normalized objects, which can be faster + than writing by keys to an `Object`. This also allows for custom use cases, + such as emitting events on `.set()` or `.delete()` (think Observables), + which was otherwise impossible without the use of Proxies, that are only + available in some browsers. Unless you passed in the `store` to one of the + `apollo-cache-inmemory` functions, such as: `writeQueryToStore` or + `writeResultToStore`, no changes to your code are necessary. If you did + access the cache's functions directly, all you need to do is add a + `.toObject()` call on the cache — review the changes to the tests for [an example](https://github.com/apollographql/apollo-client/blob/cd563bcd1c2c15b973d0cdfd63332f5ee82da309/packages/apollo-cache-inmemory/src/__tests__/writeToStore.ts#L258). + For reasoning behind this change and more information, see + [Issue #2293](https://github.com/apollographql/apollo-client/issues/2293). + +### 1.0.0 + +- Don't broadcast query watchers during a transaction (for example, while + mutation results are being processed) + [Issue #2221](https://github.com/apollographql/apollo-client/issues/2221) + [PR #2358](https://github.com/apollographql/apollo-client/pull/2358) +- `readQuery` and `readFragment` return now the result instead of + `Cache.DiffResult` + [PR #2320](https://github.com/apollographql/apollo-client/pull/2320) + +### 0.2.0-rc.1 + +- Move to named export to be consistent with rest of apollo ecosystem + +### 0.2.0-beta.6 + +- Rename customResolvers to cacheResolvers with backwards compat + +### 0.2.0-beta.5 and lower + +- Fix error when missing __typename field in result + [PR #2225](https://github.com/apollographql/apollo-client/pull/2225) +- Refactored type usage +- Prevented logging on defered queries +- Refactored internal store from apollo-client into own package diff --git a/node_modules/apollo-cache-inmemory/LICENSE b/node_modules/apollo-cache-inmemory/LICENSE new file mode 100644 index 000000000..278ee9d8c --- /dev/null +++ b/node_modules/apollo-cache-inmemory/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/apollo-cache-inmemory/README.md b/node_modules/apollo-cache-inmemory/README.md new file mode 100644 index 000000000..f0ed8517c --- /dev/null +++ b/node_modules/apollo-cache-inmemory/README.md @@ -0,0 +1,321 @@ +--- +title: InMemoryCache +description: An explanation of `apollo-cache-inmemory` +--- + +`apollo-cache-inmemory` is the recommended cache implementation for Apollo Client 2.0. `InMemoryCache` is a normalized data store that supports all of Apollo Client 1.0's features without the dependency on Redux. + +In some instances, you may need to manipulate the cache directly, such as updating the store after a mutation. We'll cover some common use cases [here](#recipes). + +

Installation

+ +``` +npm install apollo-cache-inmemory --save +``` + +After installing the package, you'll want to initialize the cache constructor. Then, you can pass in your newly created cache to ApolloClient. + +```js +import { InMemoryCache } from 'apollo-cache-inmemory'; +import { HttpLink } from 'apollo-link-http'; +import ApolloClient from 'apollo-client'; + +const cache = new InMemoryCache(); + +const client = new ApolloClient({ + link: new HttpLink(), + cache +}); +``` + +

Configuration

+ +The `InMemoryCache` constructor takes an optional config object with properties to customize your cache: + +- addTypename: A boolean to determine whether to add __typename to the document (default: `true`) +- dataIdFromObject: A function that takes a data object and returns a unique identifier to be used when normalizing the data in the store. Learn more about how to customize `dataIdFromObject` in the [Normalization](#normalization) section. +- fragmentMatcher: By default, the `InMemoryCache` uses a heuristic fragment matcher. If you are using fragments on unions and interfaces, you will need to use an `IntrospectionFragmentMatcher`. For more information, please read [our guide to setting up fragment matching for unions & interfaces](https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher). + +

Normalization

+ +The `InMemoryCache` normalizes your data before saving it to the store by splitting the result into individual objects, creating a unique identifier for each object, and storing those objects in a flattened data structure. By default, `InMemoryCache` will attempt to use the commonly found primary keys of `id` and `_id` for the unique identifier if they exist along with `__typename` on an object. + +If `id` and `_id` are not specified, or if `__typename` is not specified, `InMemoryCache` will fall back to the path to the object in the query, such as `ROOT_QUERY.allPeople.0` for the first record returned on the `allPeople` root query. + +This "getter" behavior for unique identifiers can be configured manually via the `dataIdFromObject` option passed to the `InMemoryCache` constructor, so you can pick which field is used if some of your data follows unorthodox primary key conventions. + +For example, if you wanted to key off of the `key` field for all of your data, you could configure `dataIdFromObject` like so: + +```js +const cache = new InMemoryCache({ + dataIdFromObject: object => object.key +}); +``` + +This also allows you to use different unique identifiers for different data types by keying off of the `__typename` property attached to every object typed by GraphQL. For example: + +```js +const cache = new InMemoryCache({ + dataIdFromObject: object => { + switch (object.__typename) { + case 'foo': return object.key; // use `key` as the primary key + case 'bar': return object.blah; // use `blah` as the priamry key + default: return object.id || object._id; // fall back to `id` and `_id` for all other types + } + } +}); +``` + +

Direct Cache Access

+ +To interact directly with your cache, you can use the Apollo Client class methods readQuery, readFragment, writeQuery, and writeFragment. These methods are available to us via the [`DataProxy` interface](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-cache/src/types/DataProxy.ts). Accessing these methods will vary slightly based on your view layer implementation. If you are using React, you can wrap your component in the `withApollo` higher order component, which will give you access to `this.props.client`. From there, you can use the methods to control your data. + +Any code demonstration in the following sections will assume that we have already initialized an instance of `ApolloClient` and that we have imported the `gql` tag from `graphql-tag`. + +

readQuery

+ +The `readQuery` method is very similar to the [`query` method on `ApolloClient`][] except that `readQuery` will _never_ make a request to your GraphQL server. The `query` method, on the other hand, may send a request to your server if the appropriate data is not in your cache whereas `readQuery` will throw an error if the data is not in your cache. `readQuery` will _always_ read from the cache. You can use `readQuery` by giving it a GraphQL query like so: + +```js +const { todo } = client.readQuery({ + query: gql` + query ReadTodo { + todo(id: 5) { + id + text + completed + } + } + `, +}); +``` + +If all of the data needed to fulfill this read is in Apollo Client’s normalized data cache then a data object will be returned in the shape of the query you wanted to read. If not all of the data needed to fulfill this read is in Apollo Client’s cache then an error will be thrown instead, so make sure to only read data that you know you have! + +You can also pass variables into `readQuery`. + +```js +const { todo } = client.readQuery({ + query: gql` + query ReadTodo($id: Int!) { + todo(id: $id) { + id + text + completed + } + } + `, + variables: { + id: 5, + }, +}); +``` + +

readFragment

+ +This method allows you great flexibility around the data in your cache. Whereas `readQuery` only allowed you to read data from your root query type, `readFragment` allows you to read data from _any node you have queried_. This is incredibly powerful. You use this method as follows: + +```js +const todo = client.readFragment({ + id: ..., // `id` is any id that could be returned by `dataIdFromObject`. + fragment: gql` + fragment myTodo on Todo { + id + text + completed + } + `, +}); +``` + +The first argument is the id of the data you want to read from the cache. That id must be a value that was returned by the `dataIdFromObject` function you defined when initializing `ApolloClient`. So for example if you initialized `ApolloClient` like so: + +```js +const client = new ApolloClient({ + ..., + dataIdFromObject: object => object.id, +}); +``` + +…and you requested a todo before with an id of `5`, then you can read that todo out of your cache with the following: + +```js +const todo = client.readFragment({ + id: '5', + fragment: gql` + fragment myTodo on Todo { + id + text + completed + } + `, +}); +``` + +> **Note:** Most people add a `__typename` to the id in `dataIdFromObject`. If you do this then don’t forget to add the `__typename` when you are reading a fragment as well. So for example your id may be `Todo_5` and not just `5`. + +If a todo with that id does not exist in the cache you will get `null` back. If a todo of that id does exist in the cache, but that todo does not have the `text` field then an error will be thrown. + +The beauty of `readFragment` is that the todo could have come from anywhere! The todo could have been selected as a singleton (`{ todo(id: 5) { ... } }`), the todo could have come from a list of todos (`{ todos { ... } }`), or the todo could have come from a mutation (`mutation { createTodo { ... } }`). As long as at some point your GraphQL server gave you a todo with the provided id and fields `id`, `text`, and `completed` you can read it from the cache at any part of your code. + +

writeQuery` and `writeFragment

+ +Not only can you read arbitrary data from the Apollo Client cache, but you can also write any data that you would like to the cache. The methods you use to do this are `writeQuery` and `writeFragment`. They will allow you to change data in your local cache, but it is important to remember that *they will not change any data on your server*. If you reload your environment then changes made with `writeQuery` and `writeFragment` will disappear. + +These methods have the same signature as their `readQuery` and `readFragment` counterparts except they also require an additional `data` variable. So for example, if you wanted to update the `completed` flag locally for your todo with id `'5'` you could execute the following: + +```js +client.writeFragment({ + id: '5', + fragment: gql` + fragment myTodo on Todo { + completed + } + `, + data: { + completed: true, + }, +}); +``` + +Any subscriber to the Apollo Client store will instantly see this update and render new UI accordingly. + +> **Note:** Again, remember that using `writeQuery` or `writeFragment` only changes data *locally*. If you reload your environment then changes made with these methods will no longer exist. + +Or if you wanted to add a new todo to a list fetched from the server, you could use `readQuery` and `writeQuery` together. + +```js +const query = gql` + query MyTodoAppQuery { + todos { + id + text + completed + } + } +`; + +const data = client.readQuery({ query }); + +const myNewTodo = { + id: '6', + text: 'Start using Apollo Client.', + completed: false, +}; + +client.writeQuery({ + query, + data: { + todos: [...data.todos, myNewTodo], + }, +}); +``` + +

Recipes

+ +Here are some common situations where you would need to access the cache directly. If you're manipulating the cache in an interesting way and would like your example to be featured, please send in a pull request! + +

Server side rendering

+ +First, you will need to initialize an `InMemoryCache` on the server and create an instance of `ApolloClient`. In the initial serialized HTML payload from the server, you should include a script tag that extracts the data from the cache. + +```js +`` +``` + +On the client, you can rehydrate the cache using the initial data passed from the server: + +```js +cache: new Cache().restore(window.__APOLLO_STATE__) +``` + +If you would like to learn more about server side rendering, please check our our more in depth guide [here]. + + +

Updating the cache after a mutation

+ +Being able to read and write to the Apollo cache from anywhere in your application gives you a lot of power over your data. However, there is one place where we most often want to update our cached data: after a mutation. As such, Apollo Client has optimized the experience for updating your cache with the read and write methods after a mutation with the `update` function. Let us say that we have the following GraphQL mutation: + +```graphql +mutation TodoCreateMutation($text: String!) { + createTodo(text: $text) { + id + text + completed + } +} +``` + +We may also have the following GraphQL query: + +```graphql +query TodoAppQuery { + todos { + id + text + completed + } +} +``` + +At the end of our mutation we want our query to include the new todo like we had sent our `TodoAppQuery` a second time after the mutation finished without actually sending the query. To do this we can use the `update` function provided as an option of the `client.mutate` method. To update your cache with the mutation just write code that looks like: + +```js +// We assume that the GraphQL operations `TodoCreateMutation` and +// `TodoAppQuery` have already been defined using the `gql` tag. + +const text = 'Hello, world!'; + +client.mutate({ + mutation: TodoCreateMutation, + variables: { + text, + }, + update: (proxy, { data: { createTodo } }) => { + // Read the data from our cache for this query. + const data = proxy.readQuery({ query: TodoAppQuery }); + + // Add our todo from the mutation to the end. + data.todos.push(createTodo); + + // Write our data back to the cache. + proxy.writeQuery({ query: TodoAppQuery, data }); + }, +}); +``` + +The first `proxy` argument is an instance of [`DataProxy`][] has the same four methods that we just learned exist on the Apollo Client: `readQuery`, `readFragment`, `writeQuery`, and `writeFragment`. The reason we call them on a `proxy` object here instead of on our `client` instance is that we can easily apply optimistic updates (which we will demonstrate in a bit). The `proxy` object also provides an isolated transaction which shields you from any other mutations going on at the same time, and the `proxy` object also batches writes together until the very end. + +If you provide an `optimisticResponse` option to the mutation then the `update` function will be run twice. Once immediately after you call `client.mutate` with the data from `optimisticResponse`. After the mutation successfully executes against the server the changes made in the first call to `update` will be rolled back and `update` will be called with the *actual* data returned by the mutation and not just the optimistic response. + +Putting it all together: + +```js +const text = 'Hello, world!'; + +client.mutate({ + mutation: TodoCreateMutation, + variables: { + text, + }, + optimisticResponse: { + id: -1, // -1 is a temporary id for the optimistic response. + text, + completed: false, + }, + update: (proxy, { data: { createTodo } }) => { + const data = proxy.readQuery({ query: TodoAppQuery }); + data.todos.push(createTodo); + proxy.writeQuery({ query: TodoAppQuery, data }); + }, +}); +``` + +As you can see the `update` function on `client.mutate` provides extra change management functionality specific to the use case of a mutation while still providing you the powerful data control APIs that are available on `client`. + +The `update` function is not a good place for side-effects as it may be called multiple times. Also, you may not call any of the methods on `proxy` asynchronously. + diff --git a/node_modules/apollo-cache-inmemory/jest.config.js b/node_modules/apollo-cache-inmemory/jest.config.js new file mode 100644 index 000000000..48f0a891e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../../config/jest.config.settings'), +}; diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts new file mode 100644 index 000000000..15fddf7f8 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map new file mode 100644 index 000000000..5e7ef9ad8 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/__tests__/cache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js new file mode 100644 index 000000000..ee8a7910d --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js @@ -0,0 +1,627 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var graphql_tag_1 = tslib_1.__importStar(require("graphql-tag")); +var apollo_utilities_1 = require("apollo-utilities"); +var lodash_1 = require("lodash"); +var __1 = require(".."); +graphql_tag_1.disableFragmentWarnings(); +describe('Cache', function () { + function itWithInitialData(message, initialDataForCaches, callback) { + var cachesList = [ + initialDataForCaches.map(function (data) { + return new __1.InMemoryCache({ + addTypename: false, + }).restore(lodash_1.cloneDeep(data)); + }), + initialDataForCaches.map(function (data) { + return new __1.InMemoryCache({ + addTypename: false, + resultCaching: false, + }).restore(lodash_1.cloneDeep(data)); + }), + initialDataForCaches.map(function (data) { + return new __1.InMemoryCache({ + addTypename: false, + freezeResults: true, + }).restore(lodash_1.cloneDeep(data)); + }), + ]; + cachesList.forEach(function (caches, i) { + it(message + (" (" + (i + 1) + "/" + cachesList.length + ")"), function () { + return callback.apply(void 0, caches); + }); + }); + } + function itWithCacheConfig(message, config, callback) { + var caches = [ + new __1.InMemoryCache(tslib_1.__assign({ addTypename: false }, config, { resultCaching: true })), + new __1.InMemoryCache(tslib_1.__assign({ addTypename: false }, config, { resultCaching: false })), + new __1.InMemoryCache(tslib_1.__assign({ addTypename: false }, config, { freezeResults: true })), + ]; + caches.forEach(function (cache, i) { + it(message + (" (" + (i + 1) + "/" + caches.length + ")"), function () { return callback(cache); }); + }); + } + describe('readQuery', function () { + itWithInitialData('will read some data from the store', [ + { + ROOT_QUERY: { + a: 1, + b: 2, + c: 3, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))), + }))).toEqual({ a: 1 }); + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n b\n c\n }\n "], ["\n {\n b\n c\n }\n "]))), + }))).toEqual({ b: 2, c: 3 }); + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), + }))).toEqual({ a: 1, b: 2, c: 3 }); + }); + itWithInitialData('will read some deeply nested data from the store', [ + { + ROOT_QUERY: { + a: 1, + b: 2, + c: 3, + d: { + type: 'id', + id: 'foo', + generated: false, + }, + }, + foo: { + e: 4, + f: 5, + g: 6, + h: { + type: 'id', + id: 'bar', + generated: false, + }, + }, + bar: { + i: 7, + j: 8, + k: 9, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n }\n }\n "], ["\n {\n a\n d {\n e\n }\n }\n "]))), + }))).toEqual({ a: 1, d: { e: 4 } }); + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n h {\n i\n }\n }\n }\n "], ["\n {\n a\n d {\n e\n h {\n i\n }\n }\n }\n "]))), + }))).toEqual({ a: 1, d: { e: 4, h: { i: 7 } } }); + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "], ["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "]))), + }))).toEqual({ + a: 1, + b: 2, + c: 3, + d: { e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }, + }); + }); + itWithInitialData('will read some data from the store with variables', [ + { + ROOT_QUERY: { + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":42})': 2, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: 42, + }, + }))).toEqual({ a: 1, b: 2 }); + }); + itWithInitialData('will read some data from the store with null variables', [ + { + ROOT_QUERY: { + 'field({"literal":false,"value":null})': 1, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ + query: graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: null, + }, + }))).toEqual({ a: 1 }); + }); + itWithInitialData('should not mutate arguments passed in', [ + { + ROOT_QUERY: { + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":42})': 2, + }, + }, + ], function (proxy) { + var options = { + query: graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: 42, + }, + }; + var preQueryCopy = lodash_1.cloneDeep(options); + expect(apollo_utilities_1.stripSymbols(proxy.readQuery(options))).toEqual({ a: 1, b: 2 }); + expect(preQueryCopy).toEqual(options); + }); + }); + describe('readFragment', function () { + itWithInitialData('will throw an error when there is no fragment', [ + {}, + ], function (proxy) { + expect(function () { + proxy.readFragment({ + id: 'x', + fragment: graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n a\n b\n c\n }\n "], ["\n query {\n a\n b\n c\n }\n "]))), + }); + }).toThrowError('Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + expect(function () { + proxy.readFragment({ + id: 'x', + fragment: graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n schema {\n query: Query\n }\n "], ["\n schema {\n query: Query\n }\n "]))), + }); + }).toThrowError('Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + }); + itWithInitialData('will throw an error when there is more than one fragment but no fragment name', [{}], function (proxy) { + expect(function () { + proxy.readFragment({ + id: 'x', + fragment: graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "]))), + }); + }).toThrowError('Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + expect(function () { + proxy.readFragment({ + id: 'x', + fragment: graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "]))), + }); + }).toThrowError('Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + }); + itWithInitialData('will read some deeply nested data from the store at any id', [ + { + ROOT_QUERY: { + __typename: 'Type1', + a: 1, + b: 2, + c: 3, + d: { + type: 'id', + id: 'foo', + generated: false, + }, + }, + foo: { + __typename: 'Foo', + e: 4, + f: 5, + g: 6, + h: { + type: 'id', + id: 'bar', + generated: false, + }, + }, + bar: { + __typename: 'Bar', + i: 7, + j: 8, + k: 9, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "]))), + }))).toEqual({ e: 4, h: { i: 7 } }); + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n "]))), + }))).toEqual({ e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }); + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'bar', + fragment: graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n }\n "]))), + }))).toEqual({ i: 7 }); + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'bar', + fragment: graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), + }))).toEqual({ i: 7, j: 8, k: 9 }); + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), + fragmentName: 'fragmentFoo', + }))).toEqual({ e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }); + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'bar', + fragment: graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), + fragmentName: 'fragmentBar', + }))).toEqual({ i: 7, j: 8, k: 9 }); + }); + itWithInitialData('will read some data from the store with variables', [ + { + foo: { + __typename: 'Foo', + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":42})': 2, + }, + }, + ], function (proxy) { + expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: 42, + }, + }))).toEqual({ a: 1, b: 2 }); + }); + itWithInitialData('will return null when an id that can’t be found is provided', [ + {}, + { + bar: { __typename: 'Bar', a: 1, b: 2, c: 3 }, + }, + { + foo: { __typename: 'Foo', a: 1, b: 2, c: 3 }, + }, + ], function (client1, client2, client3) { + expect(apollo_utilities_1.stripSymbols(client1.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), + }))).toEqual(null); + expect(apollo_utilities_1.stripSymbols(client2.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), + }))).toEqual(null); + expect(apollo_utilities_1.stripSymbols(client3.readFragment({ + id: 'foo', + fragment: graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), + }))).toEqual({ a: 1, b: 2, c: 3 }); + }); + }); + describe('writeQuery', function () { + itWithInitialData('will write some data to the store', [{}], function (proxy) { + proxy.writeQuery({ + data: { a: 1 }, + query: graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 1, + }, + }); + proxy.writeQuery({ + data: { b: 2, c: 3 }, + query: graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n {\n b\n c\n }\n "], ["\n {\n b\n c\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 1, + b: 2, + c: 3, + }, + }); + proxy.writeQuery({ + data: { a: 4, b: 5, c: 6 }, + query: graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 4, + b: 5, + c: 6, + }, + }); + }); + itWithInitialData('will write some deeply nested data to the store', [{}], function (proxy) { + proxy.writeQuery({ + data: { a: 1, d: { e: 4 } }, + query: graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n }\n }\n "], ["\n {\n a\n d {\n e\n }\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 1, + d: { + type: 'id', + id: '$ROOT_QUERY.d', + generated: true, + }, + }, + '$ROOT_QUERY.d': { + e: 4, + }, + }); + proxy.writeQuery({ + data: { a: 1, d: { h: { i: 7 } } }, + query: graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n h {\n i\n }\n }\n }\n "], ["\n {\n a\n d {\n h {\n i\n }\n }\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 1, + d: { + type: 'id', + id: '$ROOT_QUERY.d', + generated: true, + }, + }, + '$ROOT_QUERY.d': { + e: 4, + h: { + type: 'id', + id: '$ROOT_QUERY.d.h', + generated: true, + }, + }, + '$ROOT_QUERY.d.h': { + i: 7, + }, + }); + proxy.writeQuery({ + data: { + a: 1, + b: 2, + c: 3, + d: { e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }, + }, + query: graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "], ["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "]))), + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + a: 1, + b: 2, + c: 3, + d: { + type: 'id', + id: '$ROOT_QUERY.d', + generated: true, + }, + }, + '$ROOT_QUERY.d': { + e: 4, + f: 5, + g: 6, + h: { + type: 'id', + id: '$ROOT_QUERY.d.h', + generated: true, + }, + }, + '$ROOT_QUERY.d.h': { + i: 7, + j: 8, + k: 9, + }, + }); + }); + itWithInitialData('will write some data to the store with variables', [{}], function (proxy) { + proxy.writeQuery({ + data: { + a: 1, + b: 2, + }, + query: graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: 42, + }, + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":42})': 2, + }, + }); + }); + itWithInitialData('will write some data to the store with variables where some are null', [{}], function (proxy) { + proxy.writeQuery({ + data: { + a: 1, + b: 2, + }, + query: graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: null, + }, + }); + expect(proxy.extract()).toEqual({ + ROOT_QUERY: { + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":null})': 2, + }, + }); + }); + }); + describe('writeFragment', function () { + itWithInitialData('will throw an error when there is no fragment', [{}], function (proxy) { + expect(function () { + proxy.writeFragment({ + data: {}, + id: 'x', + fragment: graphql_tag_1.default(templateObject_32 || (templateObject_32 = tslib_1.__makeTemplateObject(["\n query {\n a\n b\n c\n }\n "], ["\n query {\n a\n b\n c\n }\n "]))), + }); + }).toThrowError('Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + expect(function () { + proxy.writeFragment({ + data: {}, + id: 'x', + fragment: graphql_tag_1.default(templateObject_33 || (templateObject_33 = tslib_1.__makeTemplateObject(["\n schema {\n query: Query\n }\n "], ["\n schema {\n query: Query\n }\n "]))), + }); + }).toThrowError('Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + }); + itWithInitialData('will throw an error when there is more than one fragment but no fragment name', [{}], function (proxy) { + expect(function () { + proxy.writeFragment({ + data: {}, + id: 'x', + fragment: graphql_tag_1.default(templateObject_34 || (templateObject_34 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "]))), + }); + }).toThrowError('Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + expect(function () { + proxy.writeFragment({ + data: {}, + id: 'x', + fragment: graphql_tag_1.default(templateObject_35 || (templateObject_35 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "]))), + }); + }).toThrowError('Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); + }); + itWithCacheConfig('will write some deeply nested data into the store at any id', { + dataIdFromObject: function (o) { return o.id; }, + addTypename: false, + }, function (proxy) { + proxy.writeFragment({ + data: { __typename: 'Foo', e: 4, h: { id: 'bar', i: 7 } }, + id: 'foo', + fragment: graphql_tag_1.default(templateObject_36 || (templateObject_36 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "]))), + }); + expect(proxy.extract()).toMatchSnapshot(); + proxy.writeFragment({ + data: { __typename: 'Foo', f: 5, g: 6, h: { id: 'bar', j: 8, k: 9 } }, + id: 'foo', + fragment: graphql_tag_1.default(templateObject_37 || (templateObject_37 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n f\n g\n h {\n j\n k\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n f\n g\n h {\n j\n k\n }\n }\n "]))), + }); + expect(proxy.extract()).toMatchSnapshot(); + proxy.writeFragment({ + data: { i: 10, __typename: 'Bar' }, + id: 'bar', + fragment: graphql_tag_1.default(templateObject_38 || (templateObject_38 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n }\n "]))), + }); + expect(proxy.extract()).toMatchSnapshot(); + proxy.writeFragment({ + data: { j: 11, k: 12, __typename: 'Bar' }, + id: 'bar', + fragment: graphql_tag_1.default(templateObject_39 || (templateObject_39 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n j\n k\n }\n "], ["\n fragment fragmentBar on Bar {\n j\n k\n }\n "]))), + }); + expect(proxy.extract()).toMatchSnapshot(); + proxy.writeFragment({ + data: { + __typename: 'Foo', + e: 4, + f: 5, + g: 6, + h: { __typename: 'Bar', id: 'bar', i: 7, j: 8, k: 9 }, + }, + id: 'foo', + fragment: graphql_tag_1.default(templateObject_40 || (templateObject_40 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "], ["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "]))), + fragmentName: 'fooFragment', + }); + expect(proxy.extract()).toMatchSnapshot(); + proxy.writeFragment({ + data: { __typename: 'Bar', i: 10, j: 11, k: 12 }, + id: 'bar', + fragment: graphql_tag_1.default(templateObject_41 || (templateObject_41 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "], ["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "]))), + fragmentName: 'barFragment', + }); + expect(proxy.extract()).toMatchSnapshot(); + }); + itWithCacheConfig('writes data that can be read back', { + addTypename: true, + }, function (proxy) { + var readWriteFragment = graphql_tag_1.default(templateObject_42 || (templateObject_42 = tslib_1.__makeTemplateObject(["\n fragment aFragment on query {\n getSomething {\n id\n }\n }\n "], ["\n fragment aFragment on query {\n getSomething {\n id\n }\n }\n "]))); + var data = { + __typename: 'query', + getSomething: { id: '123', __typename: 'Something' }, + }; + proxy.writeFragment({ + data: data, + id: 'query', + fragment: readWriteFragment, + }); + var result = proxy.readFragment({ + fragment: readWriteFragment, + id: 'query', + }); + expect(apollo_utilities_1.stripSymbols(result)).toEqual(data); + }); + itWithCacheConfig('will write some data to the store with variables', { + addTypename: true, + }, function (proxy) { + proxy.writeFragment({ + data: { + a: 1, + b: 2, + __typename: 'Foo', + }, + id: 'foo', + fragment: graphql_tag_1.default(templateObject_43 || (templateObject_43 = tslib_1.__makeTemplateObject(["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), + variables: { + literal: false, + value: 42, + }, + }); + expect(proxy.extract()).toEqual({ + foo: { + __typename: 'Foo', + 'field({"literal":true,"value":42})': 1, + 'field({"literal":false,"value":42})': 2, + }, + }); + }); + }); + describe('performTransaction', function () { + itWithInitialData('will not broadcast mid-transaction', [{}], function (cache) { + var numBroadcasts = 0; + var query = graphql_tag_1.default(templateObject_44 || (templateObject_44 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))); + cache.watch({ + query: query, + optimistic: false, + callback: function () { + numBroadcasts++; + }, + }); + expect(numBroadcasts).toEqual(0); + cache.performTransaction(function (proxy) { + proxy.writeQuery({ + data: { a: 1 }, + query: query, + }); + expect(numBroadcasts).toEqual(0); + proxy.writeQuery({ + data: { a: 4, b: 5, c: 6 }, + query: graphql_tag_1.default(templateObject_45 || (templateObject_45 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), + }); + expect(numBroadcasts).toEqual(0); + }); + expect(numBroadcasts).toEqual(1); + }); + }); + describe('performOptimisticTransaction', function () { + itWithInitialData('will only broadcast once', [{}], function (cache) { + var numBroadcasts = 0; + var query = graphql_tag_1.default(templateObject_46 || (templateObject_46 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))); + cache.watch({ + query: query, + optimistic: true, + callback: function () { + numBroadcasts++; + }, + }); + expect(numBroadcasts).toEqual(0); + cache.recordOptimisticTransaction(function (proxy) { + proxy.writeQuery({ + data: { a: 1 }, + query: query, + }); + expect(numBroadcasts).toEqual(0); + proxy.writeQuery({ + data: { a: 4, b: 5, c: 6 }, + query: graphql_tag_1.default(templateObject_47 || (templateObject_47 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), + }); + expect(numBroadcasts).toEqual(0); + }, 1); + expect(numBroadcasts).toEqual(1); + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47; +//# sourceMappingURL=cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map new file mode 100644 index 000000000..2ea0089a9 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/__tests__/cache.ts"],"names":[],"mappings":";;;AAAA,iEAA2D;AAC3D,qDAAgD;AAChD,iCAAmC;AAEnC,wBAAwD;AAExD,qCAAuB,EAAE,CAAC;AAE1B,QAAQ,CAAC,OAAO,EAAE;IAChB,SAAS,iBAAiB,CACxB,OAAe,EACf,oBAAgD,EAChD,QAA6C;QAE7C,IAAM,UAAU,GAAsB;YACpC,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI;gBAC3B,OAAA,IAAI,iBAAa,CAAC;oBAChB,WAAW,EAAE,KAAK;iBACnB,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,IAAI,CAAC,CAAC;YAF3B,CAE2B,CAC5B;YACD,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI;gBAC3B,OAAA,IAAI,iBAAa,CAAC;oBAChB,WAAW,EAAE,KAAK;oBAClB,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,IAAI,CAAC,CAAC;YAH3B,CAG2B,CAC5B;YACD,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI;gBAC3B,OAAA,IAAI,iBAAa,CAAC;oBAChB,WAAW,EAAE,KAAK;oBAClB,aAAa,EAAE,IAAI;iBACpB,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,IAAI,CAAC,CAAC;YAH3B,CAG2B,CAC5B;SACF,CAAC;QAEF,UAAU,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,CAAC;YAC3B,EAAE,CAAC,OAAO,IAAG,QAAK,CAAC,GAAG,CAAC,UAAI,UAAU,CAAC,MAAM,MAAG,CAAA,EAAE;gBAC/C,OAAA,QAAQ,eAAI,MAAM;YAAlB,CAAmB,CACpB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,iBAAiB,CACxB,OAAe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/B,UAAA,KAAK;gBACH,KAAK,CAAC,UAAU,CAAC;oBACf,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;oBACd,KAAK,OAAA;iBACN,CAAC,CAAC;gBAEH,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAEjC,KAAK,CAAC,UAAU,CAAC;oBACf,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;oBAC1B,KAAK,EAAE,qBAAG,wLAAA,2GAMT,IAAA;iBACF,CAAC,CAAC;gBAEH,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC,EACD,CAAQ,CACT,CAAC;YAEF,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts new file mode 100644 index 000000000..f7a171099 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts @@ -0,0 +1,2 @@ +export declare function withError(func: Function, regex: RegExp): any; +//# sourceMappingURL=diffAgainstStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map new file mode 100644 index 000000000..bf5c66bd3 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diffAgainstStore.d.ts","sourceRoot":"","sources":["../src/__tests__/diffAgainstStore.ts"],"names":[],"mappings":"AAaA,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OActD"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js new file mode 100644 index 000000000..9db2e35a1 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js @@ -0,0 +1,678 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var graphql_tag_1 = tslib_1.__importStar(require("graphql-tag")); +var apollo_utilities_1 = require("apollo-utilities"); +var objectCache_1 = require("../objectCache"); +var readFromStore_1 = require("../readFromStore"); +var writeToStore_1 = require("../writeToStore"); +var fragmentMatcher_1 = require("../fragmentMatcher"); +var inMemoryCache_1 = require("../inMemoryCache"); +var fragmentMatcherFunction = new fragmentMatcher_1.HeuristicFragmentMatcher().match; +graphql_tag_1.disableFragmentWarnings(); +function withError(func, regex) { + var message = null; + var error = console.error; + console.error = function (m) { + message = m; + }; + try { + var result = func(); + expect(message).toMatch(regex); + return result; + } + finally { + console.error = error; + } +} +exports.withError = withError; +describe('diffing queries against the store', function () { + var reader = new readFromStore_1.StoreReader(); + var writer = new writeToStore_1.StoreWriter(); + it('expects named fragments to return complete as true when diffd against ' + + 'the store', function () { + var store = objectCache_1.defaultNormalizedCacheFactory({}); + var queryResult = reader.diffQueryAgainstStore({ + store: store, + query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query foo {\n ...root\n }\n\n fragment root on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n "], ["\n query foo {\n ...root\n }\n\n fragment root on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n "]))), + fragmentMatcherFunction: fragmentMatcherFunction, + config: { + dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, + }, + }); + expect(queryResult.complete).toEqual(false); + }); + it('expects inline fragments to return complete as true when diffd against ' + + 'the store', function () { + var store = objectCache_1.defaultNormalizedCacheFactory(); + var queryResult = reader.diffQueryAgainstStore({ + store: store, + query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "], ["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "]))), + fragmentMatcherFunction: fragmentMatcherFunction, + config: { + dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, + }, + }); + expect(queryResult.complete).toEqual(false); + }); + it('returns nothing when the store is enough', function () { + var query = graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "]))); + var result = { + people_one: { + name: 'Luke Skywalker', + }, + }; + var store = writer.writeQueryToStore({ + result: result, + query: query, + }); + expect(reader.diffQueryAgainstStore({ + store: store, + query: query, + }).complete).toBeTruthy(); + }); + it('caches root queries both under the ID of the node and the query name', function () { + var firstQuery = graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); + var result = { + people_one: { + __typename: 'Person', + id: '1', + name: 'Luke Skywalker', + }, + }; + var getIdField = function (_a) { + var id = _a.id; + return id; + }; + var store = writer.writeQueryToStore({ + result: result, + query: firstQuery, + dataIdFromObject: getIdField, + }); + var secondQuery = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); + var complete = reader.diffQueryAgainstStore({ + store: store, + query: secondQuery, + }).complete; + expect(complete).toBeTruthy(); + expect(store.get('1')).toEqual(result.people_one); + }); + it('does not swallow errors other than field errors', function () { + var firstQuery = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n person {\n powers\n }\n }\n "], ["\n query {\n person {\n powers\n }\n }\n "]))); + var firstResult = { + person: { + powers: 'the force', + }, + }; + var store = writer.writeQueryToStore({ + result: firstResult, + query: firstQuery, + }); + var unionQuery = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query {\n ...notARealFragment\n }\n "], ["\n query {\n ...notARealFragment\n }\n "]))); + return expect(function () { + reader.diffQueryAgainstStore({ + store: store, + query: unionQuery, + }); + }).toThrowError(/No fragment/); + }); + it('does not error on a correct query with union typed fragments', function () { + return withError(function () { + var firstQuery = graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); + var firstResult = { + person: { + __typename: 'Author', + firstName: 'John', + lastName: 'Smith', + }, + }; + var store = writer.writeQueryToStore({ + result: firstResult, + query: firstQuery, + }); + var unionQuery = graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ... on Author {\n firstName\n lastName\n }\n ... on Jedi {\n powers\n }\n }\n }\n "], ["\n query {\n person {\n __typename\n ... on Author {\n firstName\n lastName\n }\n ... on Jedi {\n powers\n }\n }\n }\n "]))); + var complete = reader.diffQueryAgainstStore({ + store: store, + query: unionQuery, + returnPartialData: false, + fragmentMatcherFunction: fragmentMatcherFunction, + }).complete; + expect(complete).toBe(false); + }, /IntrospectionFragmentMatcher/); + }); + it('does not error on a query with fields missing from all but one named fragment', function () { + var firstQuery = graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); + var firstResult = { + person: { + __typename: 'Author', + firstName: 'John', + lastName: 'Smith', + }, + }; + var store = writer.writeQueryToStore({ + result: firstResult, + query: firstQuery, + }); + var unionQuery = graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ...authorInfo\n ...jediInfo\n }\n }\n\n fragment authorInfo on Author {\n firstName\n }\n\n fragment jediInfo on Jedi {\n powers\n }\n "], ["\n query {\n person {\n __typename\n ...authorInfo\n ...jediInfo\n }\n }\n\n fragment authorInfo on Author {\n firstName\n }\n\n fragment jediInfo on Jedi {\n powers\n }\n "]))); + var complete = reader.diffQueryAgainstStore({ + store: store, + query: unionQuery, + }).complete; + expect(complete).toBe(false); + }); + it('throws an error on a query with fields missing from matching named fragments', function () { + var firstQuery = graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); + var firstResult = { + person: { + __typename: 'Author', + firstName: 'John', + lastName: 'Smith', + }, + }; + var store = writer.writeQueryToStore({ + result: firstResult, + query: firstQuery, + }); + var unionQuery = graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ...authorInfo2\n ...jediInfo2\n }\n }\n\n fragment authorInfo2 on Author {\n firstName\n address\n }\n\n fragment jediInfo2 on Jedi {\n jedi\n }\n "], ["\n query {\n person {\n __typename\n ...authorInfo2\n ...jediInfo2\n }\n }\n\n fragment authorInfo2 on Author {\n firstName\n address\n }\n\n fragment jediInfo2 on Jedi {\n jedi\n }\n "]))); + expect(function () { + reader.diffQueryAgainstStore({ + store: store, + query: unionQuery, + returnPartialData: false, + }); + }).toThrow(); + }); + it('returns available fields if returnPartialData is true', function () { + var firstQuery = graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); + var firstResult = { + people_one: { + __typename: 'Person', + id: 'lukeId', + name: 'Luke Skywalker', + }, + }; + var store = writer.writeQueryToStore({ + result: firstResult, + query: firstQuery, + }); + var simpleQuery = graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n age\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n age\n }\n }\n "]))); + var inlineFragmentQuery = graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n ... on Person {\n name\n age\n }\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n ... on Person {\n name\n age\n }\n }\n }\n "]))); + var namedFragmentQuery = graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n query {\n people_one(id: \"1\") {\n ...personInfo\n }\n }\n\n fragment personInfo on Person {\n name\n age\n }\n "], ["\n query {\n people_one(id: \"1\") {\n ...personInfo\n }\n }\n\n fragment personInfo on Person {\n name\n age\n }\n "]))); + var simpleDiff = reader.diffQueryAgainstStore({ + store: store, + query: simpleQuery, + }); + expect(simpleDiff.result).toEqual({ + people_one: { + name: 'Luke Skywalker', + }, + }); + var inlineDiff = reader.diffQueryAgainstStore({ + store: store, + query: inlineFragmentQuery, + }); + expect(inlineDiff.result).toEqual({ + people_one: { + name: 'Luke Skywalker', + }, + }); + var namedDiff = reader.diffQueryAgainstStore({ + store: store, + query: namedFragmentQuery, + }); + expect(namedDiff.result).toEqual({ + people_one: { + name: 'Luke Skywalker', + }, + }); + expect(function () { + reader.diffQueryAgainstStore({ + store: store, + query: simpleQuery, + returnPartialData: false, + }); + }).toThrow(); + }); + it('will add a private id property', function () { + var query = graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "], ["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "]))); + var queryResult = { + a: [{ id: 'a:1', b: 1.1 }, { id: 'a:2', b: 1.2 }, { id: 'a:3', b: 1.3 }], + c: { + d: 2, + e: [ + { id: 'e:1', f: 3.1 }, + { id: 'e:2', f: 3.2 }, + { id: 'e:3', f: 3.3 }, + { id: 'e:4', f: 3.4 }, + { id: 'e:5', f: 3.5 }, + ], + g: { h: 4 }, + }, + }; + function dataIdFromObject(_a) { + var id = _a.id; + return id; + } + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + dataIdFromObject: dataIdFromObject, + }); + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + }).result; + expect(result).toEqual(queryResult); + expect(dataIdFromObject(result.a[0])).toBe('a:1'); + expect(dataIdFromObject(result.a[1])).toBe('a:2'); + expect(dataIdFromObject(result.a[2])).toBe('a:3'); + expect(dataIdFromObject(result.c.e[0])).toBe('e:1'); + expect(dataIdFromObject(result.c.e[1])).toBe('e:2'); + expect(dataIdFromObject(result.c.e[2])).toBe('e:3'); + expect(dataIdFromObject(result.c.e[3])).toBe('e:4'); + expect(dataIdFromObject(result.c.e[4])).toBe('e:5'); + }); + describe('referential equality preservation', function () { + it('will return the previous result if there are no changes', function () { + var query = graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); + var queryResult = { + a: { b: 1 }, + c: { d: 2, e: { f: 3 } }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: { b: 1 }, + c: { d: 2, e: { f: 3 } }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).toEqual(previousResult); + }); + it('will return parts of the previous result that changed', function () { + var query = graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); + var queryResult = { + a: { b: 1 }, + c: { d: 2, e: { f: 3 } }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: { b: 1 }, + c: { d: 20, e: { f: 3 } }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).not.toEqual(previousResult); + expect(result.a).toEqual(previousResult.a); + expect(result.c).not.toEqual(previousResult.c); + expect(result.c.e).toEqual(previousResult.c.e); + }); + it('will return the previous result if there are no changes in child arrays', function () { + var query = graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); + var queryResult = { + a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], + c: { + d: 2, + e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], + }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], + c: { + d: 2, + e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], + }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).toEqual(previousResult); + }); + it('will not add zombie items when previousResult starts with the same items', function () { + var query = graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n }\n "], ["\n query {\n a {\n b\n }\n }\n "]))); + var queryResult = { + a: [{ b: 1.1 }, { b: 1.2 }], + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result.a[0]).toEqual(previousResult.a[0]); + expect(result.a[1]).toEqual(previousResult.a[1]); + }); + it('will return the previous result if there are no changes in nested child arrays', function () { + var query = graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); + var queryResult = { + a: [[[[[{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }]]]]], + c: { + d: 2, + e: [[{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }], [{ f: 3.4 }, { f: 3.5 }]], + }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: [[[[[{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }]]]]], + c: { + d: 2, + e: [[{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }], [{ f: 3.4 }, { f: 3.5 }]], + }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).toEqual(previousResult); + }); + it('will return parts of the previous result if there are changes in child arrays', function () { + var query = graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); + var queryResult = { + a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], + c: { + d: 2, + e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], + }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: [{ b: 1.1 }, { b: -1.2 }, { b: 1.3 }], + c: { + d: 20, + e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], + }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).not.toEqual(previousResult); + expect(result.a).not.toEqual(previousResult.a); + expect(result.a[0]).toEqual(previousResult.a[0]); + expect(result.a[1]).not.toEqual(previousResult.a[1]); + expect(result.a[2]).toEqual(previousResult.a[2]); + expect(result.c).not.toEqual(previousResult.c); + expect(result.c.e).toEqual(previousResult.c.e); + expect(result.c.e[0]).toEqual(previousResult.c.e[0]); + expect(result.c.e[1]).toEqual(previousResult.c.e[1]); + expect(result.c.e[2]).toEqual(previousResult.c.e[2]); + expect(result.c.e[3]).toEqual(previousResult.c.e[3]); + expect(result.c.e[4]).toEqual(previousResult.c.e[4]); + }); + it('will return the same items in a different order with `dataIdFromObject`', function () { + var query = graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "], ["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "]))); + var queryResult = { + a: [ + { id: 'a:1', b: 1.1 }, + { id: 'a:2', b: 1.2 }, + { id: 'a:3', b: 1.3 }, + ], + c: { + d: 2, + e: [ + { id: 'e:1', f: 3.1 }, + { id: 'e:2', f: 3.2 }, + { id: 'e:3', f: 3.3 }, + { id: 'e:4', f: 3.4 }, + { id: 'e:5', f: 3.5 }, + ], + g: { h: 4 }, + }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + dataIdFromObject: function (_a) { + var id = _a.id; + return id; + }, + }); + var previousResult = { + a: [ + { id: 'a:3', b: 1.3 }, + { id: 'a:2', b: 1.2 }, + { id: 'a:1', b: 1.1 }, + ], + c: { + d: 2, + e: [ + { id: 'e:4', f: 3.4 }, + { id: 'e:2', f: 3.2 }, + { id: 'e:5', f: 3.5 }, + { id: 'e:3', f: 3.3 }, + { id: 'e:1', f: 3.1 }, + ], + g: { h: 4 }, + }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).not.toEqual(previousResult); + expect(result.a).not.toEqual(previousResult.a); + expect(result.a[0]).toEqual(previousResult.a[2]); + expect(result.a[1]).toEqual(previousResult.a[1]); + expect(result.a[2]).toEqual(previousResult.a[0]); + expect(result.c).not.toEqual(previousResult.c); + expect(result.c.e).not.toEqual(previousResult.c.e); + expect(result.c.e[0]).toEqual(previousResult.c.e[4]); + expect(result.c.e[1]).toEqual(previousResult.c.e[1]); + expect(result.c.e[2]).toEqual(previousResult.c.e[3]); + expect(result.c.e[3]).toEqual(previousResult.c.e[0]); + expect(result.c.e[4]).toEqual(previousResult.c.e[2]); + expect(result.c.g).toEqual(previousResult.c.g); + }); + it('will return the same JSON scalar field object', function () { + var query = graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n {\n a {\n b\n c\n }\n d {\n e\n f\n }\n }\n "], ["\n {\n a {\n b\n c\n }\n d {\n e\n f\n }\n }\n "]))); + var queryResult = { + a: { b: 1, c: { x: 2, y: 3, z: 4 } }, + d: { e: 5, f: { x: 6, y: 7, z: 8 } }, + }; + var store = writer.writeQueryToStore({ + query: query, + result: queryResult, + }); + var previousResult = { + a: { b: 1, c: { x: 2, y: 3, z: 4 } }, + d: { e: 50, f: { x: 6, y: 7, z: 8 } }, + }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: query, + previousResult: previousResult, + }).result; + expect(result).toEqual(queryResult); + expect(result).not.toEqual(previousResult); + expect(result.a).toEqual(previousResult.a); + expect(result.d).not.toEqual(previousResult.d); + expect(result.d.f).toEqual(previousResult.d.f); + }); + it('will preserve equality with custom resolvers', function () { + var listQuery = graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n {\n people {\n id\n name\n __typename\n }\n }\n "], ["\n {\n people {\n id\n name\n __typename\n }\n }\n "]))); + var listResult = { + people: [ + { + id: '4', + name: 'Luke Skywalker', + __typename: 'Person', + }, + ], + }; + var itemQuery = graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n {\n person(id: 4) {\n id\n name\n __typename\n }\n }\n "], ["\n {\n person(id: 4) {\n id\n name\n __typename\n }\n }\n "]))); + var dataIdFromObject = function (obj) { return obj.id; }; + var store = writer.writeQueryToStore({ + query: listQuery, + result: listResult, + dataIdFromObject: dataIdFromObject, + }); + var previousResult = { + person: listResult.people[0], + }; + var cacheRedirects = { + Query: { + person: function (_, args) { + return apollo_utilities_1.toIdValue({ id: args['id'], typename: 'Person' }); + }, + }, + }; + var config = { dataIdFromObject: dataIdFromObject, cacheRedirects: cacheRedirects }; + var result = reader.diffQueryAgainstStore({ + store: store, + query: itemQuery, + previousResult: previousResult, + config: config, + }).result; + expect(result).toEqual(previousResult); + }); + }); + describe('malformed queries', function () { + it('throws for non-scalar query fields without selection sets', function () { + var validQuery = graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n query getMessageList {\n messageList {\n id\n __typename\n message\n }\n }\n "], ["\n query getMessageList {\n messageList {\n id\n __typename\n message\n }\n }\n "]))); + var invalidQuery = graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query getMessageList {\n # This field needs a selection set because its value is an array\n # of non-scalar objects.\n messageList\n }\n "], ["\n query getMessageList {\n # This field needs a selection set because its value is an array\n # of non-scalar objects.\n messageList\n }\n "]))); + var store = writer.writeQueryToStore({ + query: validQuery, + result: { + messageList: [ + { + id: 1, + __typename: 'Message', + message: 'hi', + }, + { + id: 2, + __typename: 'Message', + message: 'hello', + }, + { + id: 3, + __typename: 'Message', + message: 'hey', + }, + ], + }, + }); + try { + reader.diffQueryAgainstStore({ + store: store, + query: invalidQuery, + }); + throw new Error('should have thrown'); + } + catch (e) { + expect(e.message).toEqual('Missing selection set for object of type Message returned for query field messageList'); + } + }); + }); + describe('issue #4081', function () { + it('should not return results containing cycles', function () { + var company = { + __typename: 'Company', + id: 1, + name: 'Apollo', + users: [], + }; + company.users.push({ + __typename: 'User', + id: 1, + name: 'Ben', + company: company, + }, { + __typename: 'User', + id: 2, + name: 'James', + company: company, + }); + var query = graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query Query {\n user {\n ...UserFragment\n company {\n users {\n ...UserFragment\n }\n }\n }\n }\n\n fragment UserFragment on User {\n id\n name\n company {\n id\n name\n }\n }\n "], ["\n query Query {\n user {\n ...UserFragment\n company {\n users {\n ...UserFragment\n }\n }\n }\n }\n\n fragment UserFragment on User {\n id\n name\n company {\n id\n name\n }\n }\n "]))); + function check(store) { + var result = reader.diffQueryAgainstStore({ store: store, query: query }).result; + var json = JSON.stringify(result); + company.users.forEach(function (user) { + expect(json).toContain(JSON.stringify(user.name)); + }); + expect(result).toEqual({ + user: { + id: 1, + name: 'Ben', + company: { + id: 1, + name: 'Apollo', + users: [ + { + id: 1, + name: 'Ben', + company: { + id: 1, + name: 'Apollo', + }, + }, + { + id: 2, + name: 'James', + company: { + id: 1, + name: 'Apollo', + }, + }, + ], + }, + }, + }); + } + check(writer.writeQueryToStore({ + query: query, + result: { + user: company.users[0], + }, + })); + check(writer.writeQueryToStore({ + dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, + query: query, + result: { + user: company.users[0], + }, + })); + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31; +//# sourceMappingURL=diffAgainstStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map new file mode 100644 index 000000000..d9c172424 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diffAgainstStore.js","sourceRoot":"","sources":["../../src/__tests__/diffAgainstStore.ts"],"names":[],"mappings":";;;AAAA,iEAA2D;AAC3D,qDAA6C;AAE7C,8CAA+D;AAC/D,kDAA+C;AAC/C,gDAA8C;AAC9C,sDAA8D;AAC9D,kDAA2D;AAG3D,IAAM,uBAAuB,GAAG,IAAI,0CAAwB,EAAE,CAAC,KAAK,CAAC;AAErE,qCAAuB,EAAE,CAAC;AAC1B,SAAgB,SAAS,CAAC,IAAc,EAAE,KAAa;IACrD,IAAI,OAAO,GAAW,IAAa,CAAC;IAC5B,IAAA,qBAAK,CAAa;IAC1B,OAAO,CAAC,KAAK,GAAG,UAAC,CAAM;QACrB,OAAO,GAAG,CAAC,CAAC;IACd,CAAC,CAAC;IAEF,IAAI;QACF,IAAM,MAAM,GAAG,IAAI,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAA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line at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts new file mode 100644 index 000000000..c7c71213a --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=fragmentMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map new file mode 100644 index 000000000..23193f359 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcher.d.ts","sourceRoot":"","sources":["../src/__tests__/fragmentMatcher.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js new file mode 100644 index 000000000..cba24f2e5 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var fragmentMatcher_1 = require("../fragmentMatcher"); +var objectCache_1 = require("../objectCache"); +var inMemoryCache_1 = require("../inMemoryCache"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +describe('FragmentMatcher', function () { + it('can match against the root Query', function () { + var cache = new inMemoryCache_1.InMemoryCache({ + addTypename: true, + }); + var query = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query AllPeople {\n people {\n id\n name\n }\n ...PeopleTypes\n }\n fragment PeopleTypes on Query {\n __type(name: \"Person\") {\n name\n kind\n }\n }\n "], ["\n query AllPeople {\n people {\n id\n name\n }\n ...PeopleTypes\n }\n fragment PeopleTypes on Query {\n __type(name: \"Person\") {\n name\n kind\n }\n }\n "]))); + var data = { + people: [ + { + __typename: 'Person', + id: 123, + name: 'Ben', + }, + ], + __type: { + __typename: '__Type', + name: 'Person', + kind: 'OBJECT', + }, + }; + cache.writeQuery({ query: query, data: data }); + expect(cache.readQuery({ query: query })).toEqual(data); + }); +}); +describe('IntrospectionFragmentMatcher', function () { + it('will throw an error if match is called if it is not ready', function () { + var ifm = new fragmentMatcher_1.IntrospectionFragmentMatcher(); + expect(function () { return ifm.match(); }).toThrowError(/called before/); + }); + it('can be seeded with an introspection query result', function () { + var ifm = new fragmentMatcher_1.IntrospectionFragmentMatcher({ + introspectionQueryResultData: { + __schema: { + types: [ + { + kind: 'UNION', + name: 'Item', + possibleTypes: [ + { + name: 'ItemA', + }, + { + name: 'ItemB', + }, + ], + }, + ], + }, + }, + }); + var store = objectCache_1.defaultNormalizedCacheFactory({ + a: { + __typename: 'ItemB', + }, + }); + var idValue = { + type: 'id', + id: 'a', + generated: false, + }; + var readStoreContext = { + store: store, + returnPartialData: false, + hasMissingField: false, + cacheRedirects: {}, + }; + expect(ifm.match(idValue, 'Item', readStoreContext)).toBe(true); + expect(ifm.match(idValue, 'NotAnItem', readStoreContext)).toBe(false); + }); +}); +var templateObject_1; +//# sourceMappingURL=fragmentMatcher.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map new file mode 100644 index 000000000..68d20355b --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcher.js","sourceRoot":"","sources":["../../src/__tests__/fragmentMatcher.ts"],"names":[],"mappings":";;;AAAA,sDAAkE;AAClE,8CAA+D;AAE/D,kDAAiD;AACjD,oEAA8B;AAE9B,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,kCAA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AAM,KAAK,GAAG,2CAA6B,CAAC;YAC1C,CAAC,EAAE;gBACD,UAAU,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;QAEH,IAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAI;YACV,EAAE,EAAE,GAAG;YACP,SAAS,EAAE,KAAK;SACjB,CAAC;QAEF,IAAM,gBAAgB,GAAG;YACvB,KAAK,OAAA;YACL,iBAAiB,EAAE,KAAK;YACxB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,EAAE;SACC,CAAC;QAEtB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAc,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAc,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAAI,CACnE,KAAK,CACN,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts new file mode 100644 index 000000000..7a55a8b3f --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts @@ -0,0 +1 @@ +//# sourceMappingURL=mapCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map new file mode 100644 index 000000000..c5374f3c1 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mapCache.d.ts","sourceRoot":"","sources":["../src/__tests__/mapCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js new file mode 100644 index 000000000..e6fcb73ed --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js @@ -0,0 +1,18 @@ +jest.mock('../objectCache', function () { + var _a = require('../mapCache'), MapCache = _a.MapCache, mapNormalizedCacheFactory = _a.mapNormalizedCacheFactory; + return { + ObjectCache: MapCache, + defaultNormalizedCacheFactory: mapNormalizedCacheFactory, + }; +}); +describe('MapCache', function () { + require('./objectCache'); + require('./cache'); + require('./diffAgainstStore'); + require('./fragmentMatcher'); + require('./readFromStore'); + require('./diffAgainstStore'); + require('./roundtrip'); + require('./writeToStore'); +}); +//# sourceMappingURL=mapCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map new file mode 100644 index 000000000..e343f39eb --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapCache.js","sourceRoot":"","sources":["../../src/__tests__/mapCache.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;IACpB,IAAA,2BAAgE,EAA9D,sBAAQ,EAAE,wDAAoD,CAAC;IACvE,OAAO;QACL,WAAW,EAAE,QAAQ;QACrB,6BAA6B,EAAE,yBAAyB;KACzD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE;IAGnB,OAAO,CAAC,eAAe,CAAC,CAAC;IACzB,OAAO,CAAC,SAAS,CAAC,CAAC;IACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9B,OAAO,CAAC,aAAa,CAAC,CAAC;IACvB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts new file mode 100644 index 000000000..d609d5349 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=objectCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map new file mode 100644 index 000000000..a2b4f7eec --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectCache.d.ts","sourceRoot":"","sources":["../src/__tests__/objectCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js new file mode 100644 index 000000000..714519dcc --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var objectCache_1 = require("../objectCache"); +describe('ObjectCache', function () { + it('should create an empty cache', function () { + var cache = new objectCache_1.ObjectCache(); + expect(cache.toObject()).toEqual({}); + }); + it('should create a cache based on an Object', function () { + var contents = { a: {} }; + var cache = new objectCache_1.ObjectCache(contents); + expect(cache.toObject()).toEqual(contents); + }); + it("should .get() an object from the store by dataId", function () { + var contents = { a: {} }; + var cache = new objectCache_1.ObjectCache(contents); + expect(cache.get('a')).toBe(contents.a); + }); + it("should .set() an object from the store by dataId", function () { + var obj = {}; + var cache = new objectCache_1.ObjectCache(); + cache.set('a', obj); + expect(cache.get('a')).toBe(obj); + }); + it("should .clear() the store", function () { + var obj = {}; + var cache = new objectCache_1.ObjectCache(); + cache.set('a', obj); + cache.clear(); + expect(cache.get('a')).toBeUndefined(); + }); +}); +//# sourceMappingURL=objectCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map new file mode 100644 index 000000000..9d00c3868 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"objectCache.js","sourceRoot":"","sources":["../../src/__tests__/objectCache.ts"],"names":[],"mappings":";;AAAA,8CAA6C;AAG7C,QAAQ,CAAC,aAAa,EAAE;IACtB,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,QAAQ,GAA0B,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClD,IAAM,KAAK,GAAG,IAAI,yBAAW,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,QAAQ,GAA0B,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClD,IAAM,KAAK,GAAG,IAAI,yBAAW,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,GAAG,GAAG,EAAE,CAAC;QACf,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,IAAM,GAAG,GAAG,EAAE,CAAC;QACf,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts new file mode 100644 index 000000000..a1ad772f2 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=readFromStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map new file mode 100644 index 000000000..9a5c0b17a --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["../src/__tests__/readFromStore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js new file mode 100644 index 000000000..49fbc3c73 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js @@ -0,0 +1,555 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var lodash_1 = require("lodash"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +var apollo_utilities_1 = require("apollo-utilities"); +var __1 = require("../"); +var readFromStore_1 = require("../readFromStore"); +var objectCache_1 = require("../objectCache"); +var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; +var diffAgainstStore_1 = require("./diffAgainstStore"); +describe('reading from the store', function () { + var reader = new readFromStore_1.StoreReader(); + it('runs a nested query with proper fragment fields in arrays', function () { + diffAgainstStore_1.withError(function () { + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + __typename: 'Query', + nestedObj: { type: 'id', id: 'abcde', generated: false }, + }, + abcde: { + id: 'abcde', + innerArray: [ + { type: 'id', generated: true, id: 'abcde.innerArray.0' }, + ], + }, + 'abcde.innerArray.0': { + id: 'abcdef', + someField: 3, + }, + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "], ["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "]))), + fragmentMatcherFunction: fragmentMatcherFunction, + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + nestedObj: { + innerArray: [{ id: 'abcdef', someField: 3 }], + }, + }); + }, /queries contain union or interface types/); + }); + it('rejects malformed queries', function () { + expect(function () { + reader.readQueryFromStore({ + store: objectCache_1.defaultNormalizedCacheFactory(), + query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n query {\n name\n }\n\n query {\n address\n }\n "], ["\n query {\n name\n }\n\n query {\n address\n }\n "]))), + }); + }).toThrowError(/2 operations/); + expect(function () { + reader.readQueryFromStore({ + store: objectCache_1.defaultNormalizedCacheFactory(), + query: graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n fragment x on y {\n name\n }\n "], ["\n fragment x on y {\n name\n }\n "]))), + }); + }).toThrowError(/contain a query/); + }); + it('runs a basic query', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: result, + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n query {\n stringField\n numberField\n }\n "], ["\n query {\n stringField\n numberField\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: result['stringField'], + numberField: result['numberField'], + }); + }); + it('runs a basic query with arguments', function () { + var query = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n query {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); + var variables = { + intArg: 5, + floatArg: 3.14, + stringArg: 'This is a string!', + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + id: 'abcd', + nullField: null, + 'numberField({"floatArg":3.14,"intArg":5})': 5, + 'stringField({"arg":"This is a string!"})': 'Heyo', + }, + }); + var result = reader.readQueryFromStore({ + store: store, + query: query, + variables: variables, + }); + expect(apollo_utilities_1.stripSymbols(result)).toEqual({ + id: 'abcd', + nullField: null, + numberField: 5, + stringField: 'Heyo', + }); + }); + it('runs a basic query with custom directives', function () { + var query = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "], ["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "]))); + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + id: 'abcd', + firstName: 'James', + 'lastName@upperCase': 'BOND', + 'birthDate@dateFormat({"format":"DD-MM-YYYY"})': '20-05-1940', + }, + }); + var result = reader.readQueryFromStore({ + store: store, + query: query, + }); + expect(apollo_utilities_1.stripSymbols(result)).toEqual({ + id: 'abcd', + firstName: 'James', + lastName: 'BOND', + birthDate: '20-05-1940', + }); + }); + it('runs a basic query with default values for arguments', function () { + var query = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int = 0\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int = 0\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); + var variables = { + floatArg: 3.14, + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + id: 'abcd', + nullField: null, + 'numberField({"floatArg":3.14,"intArg":0})': 5, + 'stringField({"arg":"This is a default string!"})': 'Heyo', + }, + }); + var result = reader.readQueryFromStore({ + store: store, + query: query, + variables: variables, + }); + expect(apollo_utilities_1.stripSymbols(result)).toEqual({ + id: 'abcd', + nullField: null, + numberField: 5, + stringField: 'Heyo', + }); + }); + it('runs a nested query', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + nestedObj: { + type: 'id', + id: 'abcde', + generated: false, + }, + }), + abcde: result.nestedObj, + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nestedObj: { + stringField: 'This is a string too!', + numberField: 6, + }, + }); + }); + it('runs a nested query with multiple fragments', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + deepNestedObj: { + stringField: 'This is a deep string', + numberField: 7, + nullField: null, + }, + nullObject: null, + __typename: 'Item', + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj', 'deepNestedObj')), { + __typename: 'Query', + nestedObj: { + type: 'id', + id: 'abcde', + generated: false, + }, + }), + abcde: lodash_1.assign({}, result.nestedObj, { + deepNestedObj: { + type: 'id', + id: 'abcdef', + generated: false, + }, + }), + abcdef: result.deepNestedObj, + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n ... on Query {\n nestedObj {\n stringField\n nullField\n deepNestedObj {\n stringField\n nullField\n }\n }\n }\n ... on Query {\n nestedObj {\n numberField\n nullField\n deepNestedObj {\n numberField\n nullField\n }\n }\n }\n ... on Query {\n nullObject\n }\n }\n "], ["\n {\n stringField\n numberField\n nullField\n ... on Query {\n nestedObj {\n stringField\n nullField\n deepNestedObj {\n stringField\n nullField\n }\n }\n }\n ... on Query {\n nestedObj {\n numberField\n nullField\n deepNestedObj {\n numberField\n nullField\n }\n }\n }\n ... on Query {\n nullObject\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + deepNestedObj: { + stringField: 'This is a deep string', + numberField: 7, + nullField: null, + }, + }, + nullObject: null, + }); + }); + it('runs a nested query with an array without IDs', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + { + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + { + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [ + { type: 'id', generated: true, id: 'abcd.nestedArray.0' }, + { type: 'id', generated: true, id: 'abcd.nestedArray.1' }, + ], + }), + 'abcd.nestedArray.0': result.nestedArray[0], + 'abcd.nestedArray.1': result.nestedArray[1], + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nestedArray: [ + { + stringField: 'This is a string too!', + numberField: 6, + }, + { + stringField: 'This is a string also!', + numberField: 7, + }, + ], + }); + }); + it('runs a nested query with an array without IDs and a null', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + null, + { + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [ + null, + { type: 'id', generated: true, id: 'abcd.nestedArray.1' }, + ], + }), + 'abcd.nestedArray.1': result.nestedArray[1], + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nestedArray: [ + null, + { + stringField: 'This is a string also!', + numberField: 7, + }, + ], + }); + }); + it('runs a nested query with an array with IDs and a null', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + null, + { + id: 'abcde', + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [null, { type: 'id', generated: false, id: 'abcde' }], + }), + abcde: result.nestedArray[1], + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n id\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n id\n stringField\n numberField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nestedArray: [ + null, + { + id: 'abcde', + stringField: 'This is a string also!', + numberField: 7, + }, + ], + }); + }); + it('throws on a missing field', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ ROOT_QUERY: result }); + expect(function () { + reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n {\n stringField\n missingField\n }\n "], ["\n {\n stringField\n missingField\n }\n "]))), + }); + }).toThrowError(/field missingField on object/); + }); + it('runs a nested query where the reference is null', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: null, + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + nestedObj: null, + }), + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + nestedObj: null, + }); + }); + it('runs an array of non-objects', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + simpleArray: ['one', 'two', 'three'], + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { + simpleArray: { + type: 'json', + json: result.simpleArray, + }, + }), + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n simpleArray\n }\n "], ["\n {\n stringField\n numberField\n simpleArray\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + simpleArray: ['one', 'two', 'three'], + }); + }); + it('runs an array of non-objects with null', function () { + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + simpleArray: [null, 'two', 'three'], + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { + simpleArray: { + type: 'json', + json: result.simpleArray, + }, + }), + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n simpleArray\n }\n "], ["\n {\n stringField\n numberField\n simpleArray\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + stringField: 'This is a string!', + numberField: 5, + simpleArray: [null, 'two', 'three'], + }); + }); + it('will read from an arbitrary root id', function () { + var data = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + deepNestedObj: { + stringField: 'This is a deep string', + numberField: 7, + nullField: null, + }, + nullObject: null, + __typename: 'Item', + }; + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(data, 'nestedObj', 'deepNestedObj')), { + __typename: 'Query', + nestedObj: { + type: 'id', + id: 'abcde', + generated: false, + }, + }), + abcde: lodash_1.assign({}, data.nestedObj, { + deepNestedObj: { + type: 'id', + id: 'abcdef', + generated: false, + }, + }), + abcdef: data.deepNestedObj, + }); + var queryResult1 = reader.readQueryFromStore({ + store: store, + rootId: 'abcde', + query: graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n deepNestedObj {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n stringField\n numberField\n nullField\n deepNestedObj {\n stringField\n numberField\n nullField\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult1)).toEqual({ + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + deepNestedObj: { + stringField: 'This is a deep string', + numberField: 7, + nullField: null, + }, + }); + var queryResult2 = reader.readQueryFromStore({ + store: store, + rootId: 'abcdef', + query: graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n }\n "], ["\n {\n stringField\n numberField\n nullField\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult2)).toEqual({ + stringField: 'This is a deep string', + numberField: 7, + nullField: null, + }); + }); + it('properly handles the connection directive', function () { + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + abc: [ + { + generated: true, + id: 'ROOT_QUERY.abc.0', + type: 'id', + }, + ], + }, + 'ROOT_QUERY.abc.0': { + name: 'efgh', + }, + }); + var queryResult = reader.readQueryFromStore({ + store: store, + query: graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "]))), + }); + expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ + books: [ + { + name: 'efgh', + }, + ], + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19; +//# sourceMappingURL=readFromStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map new file mode 100644 index 000000000..93ec353e8 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"readFromStore.js","sourceRoot":"","sources":["../../src/__tests__/readFromStore.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,oEAA8B;AAC9B,qDAAgD;AAEhD,yBAA4D;AAC5D,kDAA+C;AAC/C,8CAA+D;AAE/D,IAAM,uBAAuB,GAAG,IAAI,4BAAwB,EAAE,CAAC,KAAK,CAAC;AACrE,uDAA+C;AAE/C,QAAQ,CAAC,wBAAwB,EAAE;IACjC,IAAM,MAAM,GAAG,IAAI,2BAAW,EAAE,CAAC;IAEjC,EAAE,CAAC,2DAA2D,EAAE;QAC9D,4BAAS,CAAC;YACR,IAAM,KAAK,GAAG,2CAA6B,CAAC;gBAC1C,UAAU,EAAE;oBACV,UAAU,EAAE,OAAO;oBACnB,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;iBAC1C;gBAChB,KAAK,EAAE;oBACL,EAAE,EAAE,OAAO;oBACX,UAAU,EAAE;wBACV,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,oBAAoB,EAAS;qBACjE;iBACa;gBAChB,oBAAoB,EAAE;oBACpB,EAAE,EAAE,QAAQ;oBACZ,SAAS,EAAE,CAAC;iBACE;aACjB,CAAC,CAAC;YAEH,IAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;gBAC5C,KAAK,OAAA;gBACL,KAAK,EAAE,qBAAG,grBAAA,qmBA2BT,IAAA;gBACD,uBAAuB,yBAAA;aACxB,CAAC,CAAC;YAEH,MAAM,CAAC,+BAAY,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;gBACxC,SAAS,EAAE;oBACT,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;iBAC7C;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H,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,KAAK,GAAG,2CAA6B,CAAC;YAC1C,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH;wBACE,SAAS,EAAE,IAAI;wBACf,EAAE,EAAE,kBAAkB;wBACtB,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,MAAM;aACb;SACF,CAAC,CAAC;QAEH,IAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;YAC5C,KAAK,OAAA;YACL,KAAK,EAAE,qBAAG,4MAAA,+HAMT,IAAA;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,+BAAY,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts new file mode 100644 index 000000000..519528bbc --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=recordingCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map new file mode 100644 index 000000000..0029a6c19 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"recordingCache.d.ts","sourceRoot":"","sources":["../src/__tests__/recordingCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js new file mode 100644 index 000000000..29ad65f3d --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var inMemoryCache_1 = require("../inMemoryCache"); +var objectCache_1 = require("../objectCache"); +describe('OptimisticCacheLayer', function () { + function makeLayer(root) { + return new inMemoryCache_1.OptimisticCacheLayer('whatever', root, function () { }); + } + describe('returns correct values during recording', function () { + var data = { + Human: { __typename: 'Human', name: 'Mark' }, + Animal: { __typename: 'Mouse', name: '🐭' }, + }; + var dataToRecord = { + Human: { __typename: 'Human', name: 'John' }, + }; + var underlyingCache = new objectCache_1.ObjectCache(data); + var cache = makeLayer(underlyingCache); + beforeEach(function () { + cache = makeLayer(underlyingCache); + }); + it('should passthrough values if not defined in recording', function () { + expect(cache.get('Human')).toBe(data.Human); + expect(cache.get('Animal')).toBe(data.Animal); + }); + it('should return values defined during recording', function () { + cache.set('Human', dataToRecord.Human); + expect(cache.get('Human')).toBe(dataToRecord.Human); + expect(underlyingCache.get('Human')).toBe(data.Human); + }); + it('should return undefined for values deleted during recording', function () { + expect(cache.get('Animal')).toBe(data.Animal); + cache.delete('Animal'); + expect(cache.get('Animal')).toBeUndefined(); + expect(cache.toObject()).toHaveProperty('Animal'); + expect(underlyingCache.get('Animal')).toBe(data.Animal); + }); + }); + describe('returns correct result of a recorded transaction', function () { + var data = { + Human: { __typename: 'Human', name: 'Mark' }, + Animal: { __typename: 'Mouse', name: '🐭' }, + }; + var dataToRecord = { + Human: { __typename: 'Human', name: 'John' }, + }; + var underlyingCache = new objectCache_1.ObjectCache(data); + var cache = makeLayer(underlyingCache); + var recording; + beforeEach(function () { + cache = makeLayer(underlyingCache); + cache.set('Human', dataToRecord.Human); + cache.delete('Animal'); + recording = cache.toObject(); + }); + it('should contain the property indicating deletion', function () { + expect(recording).toHaveProperty('Animal'); + }); + it('should have recorded the changes made during recording', function () { + expect(recording).toEqual({ + Human: dataToRecord.Human, + Animal: undefined, + }); + }); + it('should keep the original data unaffected', function () { + expect(underlyingCache.toObject()).toEqual(data); + }); + }); +}); +//# sourceMappingURL=recordingCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map new file mode 100644 index 000000000..4c2dd1ce7 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"recordingCache.js","sourceRoot":"","sources":["../../src/__tests__/recordingCache.ts"],"names":[],"mappings":";;AAAA,kDAAwD;AACxD,8CAA6C;AAG7C,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,SAAS,SAAS,CAAC,IAAiB;QAClC,OAAO,IAAI,oCAAoB,CAAC,UAAU,EAAE,IAAI,EAAE,cAAO,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,QAAQ,CAAC,yCAAyC,EAAE;QAClD,IAAM,IAAI,GAAG;YACX,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;YAC5C,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;SAC5C,CAAC;QAEF,IAAM,YAAY,GAAG;YACnB,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;SAC7C,CAAC;QAEF,IAAM,eAAe,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,CAAC;QAE9C,IAAI,KAAK,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;QACvC,UAAU,CAAC;YACT,KAAK,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uDAAuD,EAAE;YAC1D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;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YAAY,GAAG;YACnB,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;SAC7C,CAAC;QAEF,IAAM,eAAe,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,KAAK,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;QACvC,IAAI,SAAgC,CAAC;QAErC,UAAU,CAAC;YACT,KAAK,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;YACnC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YACvC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACvB,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE;YACpD,MAAM,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wDAAwD,EAAE;YAC3D,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;gBACxB,KAAK,EAAE,YAAY,CAAC,KAAK;gBACzB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE;YAC7C,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts new file mode 100644 index 000000000..dc8b7c360 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=roundtrip.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map new file mode 100644 index 000000000..148afc19d --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"roundtrip.d.ts","sourceRoot":"","sources":["../src/__tests__/roundtrip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js new file mode 100644 index 000000000..bc932c57f --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js @@ -0,0 +1,275 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +var diffAgainstStore_1 = require("./diffAgainstStore"); +var writeToStore_1 = require("./writeToStore"); +var depTrackingCache_1 = require("../depTrackingCache"); +var __1 = require("../"); +var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; +function assertDeeplyFrozen(value, stack) { + if (stack === void 0) { stack = []; } + if (value !== null && typeof value === 'object' && stack.indexOf(value) < 0) { + expect(Object.isExtensible(value)).toBe(false); + expect(Object.isFrozen(value)).toBe(true); + stack.push(value); + Object.keys(value).forEach(function (key) { + assertDeeplyFrozen(value[key], stack); + }); + expect(stack.pop()).toBe(value); + } +} +function storeRoundtrip(query, result, variables) { + if (variables === void 0) { variables = {}; } + var reader = new __1.StoreReader(); + var immutableReader = new __1.StoreReader({ freezeResults: true }); + var writer = new __1.StoreWriter(); + var store = writer.writeQueryToStore({ + result: result, + query: query, + variables: variables, + }); + var readOptions = { + store: store, + query: query, + variables: variables, + fragmentMatcherFunction: fragmentMatcherFunction, + }; + var reconstructedResult = reader.readQueryFromStore(readOptions); + expect(reconstructedResult).toEqual(result); + expect(store).toBeInstanceOf(depTrackingCache_1.DepTrackingCache); + expect(reader.readQueryFromStore(readOptions)).toBe(reconstructedResult); + var immutableResult = immutableReader.readQueryFromStore(readOptions); + expect(immutableResult).toEqual(reconstructedResult); + expect(immutableReader.readQueryFromStore(readOptions)).toBe(immutableResult); + if (process.env.NODE_ENV !== 'production') { + try { + immutableResult.illegal = 'this should not work'; + throw new Error('unreached'); + } + catch (e) { + expect(e.message).not.toMatch(/unreached/); + expect(e).toBeInstanceOf(TypeError); + } + assertDeeplyFrozen(immutableResult); + } + writer.writeQueryToStore({ + store: store, + result: { oyez: 1234 }, + query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n oyez\n }\n "], ["\n {\n oyez\n }\n "]))), + }); + var deletedRootResult = reader.readQueryFromStore(readOptions); + expect(deletedRootResult).toEqual(result); + if (deletedRootResult === reconstructedResult) { + return; + } + Object.keys(result).forEach(function (key) { + expect(deletedRootResult[key]).toBe(reconstructedResult[key]); + }); +} +describe('roundtrip', function () { + it('real graphql result', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "]))), { + people_one: { + name: 'Luke Skywalker', + }, + }); + }); + it('multidimensional array (#776)', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n rows {\n value\n }\n }\n "], ["\n {\n rows {\n value\n }\n }\n "]))), { + rows: [[{ value: 1 }, { value: 2 }], [{ value: 3 }, { value: 4 }]], + }); + }); + it('array with null values (#1551)', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n list {\n value\n }\n }\n "], ["\n {\n list {\n value\n }\n }\n "]))), { + list: [null, { value: 1 }], + }); + }); + it('enum arguments', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n hero(episode: JEDI) {\n name\n }\n }\n "], ["\n {\n hero(episode: JEDI) {\n name\n }\n }\n "]))), { + hero: { + name: 'Luke Skywalker', + }, + }); + }); + it('with an alias', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n {\n luke: people_one(id: \"1\") {\n name\n }\n vader: people_one(id: \"4\") {\n name\n }\n }\n "], ["\n {\n luke: people_one(id: \"1\") {\n name\n }\n vader: people_one(id: \"4\") {\n name\n }\n }\n "]))), { + luke: { + name: 'Luke Skywalker', + }, + vader: { + name: 'Darth Vader', + }, + }); + }); + it('with variables', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n {\n luke: people_one(id: $lukeId) {\n name\n }\n vader: people_one(id: $vaderId) {\n name\n }\n }\n "], ["\n {\n luke: people_one(id: $lukeId) {\n name\n }\n vader: people_one(id: $vaderId) {\n name\n }\n }\n "]))), { + luke: { + name: 'Luke Skywalker', + }, + vader: { + name: 'Darth Vader', + }, + }, { + lukeId: '1', + vaderId: '4', + }); + }); + it('with GraphQLJSON scalar type', function () { + var updateClub = { + uid: '1d7f836018fc11e68d809dfee940f657', + name: 'Eple', + settings: { + name: 'eple', + currency: 'AFN', + calendarStretch: 2, + defaultPreAllocationPeriod: 1, + confirmationEmailCopy: null, + emailDomains: null, + }, + }; + storeRoundtrip(graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n updateClub {\n uid\n name\n settings\n }\n }\n "], ["\n {\n updateClub {\n uid\n name\n settings\n }\n }\n "]))), { + updateClub: updateClub, + }); + expect(Object.isExtensible(updateClub)).toBe(true); + expect(Object.isFrozen(updateClub)).toBe(false); + }); + describe('directives', function () { + it('should be able to query with skip directive true', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query {\n fortuneCookie @skip(if: true)\n }\n "], ["\n query {\n fortuneCookie @skip(if: true)\n }\n "]))), {}); + }); + it('should be able to query with skip directive false', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n fortuneCookie @skip(if: false)\n }\n "], ["\n query {\n fortuneCookie @skip(if: false)\n }\n "]))), { fortuneCookie: 'live long and prosper' }); + }); + }); + describe('fragments', function () { + it('should work on null fields', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n query {\n field {\n ... on Obj {\n stuff\n }\n }\n }\n "], ["\n query {\n field {\n ... on Obj {\n stuff\n }\n }\n }\n "]))), { + field: null, + }); + }); + it('should work on basic inline fragments', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n query {\n field {\n __typename\n ... on Obj {\n stuff\n }\n }\n }\n "], ["\n query {\n field {\n __typename\n ... on Obj {\n stuff\n }\n }\n }\n "]))), { + field: { + __typename: 'Obj', + stuff: 'Result', + }, + }); + }); + it('should resolve on union types with inline fragments without typenames with warning', function () { + return writeToStore_1.withWarning(function () { + storeRoundtrip(graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n query {\n all_people {\n name\n ... on Jedi {\n side\n }\n ... on Droid {\n model\n }\n }\n }\n "], ["\n query {\n all_people {\n name\n ... on Jedi {\n side\n }\n ... on Droid {\n model\n }\n }\n }\n "]))), { + all_people: [ + { + name: 'Luke Skywalker', + side: 'bright', + }, + { + name: 'R2D2', + model: 'astromech', + }, + ], + }); + }, /using fragments/); + }); + it('should throw an error on two of the same inline fragment types', function () { + return expect(function () { + storeRoundtrip(graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n query {\n all_people {\n __typename\n name\n ... on Jedi {\n side\n }\n ... on Jedi {\n rank\n }\n }\n }\n "], ["\n query {\n all_people {\n __typename\n name\n ... on Jedi {\n side\n }\n ... on Jedi {\n rank\n }\n }\n }\n "]))), { + all_people: [ + { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + ], + }); + }).toThrowError(/Can\'t find field rank on object/); + }); + it('should resolve fields it can on interface with non matching inline fragments', function () { + return diffAgainstStore_1.withError(function () { + storeRoundtrip(graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n query {\n dark_forces {\n __typename\n name\n ... on Droid {\n model\n }\n }\n }\n "], ["\n query {\n dark_forces {\n __typename\n name\n ... on Droid {\n model\n }\n }\n }\n "]))), { + dark_forces: [ + { + __typename: 'Droid', + name: '8t88', + model: '88', + }, + { + __typename: 'Darth', + name: 'Anakin Skywalker', + }, + ], + }); + }, /IntrospectionFragmentMatcher/); + }); + it('should resolve on union types with spread fragments', function () { + return diffAgainstStore_1.withError(function () { + storeRoundtrip(graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n __typename\n name\n ...jediFragment\n ...droidFragment\n }\n }\n "], ["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n __typename\n name\n ...jediFragment\n ...droidFragment\n }\n }\n "]))), { + all_people: [ + { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + { + __typename: 'Droid', + name: 'R2D2', + model: 'astromech', + }, + ], + }); + }, /IntrospectionFragmentMatcher/); + }); + it('should work with a fragment on the actual interface or union', function () { + return diffAgainstStore_1.withError(function () { + storeRoundtrip(graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Character {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n name\n __typename\n ...jediFragment\n ...droidFragment\n }\n }\n "], ["\n fragment jediFragment on Character {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n name\n __typename\n ...jediFragment\n ...droidFragment\n }\n }\n "]))), { + all_people: [ + { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + { + __typename: 'Droid', + name: 'R2D2', + model: 'astromech', + }, + ], + }); + }, /IntrospectionFragmentMatcher/); + }); + it('should throw on error on two of the same spread fragment types', function () { + expect(function () { + return storeRoundtrip(graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n fragment jediSide on Jedi {\n side\n }\n\n fragment jediRank on Jedi {\n rank\n }\n\n query {\n all_people {\n __typename\n name\n ...jediSide\n ...jediRank\n }\n }\n "], ["\n fragment jediSide on Jedi {\n side\n }\n\n fragment jediRank on Jedi {\n rank\n }\n\n query {\n all_people {\n __typename\n name\n ...jediSide\n ...jediRank\n }\n }\n "]))), { + all_people: [ + { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + ], + }); + }).toThrowError(/Can\'t find field rank on object/); + }); + it('should resolve on @include and @skip with inline fragments', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n query {\n person {\n name\n __typename\n ... on Jedi @include(if: true) {\n side\n }\n ... on Droid @skip(if: true) {\n model\n }\n }\n }\n "], ["\n query {\n person {\n name\n __typename\n ... on Jedi @include(if: true) {\n side\n }\n ... on Droid @skip(if: true) {\n model\n }\n }\n }\n "]))), { + person: { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + }); + }); + it('should resolve on @include and @skip with spread fragments', function () { + storeRoundtrip(graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n person {\n name\n __typename\n ...jediFragment @include(if: true)\n ...droidFragment @skip(if: true)\n }\n }\n "], ["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n person {\n name\n __typename\n ...jediFragment @include(if: true)\n ...droidFragment @skip(if: true)\n }\n }\n "]))), { + person: { + __typename: 'Jedi', + name: 'Luke Skywalker', + side: 'bright', + }, + }); + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20; +//# sourceMappingURL=roundtrip.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map new file mode 100644 index 000000000..1b36787a8 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map @@ -0,0 +1 @@ +{"version":3,"file":"roundtrip.js","sourceRoot":"","sources":["../../src/__tests__/roundtrip.ts"],"names":[],"mappings":";;;AACA,oEAA8B;AAE9B,uDAA+C;AAC/C,+CAA6C;AAE7C,wDAAuD;AAEvD,yBAAyE;AAEzE,IAAM,uBAAuB,GAAG,IAAI,4BAAwB,EAAE,CAAC,KAAK,CAAC;AAErE,SAAS,kBAAkB,CAAC,KAAU,EAAE,KAAiB;IAAjB,sBAAA,EAAA,UAAiB;IACvD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QAC3E,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,KAAK,CAAC,IAAI,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AI,EAAE,QAAQ;iBACf;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts new file mode 100644 index 000000000..bd5caecc2 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts @@ -0,0 +1,2 @@ +export declare function withWarning(func: Function, regex: RegExp): Promise; +//# sourceMappingURL=writeToStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map new file mode 100644 index 000000000..b0a79c295 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"writeToStore.d.ts","sourceRoot":"","sources":["../src/__tests__/writeToStore.ts"],"names":[],"mappings":"AA2BA,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAWxD"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js new file mode 100644 index 000000000..29fabfb04 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js @@ -0,0 +1,1523 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var lodash_1 = require("lodash"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +var apollo_utilities_1 = require("apollo-utilities"); +var writeToStore_1 = require("../writeToStore"); +var objectCache_1 = require("../objectCache"); +var __1 = require("../"); +function withWarning(func, regex) { + var message = null; + var oldWarn = console.warn; + console.warn = function (m) { return (message = m); }; + return Promise.resolve(func()).then(function (val) { + expect(message).toMatch(regex); + console.warn = oldWarn; + return val; + }); +} +exports.withWarning = withWarning; +var getIdField = function (_a) { + var id = _a.id; + return id; +}; +describe('writing to the store', function () { + var writer = new writeToStore_1.StoreWriter(); + it('properly normalizes a trivial item', function () { + var query = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }) + .toObject()).toEqual({ + ROOT_QUERY: result, + }); + }); + it('properly normalizes an aliased field', function () { + var query = graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n id\n aliasedField: stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n aliasedField: stringField\n numberField\n nullField\n }\n "]))); + var result = { + id: 'abcd', + aliasedField: 'This is a string!', + numberField: 5, + nullField: null, + }; + var normalized = writer.writeQueryToStore({ + result: result, + query: query, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + }, + }); + }); + it('properly normalizes a aliased fields with arguments', function () { + var query = graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n id\n aliasedField1: stringField(arg: 1)\n aliasedField2: stringField(arg: 2)\n numberField\n nullField\n }\n "], ["\n {\n id\n aliasedField1: stringField(arg: 1)\n aliasedField2: stringField(arg: 2)\n numberField\n nullField\n }\n "]))); + var result = { + id: 'abcd', + aliasedField1: 'The arg was 1!', + aliasedField2: 'The arg was 2!', + numberField: 5, + nullField: null, + }; + var normalized = writer.writeQueryToStore({ + result: result, + query: query, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'abcd', + 'stringField({"arg":1})': 'The arg was 1!', + 'stringField({"arg":2})': 'The arg was 2!', + numberField: 5, + nullField: null, + }, + }); + }); + it('properly normalizes a query with variables', function () { + var query = graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); + var variables = { + intArg: 5, + floatArg: 3.14, + stringArg: 'This is a string!', + }; + var result = { + id: 'abcd', + stringField: 'Heyo', + numberField: 5, + nullField: null, + }; + var normalized = writer.writeQueryToStore({ + result: result, + query: query, + variables: variables, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'abcd', + nullField: null, + 'numberField({"floatArg":3.14,"intArg":5})': 5, + 'stringField({"arg":"This is a string!"})': 'Heyo', + }, + }); + }); + it('properly normalizes a query with default values', function () { + var query = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); + var variables = { + intArg: 5, + floatArg: 3.14, + }; + var result = { + id: 'abcd', + stringField: 'Heyo', + numberField: 5, + nullField: null, + }; + var normalized = writer.writeQueryToStore({ + result: result, + query: query, + variables: variables, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'abcd', + nullField: null, + 'numberField({"floatArg":3.14,"intArg":5})': 5, + 'stringField({"arg":"This is a default string!"})': 'Heyo', + }, + }); + }); + it('properly normalizes a query with custom directives', function () { + var query = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "], ["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "]))); + var result = { + id: 'abcd', + firstName: 'James', + lastName: 'BOND', + birthDate: '20-05-1940', + }; + var normalized = writer.writeQueryToStore({ + result: result, + query: query, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'abcd', + firstName: 'James', + 'lastName@upperCase': 'BOND', + 'birthDate@dateFormat({"format":"DD-MM-YYYY"})': '20-05-1940', + }, + }); + }); + it('properly normalizes a nested object with an ID', function () { + var _a; + var query = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }) + .toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + nestedObj: { + type: 'id', + id: result.nestedObj.id, + generated: false, + }, + }) + }, + _a[result.nestedObj.id] = result.nestedObj, + _a)); + }); + it('properly normalizes a nested object without an ID', function () { + var _a; + var query = graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }) + .toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + nestedObj: { + type: 'id', + id: "$ROOT_QUERY.nestedObj", + generated: true, + }, + }) + }, + _a["$ROOT_QUERY.nestedObj"] = result.nestedObj, + _a)); + }); + it('properly normalizes a nested object with arguments but without an ID', function () { + var _a; + var query = graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj(arg: \"val\") {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj(arg: \"val\") {\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: { + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }) + .toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + 'nestedObj({"arg":"val"})': { + type: 'id', + id: "$ROOT_QUERY.nestedObj({\"arg\":\"val\"})", + generated: true, + }, + }) + }, + _a["$ROOT_QUERY.nestedObj({\"arg\":\"val\"})"] = result.nestedObj, + _a)); + }); + it('properly normalizes a nested array with IDs', function () { + var _a; + var query = graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + { + id: 'abcdef', + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }) + .toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: result.nestedArray.map(function (obj) { return ({ + type: 'id', + id: obj.id, + generated: false, + }); }), + }) + }, + _a[result.nestedArray[0].id] = result.nestedArray[0], + _a[result.nestedArray[1].id] = result.nestedArray[1], + _a)); + }); + it('properly normalizes a nested array with IDs and a null', function () { + var _a; + var query = graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + { + id: 'abcde', + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + null, + ], + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }) + .toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [ + { type: 'id', id: result.nestedArray[0].id, generated: false }, + null, + ], + }) + }, + _a[result.nestedArray[0].id] = result.nestedArray[0], + _a)); + }); + it('properly normalizes a nested array without IDs', function () { + var _a; + var query = graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + { + stringField: 'This is a string too!', + numberField: 6, + nullField: null, + }, + { + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }); + expect(normalized.toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [ + { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.0" }, + { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.1" }, + ], + }) + }, + _a["ROOT_QUERY.nestedArray.0"] = result.nestedArray[0], + _a["ROOT_QUERY.nestedArray.1"] = result.nestedArray[1], + _a)); + }); + it('properly normalizes a nested array without IDs and a null item', function () { + var _a; + var query = graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedArray: [ + null, + { + stringField: 'This is a string also!', + numberField: 7, + nullField: null, + }, + ], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }); + expect(normalized.toObject()).toEqual((_a = { + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { + nestedArray: [ + null, + { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.1" }, + ], + }) + }, + _a["ROOT_QUERY.nestedArray.1"] = result.nestedArray[1], + _a)); + }); + it('properly normalizes an array of non-objects', function () { + var query = graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + simpleArray: ['one', 'two', 'three'], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { + simpleArray: { + type: 'json', + json: [ + result.simpleArray[0], + result.simpleArray[1], + result.simpleArray[2], + ], + }, + }), + }); + }); + it('properly normalizes an array of non-objects with null', function () { + var query = graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + simpleArray: [null, 'two', 'three'], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { + simpleArray: { + type: 'json', + json: [ + result.simpleArray[0], + result.simpleArray[1], + result.simpleArray[2], + ], + }, + }), + }); + }); + it('properly normalizes an object occurring in different graphql paths twice', function () { + var query = graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n id\n object1 {\n id\n stringField\n }\n object2 {\n id\n numberField\n }\n }\n "], ["\n {\n id\n object1 {\n id\n stringField\n }\n object2 {\n id\n numberField\n }\n }\n "]))); + var result = { + id: 'a', + object1: { + id: 'aa', + stringField: 'string', + }, + object2: { + id: 'aa', + numberField: 1, + }, + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'a', + object1: { + type: 'id', + id: 'aa', + generated: false, + }, + object2: { + type: 'id', + id: 'aa', + generated: false, + }, + }, + aa: { + id: 'aa', + stringField: 'string', + numberField: 1, + }, + }); + }); + it('properly normalizes an object occurring in different graphql array paths twice', function () { + var query = graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n }\n }\n array2 {\n id\n stringField\n obj {\n id\n numberField\n }\n }\n }\n "], ["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n }\n }\n array2 {\n id\n stringField\n obj {\n id\n numberField\n }\n }\n }\n "]))); + var result = { + id: 'a', + array1: [ + { + id: 'aa', + stringField: 'string', + obj: { + id: 'aaa', + stringField: 'string', + }, + }, + ], + array2: [ + { + id: 'ab', + stringField: 'string2', + obj: { + id: 'aaa', + numberField: 1, + }, + }, + ], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'a', + array1: [ + { + type: 'id', + id: 'aa', + generated: false, + }, + ], + array2: [ + { + type: 'id', + id: 'ab', + generated: false, + }, + ], + }, + aa: { + id: 'aa', + stringField: 'string', + obj: { + type: 'id', + id: 'aaa', + generated: false, + }, + }, + ab: { + id: 'ab', + stringField: 'string2', + obj: { + type: 'id', + id: 'aaa', + generated: false, + }, + }, + aaa: { + id: 'aaa', + stringField: 'string', + numberField: 1, + }, + }); + }); + it('properly normalizes an object occurring in the same graphql array path twice', function () { + var query = graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n numberField\n }\n }\n }\n "], ["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n numberField\n }\n }\n }\n "]))); + var result = { + id: 'a', + array1: [ + { + id: 'aa', + stringField: 'string', + obj: { + id: 'aaa', + stringField: 'string', + numberField: 1, + }, + }, + { + id: 'ab', + stringField: 'string2', + obj: { + id: 'aaa', + stringField: 'should not be written', + numberField: 2, + }, + }, + ], + }; + var normalized = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }); + expect(normalized.toObject()).toEqual({ + ROOT_QUERY: { + id: 'a', + array1: [ + { + type: 'id', + id: 'aa', + generated: false, + }, + { + type: 'id', + id: 'ab', + generated: false, + }, + ], + }, + aa: { + id: 'aa', + stringField: 'string', + obj: { + type: 'id', + id: 'aaa', + generated: false, + }, + }, + ab: { + id: 'ab', + stringField: 'string2', + obj: { + type: 'id', + id: 'aaa', + generated: false, + }, + }, + aaa: { + id: 'aaa', + stringField: 'string', + numberField: 1, + }, + }); + }); + it('merges nodes', function () { + var query = graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n {\n id\n numberField\n nullField\n }\n "], ["\n {\n id\n numberField\n nullField\n }\n "]))); + var result = { + id: 'abcd', + numberField: 5, + nullField: null, + }; + var store = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + dataIdFromObject: getIdField, + }); + var query2 = graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n nullField\n }\n "], ["\n {\n id\n stringField\n nullField\n }\n "]))); + var result2 = { + id: 'abcd', + stringField: 'This is a string!', + nullField: null, + }; + var store2 = writer.writeQueryToStore({ + store: store, + query: query2, + result: result2, + dataIdFromObject: getIdField, + }); + expect(store2.toObject()).toEqual({ + ROOT_QUERY: lodash_1.assign({}, result, result2), + }); + }); + it('properly normalizes a nested object that returns null', function () { + var query = graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + nestedObj: null, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }) + .toObject()).toEqual({ + ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { + nestedObj: null, + }), + }); + }); + it('properly normalizes an object with an ID when no extension is passed', function () { + var query = graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"5\") {\n id\n stringField\n }\n }\n "], ["\n {\n people_one(id: \"5\") {\n id\n stringField\n }\n }\n "]))); + var result = { + people_one: { + id: 'abcd', + stringField: 'This is a string!', + }, + }; + expect(writer + .writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }) + .toObject()).toEqual({ + ROOT_QUERY: { + 'people_one({"id":"5"})': { + type: 'id', + id: '$ROOT_QUERY.people_one({"id":"5"})', + generated: true, + }, + }, + '$ROOT_QUERY.people_one({"id":"5"})': { + id: 'abcd', + stringField: 'This is a string!', + }, + }); + }); + it('consistently serialize different types of input when passed inlined or as variable', function () { + var testData = [ + { + mutation: graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Int!) {\n mut(inline: 5, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Int!) {\n mut(inline: 5, variable: $in) {\n id\n }\n }\n "]))), + variables: { in: 5 }, + expected: 'mut({"inline":5,"variable":5})', + }, + { + mutation: graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Float!) {\n mut(inline: 5.5, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Float!) {\n mut(inline: 5.5, variable: $in) {\n id\n }\n }\n "]))), + variables: { in: 5.5 }, + expected: 'mut({"inline":5.5,"variable":5.5})', + }, + { + mutation: graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n mutation mut($in: String!) {\n mut(inline: \"abc\", variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: String!) {\n mut(inline: \"abc\", variable: $in) {\n id\n }\n }\n "]))), + variables: { in: 'abc' }, + expected: 'mut({"inline":"abc","variable":"abc"})', + }, + { + mutation: graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Array!) {\n mut(inline: [1, 2], variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Array!) {\n mut(inline: [1, 2], variable: $in) {\n id\n }\n }\n "]))), + variables: { in: [1, 2] }, + expected: 'mut({"inline":[1,2],"variable":[1,2]})', + }, + { + mutation: graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Object!) {\n mut(inline: { a: 1 }, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Object!) {\n mut(inline: { a: 1 }, variable: $in) {\n id\n }\n }\n "]))), + variables: { in: { a: 1 } }, + expected: 'mut({"inline":{"a":1},"variable":{"a":1}})', + }, + { + mutation: graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Boolean!) {\n mut(inline: true, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Boolean!) {\n mut(inline: true, variable: $in) {\n id\n }\n }\n "]))), + variables: { in: true }, + expected: 'mut({"inline":true,"variable":true})', + }, + ]; + function isOperationDefinition(definition) { + return definition.kind === 'OperationDefinition'; + } + function isField(selection) { + return selection.kind === 'Field'; + } + testData.forEach(function (data) { + data.mutation.definitions.forEach(function (definition) { + if (isOperationDefinition(definition)) { + definition.selectionSet.selections.forEach(function (selection) { + if (isField(selection)) { + expect(apollo_utilities_1.storeKeyNameFromField(selection, data.variables)).toEqual(data.expected); + } + }); + } + }); + }); + }); + it('properly normalizes a mutation with object or array parameters and variables', function () { + var mutation = graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n mutation some_mutation($nil: ID, $in: Object) {\n some_mutation(\n input: {\n id: \"5\"\n arr: [1, { a: \"b\" }]\n obj: { a: \"b\" }\n num: 5.5\n nil: $nil\n bo: true\n }\n ) {\n id\n }\n some_mutation_with_variables(input: $in) {\n id\n }\n }\n "], ["\n mutation some_mutation($nil: ID, $in: Object) {\n some_mutation(\n input: {\n id: \"5\"\n arr: [1, { a: \"b\" }]\n obj: { a: \"b\" }\n num: 5.5\n nil: $nil\n bo: true\n }\n ) {\n id\n }\n some_mutation_with_variables(input: $in) {\n id\n }\n }\n "]))); + var result = { + some_mutation: { + id: 'id', + }, + some_mutation_with_variables: { + id: 'id', + }, + }; + var variables = { + nil: null, + in: { + id: '5', + arr: [1, { a: 'b' }], + obj: { a: 'b' }, + num: 5.5, + nil: null, + bo: true, + }, + }; + function isOperationDefinition(value) { + return value.kind === 'OperationDefinition'; + } + mutation.definitions.map(function (def) { + if (isOperationDefinition(def)) { + expect(writer + .writeSelectionSetToStore({ + dataId: '5', + selectionSet: def.selectionSet, + result: lodash_1.cloneDeep(result), + context: { + store: objectCache_1.defaultNormalizedCacheFactory(), + variables: variables, + dataIdFromObject: function () { return '5'; }, + }, + }) + .toObject()).toEqual({ + '5': { + id: 'id', + 'some_mutation({"input":{"arr":[1,{"a":"b"}],"bo":true,"id":"5","nil":null,"num":5.5,"obj":{"a":"b"}}})': { + generated: false, + id: '5', + type: 'id', + }, + 'some_mutation_with_variables({"input":{"arr":[1,{"a":"b"}],"bo":true,"id":"5","nil":null,"num":5.5,"obj":{"a":"b"}}})': { + generated: false, + id: '5', + type: 'id', + }, + }, + }); + } + else { + throw 'No operation definition found'; + } + }); + }); + it('should write to store if `dataIdFromObject` returns an ID of 0', function () { + var query = graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); + var data = { + author: { + id: 0, + __typename: 'Author', + firstName: 'John', + }, + }; + var expStore = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + author: { + id: 0, + typename: 'Author', + type: 'id', + generated: false, + }, + }, + 0: { + id: data.author.id, + __typename: data.author.__typename, + firstName: data.author.firstName, + }, + }); + expect(writer + .writeQueryToStore({ + result: data, + query: query, + dataIdFromObject: function () { return 0; }, + }) + .toObject()).toEqual(expStore.toObject()); + }); + describe('type escaping', function () { + var dataIdFromObject = function (object) { + if (object.__typename && object.id) { + return object.__typename + '__' + object.id; + } + return undefined; + }; + it('should correctly escape generated ids', function () { + var query = graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n lastName\n }\n }\n "], ["\n query {\n author {\n firstName\n lastName\n }\n }\n "]))); + var data = { + author: { + firstName: 'John', + lastName: 'Smith', + }, + }; + var expStore = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: { + author: { + type: 'id', + id: '$ROOT_QUERY.author', + generated: true, + }, + }, + '$ROOT_QUERY.author': data.author, + }); + expect(writer + .writeQueryToStore({ + result: data, + query: query, + }) + .toObject()).toEqual(expStore.toObject()); + }); + it('should correctly escape real ids', function () { + var _a; + var query = graphql_tag_1.default(templateObject_32 || (templateObject_32 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); + var data = { + author: { + firstName: 'John', + id: '129', + __typename: 'Author', + }, + }; + var expStore = objectCache_1.defaultNormalizedCacheFactory((_a = { + ROOT_QUERY: { + author: { + type: 'id', + id: dataIdFromObject(data.author), + generated: false, + typename: 'Author', + }, + } + }, + _a[dataIdFromObject(data.author)] = { + firstName: data.author.firstName, + id: data.author.id, + __typename: data.author.__typename, + }, + _a)); + expect(writer + .writeQueryToStore({ + result: data, + query: query, + dataIdFromObject: dataIdFromObject, + }) + .toObject()).toEqual(expStore.toObject()); + }); + it('should correctly escape json blobs', function () { + var _a; + var query = graphql_tag_1.default(templateObject_33 || (templateObject_33 = tslib_1.__makeTemplateObject(["\n query {\n author {\n info\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n info\n id\n __typename\n }\n }\n "]))); + var data = { + author: { + info: { + name: 'John', + }, + id: '129', + __typename: 'Author', + }, + }; + var expStore = objectCache_1.defaultNormalizedCacheFactory((_a = { + ROOT_QUERY: { + author: { + type: 'id', + id: dataIdFromObject(data.author), + generated: false, + typename: 'Author', + }, + } + }, + _a[dataIdFromObject(data.author)] = { + __typename: data.author.__typename, + id: data.author.id, + info: { + type: 'json', + json: data.author.info, + }, + }, + _a)); + expect(writer + .writeQueryToStore({ + result: data, + query: query, + dataIdFromObject: dataIdFromObject, + }) + .toObject()).toEqual(expStore.toObject()); + }); + }); + it('should merge objects when overwriting a generated id with a real id', function () { + var dataWithoutId = { + author: { + firstName: 'John', + lastName: 'Smith', + __typename: 'Author', + }, + }; + var dataWithId = { + author: { + firstName: 'John', + id: '129', + __typename: 'Author', + }, + }; + var dataIdFromObject = function (object) { + if (object.__typename && object.id) { + return object.__typename + '__' + object.id; + } + return undefined; + }; + var queryWithoutId = graphql_tag_1.default(templateObject_34 || (templateObject_34 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n lastName\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n lastName\n __typename\n }\n }\n "]))); + var queryWithId = graphql_tag_1.default(templateObject_35 || (templateObject_35 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); + var expStoreWithoutId = objectCache_1.defaultNormalizedCacheFactory({ + '$ROOT_QUERY.author': { + firstName: 'John', + lastName: 'Smith', + __typename: 'Author', + }, + ROOT_QUERY: { + author: { + type: 'id', + id: '$ROOT_QUERY.author', + generated: true, + typename: 'Author', + }, + }, + }); + var expStoreWithId = objectCache_1.defaultNormalizedCacheFactory({ + Author__129: { + firstName: 'John', + lastName: 'Smith', + id: '129', + __typename: 'Author', + }, + ROOT_QUERY: { + author: { + type: 'id', + id: 'Author__129', + generated: false, + typename: 'Author', + }, + }, + }); + var storeWithoutId = writer.writeQueryToStore({ + result: dataWithoutId, + query: queryWithoutId, + dataIdFromObject: dataIdFromObject, + }); + expect(storeWithoutId.toObject()).toEqual(expStoreWithoutId.toObject()); + var storeWithId = writer.writeQueryToStore({ + result: dataWithId, + query: queryWithId, + store: storeWithoutId, + dataIdFromObject: dataIdFromObject, + }); + expect(storeWithId.toObject()).toEqual(expStoreWithId.toObject()); + }); + it('should allow a union of objects of a different type, when overwriting a generated id with a real id', function () { + var dataWithPlaceholder = { + author: { + hello: 'Foo', + __typename: 'Placeholder', + }, + }; + var dataWithAuthor = { + author: { + firstName: 'John', + lastName: 'Smith', + id: '129', + __typename: 'Author', + }, + }; + var dataIdFromObject = function (object) { + if (object.__typename && object.id) { + return object.__typename + '__' + object.id; + } + return undefined; + }; + var query = graphql_tag_1.default(templateObject_36 || (templateObject_36 = tslib_1.__makeTemplateObject(["\n query {\n author {\n ... on Author {\n firstName\n lastName\n id\n __typename\n }\n ... on Placeholder {\n hello\n __typename\n }\n }\n }\n "], ["\n query {\n author {\n ... on Author {\n firstName\n lastName\n id\n __typename\n }\n ... on Placeholder {\n hello\n __typename\n }\n }\n }\n "]))); + var expStoreWithPlaceholder = objectCache_1.defaultNormalizedCacheFactory({ + '$ROOT_QUERY.author': { + hello: 'Foo', + __typename: 'Placeholder', + }, + ROOT_QUERY: { + author: { + type: 'id', + id: '$ROOT_QUERY.author', + generated: true, + typename: 'Placeholder', + }, + }, + }); + var expStoreWithAuthor = objectCache_1.defaultNormalizedCacheFactory({ + Author__129: { + firstName: 'John', + lastName: 'Smith', + id: '129', + __typename: 'Author', + }, + ROOT_QUERY: { + author: { + type: 'id', + id: 'Author__129', + generated: false, + typename: 'Author', + }, + }, + }); + var store = writer.writeQueryToStore({ + result: dataWithPlaceholder, + query: query, + dataIdFromObject: dataIdFromObject, + }); + expect(store.toObject()).toEqual(expStoreWithPlaceholder.toObject()); + writer.writeQueryToStore({ + result: dataWithAuthor, + query: query, + store: store, + dataIdFromObject: dataIdFromObject, + }); + expect(store.toObject()).toEqual(expStoreWithAuthor.toObject()); + writer.writeQueryToStore({ + result: dataWithPlaceholder, + query: query, + store: store, + dataIdFromObject: dataIdFromObject, + }); + expect(store.toObject()).toEqual(tslib_1.__assign({}, expStoreWithAuthor.toObject(), expStoreWithPlaceholder.toObject())); + }); + it('does not swallow errors other than field errors', function () { + var query = graphql_tag_1.default(templateObject_37 || (templateObject_37 = tslib_1.__makeTemplateObject(["\n query {\n ...notARealFragment\n fortuneCookie\n }\n "], ["\n query {\n ...notARealFragment\n fortuneCookie\n }\n "]))); + var result = { + fortuneCookie: 'Star Wars unit tests are boring', + }; + expect(function () { + writer.writeQueryToStore({ + result: result, + query: query, + }); + }).toThrowError(/No fragment/); + }); + it('does not change object references if the value is the same', function () { + var query = graphql_tag_1.default(templateObject_38 || (templateObject_38 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n }\n "]))); + var result = { + id: 'abcd', + stringField: 'This is a string!', + numberField: 5, + nullField: null, + }; + var store = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + }); + var newStore = writer.writeQueryToStore({ + query: query, + result: lodash_1.cloneDeep(result), + store: objectCache_1.defaultNormalizedCacheFactory(store.toObject()), + }); + Object.keys(store.toObject()).forEach(function (field) { + expect(store.get(field)).toEqual(newStore.get(field)); + }); + }); + describe('writeResultToStore shape checking', function () { + var query = graphql_tag_1.default(templateObject_39 || (templateObject_39 = tslib_1.__makeTemplateObject(["\n query {\n todos {\n id\n name\n description\n }\n }\n "], ["\n query {\n todos {\n id\n name\n description\n }\n }\n "]))); + it('should write the result data without validating its shape when a fragment matcher is not provided', function () { + var result = { + todos: [ + { + id: '1', + name: 'Todo 1', + }, + ], + }; + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + dataIdFromObject: getIdField, + }); + expect(newStore.get('1')).toEqual(result.todos[0]); + }); + it('should warn when it receives the wrong data with non-union fragments (using an heuristic matcher)', function () { + var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; + var result = { + todos: [ + { + id: '1', + name: 'Todo 1', + }, + ], + }; + return withWarning(function () { + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + dataIdFromObject: getIdField, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + expect(newStore.get('1')).toEqual(result.todos[0]); + }, /Missing field description/); + }); + it('should warn when it receives the wrong data inside a fragment (using an introspection matcher)', function () { + var fragmentMatcherFunction = new __1.IntrospectionFragmentMatcher({ + introspectionQueryResultData: { + __schema: { + types: [ + { + kind: 'UNION', + name: 'Todo', + possibleTypes: [ + { name: 'ShoppingCartItem' }, + { name: 'TaskItem' }, + ], + }, + ], + }, + }, + }).match; + var queryWithInterface = graphql_tag_1.default(templateObject_40 || (templateObject_40 = tslib_1.__makeTemplateObject(["\n query {\n todos {\n id\n name\n description\n ...TodoFragment\n }\n }\n\n fragment TodoFragment on Todo {\n ... on ShoppingCartItem {\n price\n __typename\n }\n ... on TaskItem {\n date\n __typename\n }\n __typename\n }\n "], ["\n query {\n todos {\n id\n name\n description\n ...TodoFragment\n }\n }\n\n fragment TodoFragment on Todo {\n ... on ShoppingCartItem {\n price\n __typename\n }\n ... on TaskItem {\n date\n __typename\n }\n __typename\n }\n "]))); + var result = { + todos: [ + { + id: '1', + name: 'Todo 1', + description: 'Description 1', + __typename: 'ShoppingCartItem', + }, + ], + }; + return withWarning(function () { + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: queryWithInterface, + dataIdFromObject: getIdField, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + expect(newStore.get('1')).toEqual(result.todos[0]); + }, /Missing field price/); + }); + it('should warn if a result is missing __typename when required (using an heuristic matcher)', function () { + var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; + var result = { + todos: [ + { + id: '1', + name: 'Todo 1', + description: 'Description 1', + }, + ], + }; + return withWarning(function () { + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: apollo_utilities_1.addTypenameToDocument(query), + dataIdFromObject: getIdField, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + expect(newStore.get('1')).toEqual(result.todos[0]); + }, /Missing field __typename/); + }); + it('should not warn if a field is null', function () { + var result = { + todos: null, + }; + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + dataIdFromObject: getIdField, + }); + expect(newStore.get('ROOT_QUERY')).toEqual({ todos: null }); + }); + it('should not warn if a field is defered', function () { + var originalWarn = console.warn; + console.warn = jest.fn(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + }); + var defered = graphql_tag_1.default(templateObject_41 || (templateObject_41 = tslib_1.__makeTemplateObject(["\n query LazyLoad {\n id\n expensive @defer\n }\n "], ["\n query LazyLoad {\n id\n expensive @defer\n }\n "]))); + var result = { + id: 1, + }; + var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; + var newStore = writer.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: defered, + dataIdFromObject: getIdField, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + expect(newStore.get('ROOT_QUERY')).toEqual({ id: 1 }); + expect(console.warn).not.toBeCalled(); + console.warn = originalWarn; + }); + }); + it('throws when trying to write an object without id that was previously queried with id', function () { + var store = objectCache_1.defaultNormalizedCacheFactory({ + ROOT_QUERY: lodash_1.assign({}, { + __typename: 'Query', + item: { + type: 'id', + id: 'abcd', + generated: false, + }, + }), + abcd: lodash_1.assign({}, { + id: 'abcd', + __typename: 'Item', + stringField: 'This is a string!', + }), + }); + expect(function () { + writer.writeQueryToStore({ + store: store, + result: { + item: { + __typename: 'Item', + stringField: 'This is still a string!', + }, + }, + query: graphql_tag_1.default(templateObject_42 || (templateObject_42 = tslib_1.__makeTemplateObject(["\n query Failure {\n item {\n stringField\n }\n }\n "], ["\n query Failure {\n item {\n stringField\n }\n }\n "]))), + dataIdFromObject: getIdField, + }); + }).toThrowErrorMatchingSnapshot(); + expect(function () { + writer.writeResultToStore({ + store: store, + result: { + item: { + __typename: 'Item', + stringField: 'This is still a string!', + }, + }, + dataId: 'ROOT_QUERY', + document: graphql_tag_1.default(templateObject_43 || (templateObject_43 = tslib_1.__makeTemplateObject(["\n query {\n item {\n stringField\n }\n }\n "], ["\n query {\n item {\n stringField\n }\n }\n "]))), + dataIdFromObject: getIdField, + }); + }).toThrowError(/stringField(.|\n)*abcd/g); + }); + it('properly handles the connection directive', function () { + var store = objectCache_1.defaultNormalizedCacheFactory(); + writer.writeQueryToStore({ + query: graphql_tag_1.default(templateObject_44 || (templateObject_44 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "]))), + result: { + books: [ + { + name: 'abcd', + }, + ], + }, + store: store, + }); + writer.writeQueryToStore({ + query: graphql_tag_1.default(templateObject_45 || (templateObject_45 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 2, limit: 4) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 2, limit: 4) @connection(key: \"abc\") {\n name\n }\n }\n "]))), + result: { + books: [ + { + name: 'efgh', + }, + ], + }, + store: store, + }); + expect(store.toObject()).toEqual({ + ROOT_QUERY: { + abc: [ + { + generated: true, + id: 'ROOT_QUERY.abc.0', + type: 'id', + }, + ], + }, + 'ROOT_QUERY.abc.0': { + name: 'efgh', + }, + }); + }); + it('should keep reference when type of mixed inlined field changes', function () { + var store = objectCache_1.defaultNormalizedCacheFactory(); + var query = graphql_tag_1.default(templateObject_46 || (templateObject_46 = tslib_1.__makeTemplateObject(["\n query {\n animals {\n species {\n name\n }\n }\n }\n "], ["\n query {\n animals {\n species {\n name\n }\n }\n }\n "]))); + writer.writeQueryToStore({ + query: query, + result: { + animals: [ + { + __typename: 'Animal', + species: { + __typename: 'Cat', + name: 'cat', + }, + }, + ], + }, + store: store, + }); + expect(store.toObject()).toEqual({ + '$ROOT_QUERY.animals.0.species': { name: 'cat' }, + ROOT_QUERY: { + animals: [ + { + generated: true, + id: 'ROOT_QUERY.animals.0', + type: 'id', + typename: 'Animal', + }, + ], + }, + 'ROOT_QUERY.animals.0': { + species: { + generated: true, + id: '$ROOT_QUERY.animals.0.species', + type: 'id', + typename: 'Cat', + }, + }, + }); + writer.writeQueryToStore({ + query: query, + result: { + animals: [ + { + __typename: 'Animal', + species: { + __typename: 'Dog', + name: 'dog', + }, + }, + ], + }, + store: store, + }); + expect(store.toObject()).toEqual({ + '$ROOT_QUERY.animals.0.species': { name: 'dog' }, + ROOT_QUERY: { + animals: [ + { + generated: true, + id: 'ROOT_QUERY.animals.0', + type: 'id', + typename: 'Animal', + }, + ], + }, + 'ROOT_QUERY.animals.0': { + species: { + generated: true, + id: '$ROOT_QUERY.animals.0.species', + type: 'id', + typename: 'Dog', + }, + }, + }); + }); + it('should not keep reference when type of mixed inlined field changes to non-inlined field', function () { + var store = objectCache_1.defaultNormalizedCacheFactory(); + var dataIdFromObject = function (object) { + if (object.__typename && object.id) { + return object.__typename + '__' + object.id; + } + return undefined; + }; + var query = graphql_tag_1.default(templateObject_47 || (templateObject_47 = tslib_1.__makeTemplateObject(["\n query {\n animals {\n species {\n id\n name\n }\n }\n }\n "], ["\n query {\n animals {\n species {\n id\n name\n }\n }\n }\n "]))); + writer.writeQueryToStore({ + query: query, + result: { + animals: [ + { + __typename: 'Animal', + species: { + __typename: 'Cat', + name: 'cat', + }, + }, + ], + }, + dataIdFromObject: dataIdFromObject, + store: store, + }); + expect(store.toObject()).toEqual({ + '$ROOT_QUERY.animals.0.species': { name: 'cat' }, + ROOT_QUERY: { + animals: [ + { + generated: true, + id: 'ROOT_QUERY.animals.0', + type: 'id', + typename: 'Animal', + }, + ], + }, + 'ROOT_QUERY.animals.0': { + species: { + generated: true, + id: '$ROOT_QUERY.animals.0.species', + type: 'id', + typename: 'Cat', + }, + }, + }); + writer.writeQueryToStore({ + query: query, + result: { + animals: [ + { + __typename: 'Animal', + species: { + id: 'dog-species', + __typename: 'Dog', + name: 'dog', + }, + }, + ], + }, + dataIdFromObject: dataIdFromObject, + store: store, + }); + expect(store.toObject()).toEqual({ + '$ROOT_QUERY.animals.0.species': undefined, + 'Dog__dog-species': { + id: 'dog-species', + name: 'dog', + }, + ROOT_QUERY: { + animals: [ + { + generated: true, + id: 'ROOT_QUERY.animals.0', + type: 'id', + typename: 'Animal', + }, + ], + }, + 'ROOT_QUERY.animals.0': { + species: { + generated: false, + id: 'Dog__dog-species', + type: 'id', + typename: 'Dog', + }, + }, + }); + }); +}); +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47; +//# sourceMappingURL=writeToStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map new file mode 100644 index 000000000..2231f01fd --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"writeToStore.js","sourceRoot":"","sources":["../../src/__tests__/writeToStore.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AAUjD,oEAA8B;AAC9B,qDAI0B;AAE1B,gDAA8C;AAE9C,8CAA+D;AAE/D,yBAIa;AAEb,SAAgB,WAAW,CAAC,IAAc,EAAE,KAAa;IACvD,IAAI,OAAO,GAAW,IAAa,CAAC;IACpC,IAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7B,OAAO,CAAC,IAAI,GAAG,UAAC,CAAS,IAAK,OAAA,CAAC,OAAO,GAAG,CAAC,CAAC,EAAb,CAAa,CAAC;IAE5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;QACrC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,kCAWC;AAED,IAAM,UAAU,GAAG,UAAC,EAAsB;QAApB,UAAE;IAAuB,OAAA,EAAE;AAAF,CAAE,CAAC;AAElD,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,IAAM,MAAM,GAAG,IAAI,0BAAW,EAAE,CAAC;IAEjC,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,KAAK,GAAG,qBAAG,8KAAA,mGAOhB,IAAA,CAAC;QAEF,IAAM,MAAM,GAAQ;YAClB,EAAE,EAAE,MAAM;YACV,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,IAAI;SAChB,CAAC;QAEF,MAAM,CACJ,MAAM;aACH,iBAAiB,CAAC;YACjB,KAAK,OAAA;YACL,MAAM,EAAE,kBAAS,CAAC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S,EAAE,IAAI;wBACf,EAAE,EAAE,sBAAsB;wBAC1B,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,QAAQ;qBACnB;iBACF;aACF;YACD,sBAAsB,EAAE;gBACtB,OAAO,EAAE;oBACP,SAAS,EAAE,KAAK;oBAChB,EAAE,EAAE,kBAAkB;oBACtB,IAAI,EAAE,IAAI;oBACV,QAAQ,EAAE,KAAK;iBAChB;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js new file mode 100644 index 000000000..55535e1d7 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js @@ -0,0 +1,1332 @@ +exports.__esModule = true; +exports.assertIdValue = assertIdValue; +exports.defaultDataIdFromObject = defaultDataIdFromObject; +exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory$1; +exports.enhanceErrorWithDocument = enhanceErrorWithDocument; +exports.WriteError = exports.StoreWriter = exports.StoreReader = exports.ObjectCache = exports.IntrospectionFragmentMatcher = exports.InMemoryCache = exports.HeuristicFragmentMatcher = void 0; + +var _tslib = require("tslib"); + +var _apolloCache = require("apollo-cache"); + +var _apolloUtilities = require("apollo-utilities"); + +var _optimism = require("optimism"); + +var _tsInvariant = require("ts-invariant"); + +var testMap = new Map(); + +if (testMap.set(1, 2) !== testMap) { + var set_1 = testMap.set; + + Map.prototype.set = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + set_1.apply(this, args); + return this; + }; +} + +var testSet = new Set(); + +if (testSet.add(3) !== testSet) { + var add_1 = testSet.add; + + Set.prototype.add = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + add_1.apply(this, args); + return this; + }; +} + +var frozen = {}; + +if (typeof Object.freeze === 'function') { + Object.freeze(frozen); +} + +try { + testMap.set(frozen, frozen).delete(frozen); +} catch (_a) { + var wrap = function (method) { + return method && function (obj) { + try { + testMap.set(obj, obj).delete(obj); + } finally { + return method.call(Object, obj); + } + }; + }; + + Object.freeze = wrap(Object.freeze); + Object.seal = wrap(Object.seal); + Object.preventExtensions = wrap(Object.preventExtensions); +} + +var haveWarned = false; + +function shouldWarn() { + var answer = !haveWarned; + + if (!(0, _apolloUtilities.isTest)()) { + haveWarned = true; + } + + return answer; +} + +var HeuristicFragmentMatcher = function () { + function HeuristicFragmentMatcher() {} + + HeuristicFragmentMatcher.prototype.ensureReady = function () { + return Promise.resolve(); + }; + + HeuristicFragmentMatcher.prototype.canBypassInit = function () { + return true; + }; + + HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + + if (!obj) { + return isRootQuery; + } + + var _a = obj.__typename, + __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + + if (!__typename) { + if (shouldWarn()) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); + } + + return 'heuristic'; + } + + if (__typename === typeCondition) { + return true; + } + + if (shouldWarn()) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + 'queries contain union or interface types. Apollo Client will not be ' + 'able to accurately map fragments. To make this error go away, use ' + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); + } + + return 'heuristic'; + }; + + return HeuristicFragmentMatcher; +}(); + +exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; + +var IntrospectionFragmentMatcher = function () { + function IntrospectionFragmentMatcher(options) { + if (options && options.introspectionQueryResultData) { + this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); + this.isReady = true; + } else { + this.isReady = false; + } + + this.match = this.match.bind(this); + } + + IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(this.isReady, 10) : (0, _tsInvariant.invariant)(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + + if (!obj) { + return isRootQuery; + } + + var _a = obj.__typename, + __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(__typename, 11) : (0, _tsInvariant.invariant)(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); + + if (__typename === typeCondition) { + return true; + } + + var implementingTypes = this.possibleTypesMap[typeCondition]; + + if (implementingTypes && implementingTypes.indexOf(__typename) > -1) { + return true; + } + + return false; + }; + + IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { + var typeMap = {}; + + introspectionResultData.__schema.types.forEach(function (type) { + if (type.kind === 'UNION' || type.kind === 'INTERFACE') { + typeMap[type.name] = type.possibleTypes.map(function (implementingType) { + return implementingType.name; + }); + } + }); + + return typeMap; + }; + + return IntrospectionFragmentMatcher; +}(); + +exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; +var hasOwn = Object.prototype.hasOwnProperty; + +var DepTrackingCache = function () { + function DepTrackingCache(data) { + var _this = this; + + if (data === void 0) { + data = Object.create(null); + } + + this.data = data; + this.depend = (0, _optimism.wrap)(function (dataId) { + return _this.data[dataId]; + }, { + disposable: true, + makeCacheKey: function (dataId) { + return dataId; + } + }); + } + + DepTrackingCache.prototype.toObject = function () { + return this.data; + }; + + DepTrackingCache.prototype.get = function (dataId) { + this.depend(dataId); + return this.data[dataId]; + }; + + DepTrackingCache.prototype.set = function (dataId, value) { + var oldValue = this.data[dataId]; + + if (value !== oldValue) { + this.data[dataId] = value; + this.depend.dirty(dataId); + } + }; + + DepTrackingCache.prototype.delete = function (dataId) { + if (hasOwn.call(this.data, dataId)) { + delete this.data[dataId]; + this.depend.dirty(dataId); + } + }; + + DepTrackingCache.prototype.clear = function () { + this.replace(null); + }; + + DepTrackingCache.prototype.replace = function (newData) { + var _this = this; + + if (newData) { + Object.keys(newData).forEach(function (dataId) { + _this.set(dataId, newData[dataId]); + }); + Object.keys(this.data).forEach(function (dataId) { + if (!hasOwn.call(newData, dataId)) { + _this.delete(dataId); + } + }); + } else { + Object.keys(this.data).forEach(function (dataId) { + _this.delete(dataId); + }); + } + }; + + return DepTrackingCache; +}(); + +function defaultNormalizedCacheFactory(seed) { + return new DepTrackingCache(seed); +} + +var StoreReader = function () { + function StoreReader(_a) { + var _this = this; + + var _b = _a === void 0 ? {} : _a, + _c = _b.cacheKeyRoot, + cacheKeyRoot = _c === void 0 ? new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap) : _c, + _d = _b.freezeResults, + freezeResults = _d === void 0 ? false : _d; + + var _e = this, + executeStoreQuery = _e.executeStoreQuery, + executeSelectionSet = _e.executeSelectionSet, + executeSubSelectedArray = _e.executeSubSelectedArray; + + this.freezeResults = freezeResults; + this.executeStoreQuery = (0, _optimism.wrap)(function (options) { + return executeStoreQuery.call(_this, options); + }, { + makeCacheKey: function (_a) { + var query = _a.query, + rootValue = _a.rootValue, + contextValue = _a.contextValue, + variableValues = _a.variableValues, + fragmentMatcher = _a.fragmentMatcher; + + if (contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); + } + } + }); + this.executeSelectionSet = (0, _optimism.wrap)(function (options) { + return executeSelectionSet.call(_this, options); + }, { + makeCacheKey: function (_a) { + var selectionSet = _a.selectionSet, + rootValue = _a.rootValue, + execContext = _a.execContext; + + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); + } + } + }); + this.executeSubSelectedArray = (0, _optimism.wrap)(function (options) { + return executeSubSelectedArray.call(_this, options); + }, { + makeCacheKey: function (_a) { + var field = _a.field, + array = _a.array, + execContext = _a.execContext; + + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); + } + } + }); + } + + StoreReader.prototype.readQueryFromStore = function (options) { + var optsPatch = { + returnPartialData: false + }; + return this.diffQueryAgainstStore((0, _tslib.__assign)({}, options, optsPatch)).result; + }; + + StoreReader.prototype.diffQueryAgainstStore = function (_a) { + var store = _a.store, + query = _a.query, + variables = _a.variables, + previousResult = _a.previousResult, + _b = _a.returnPartialData, + returnPartialData = _b === void 0 ? true : _b, + _c = _a.rootId, + rootId = _c === void 0 ? 'ROOT_QUERY' : _c, + fragmentMatcherFunction = _a.fragmentMatcherFunction, + config = _a.config; + var queryDefinition = (0, _apolloUtilities.getQueryDefinition)(query); + variables = (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(queryDefinition), variables); + var context = { + store: store, + dataIdFromObject: config && config.dataIdFromObject || null, + cacheRedirects: config && config.cacheRedirects || {} + }; + var execResult = this.executeStoreQuery({ + query: query, + rootValue: { + type: 'id', + id: rootId, + generated: true, + typename: 'Query' + }, + contextValue: context, + variableValues: variables, + fragmentMatcher: fragmentMatcherFunction + }); + var hasMissingFields = execResult.missing && execResult.missing.length > 0; + + if (hasMissingFields && !returnPartialData) { + execResult.missing.forEach(function (info) { + if (info.tolerable) return; + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(2) : new _tsInvariant.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); + }); + } + + if (previousResult) { + if ((0, _apolloUtilities.isEqual)(previousResult, execResult.result)) { + execResult.result = previousResult; + } + } + + return { + result: execResult.result, + complete: !hasMissingFields + }; + }; + + StoreReader.prototype.executeStoreQuery = function (_a) { + var query = _a.query, + rootValue = _a.rootValue, + contextValue = _a.contextValue, + variableValues = _a.variableValues, + _b = _a.fragmentMatcher, + fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; + var mainDefinition = (0, _apolloUtilities.getMainDefinition)(query); + var fragments = (0, _apolloUtilities.getFragmentDefinitions)(query); + var fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); + var execContext = { + query: query, + fragmentMap: fragmentMap, + contextValue: contextValue, + variableValues: variableValues, + fragmentMatcher: fragmentMatcher + }; + return this.executeSelectionSet({ + selectionSet: mainDefinition.selectionSet, + rootValue: rootValue, + execContext: execContext + }); + }; + + StoreReader.prototype.executeSelectionSet = function (_a) { + var _this = this; + + var selectionSet = _a.selectionSet, + rootValue = _a.rootValue, + execContext = _a.execContext; + var fragmentMap = execContext.fragmentMap, + contextValue = execContext.contextValue, + variables = execContext.variableValues; + var finalResult = { + result: null + }; + var objectsToMerge = []; + var object = contextValue.store.get(rootValue.id); + var typename = object && object.__typename || rootValue.id === 'ROOT_QUERY' && 'Query' || void 0; + + function handleMissing(result) { + var _a; + + if (result.missing) { + finalResult.missing = finalResult.missing || []; + + (_a = finalResult.missing).push.apply(_a, result.missing); + } + + return result.result; + } + + selectionSet.selections.forEach(function (selection) { + var _a; + + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return; + } + + if ((0, _apolloUtilities.isField)(selection)) { + var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); + + if (typeof fieldResult !== 'undefined') { + objectsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); + } + } else { + var fragment = void 0; + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = fragmentMap[selection.name.value]; + + if (!fragment) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); + } + } + + var typeCondition = fragment.typeCondition.name.value; + var match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue); + + if (match) { + var fragmentExecResult = _this.executeSelectionSet({ + selectionSet: fragment.selectionSet, + rootValue: rootValue, + execContext: execContext + }); + + if (match === 'heuristic' && fragmentExecResult.missing) { + fragmentExecResult = (0, _tslib.__assign)({}, fragmentExecResult, { + missing: fragmentExecResult.missing.map(function (info) { + return (0, _tslib.__assign)({}, info, { + tolerable: true + }); + }) + }); + } + + objectsToMerge.push(handleMissing(fragmentExecResult)); + } + } + }); + finalResult.result = (0, _apolloUtilities.mergeDeepArray)(objectsToMerge); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(finalResult.result); + } + + return finalResult; + }; + + StoreReader.prototype.executeField = function (object, typename, field, execContext) { + var variables = execContext.variableValues, + contextValue = execContext.contextValue; + var fieldName = field.name.value; + var args = (0, _apolloUtilities.argumentsObjectFromField)(field, variables); + var info = { + resultKey: (0, _apolloUtilities.resultKeyNameFromField)(field), + directives: (0, _apolloUtilities.getDirectiveInfoFromField)(field, variables) + }; + var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); + + if (Array.isArray(readStoreResult.result)) { + return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ + field: field, + array: readStoreResult.result, + execContext: execContext + })); + } + + if (!field.selectionSet) { + assertSelectionSetForIdValue(field, readStoreResult.result); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + (0, _apolloUtilities.maybeDeepFreeze)(readStoreResult); + } + + return readStoreResult; + } + + if (readStoreResult.result == null) { + return readStoreResult; + } + + return this.combineExecResults(readStoreResult, this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: readStoreResult.result, + execContext: execContext + })); + }; + + StoreReader.prototype.combineExecResults = function () { + var execResults = []; + + for (var _i = 0; _i < arguments.length; _i++) { + execResults[_i] = arguments[_i]; + } + + var missing = null; + execResults.forEach(function (execResult) { + if (execResult.missing) { + missing = missing || []; + missing.push.apply(missing, execResult.missing); + } + }); + return { + result: execResults.pop().result, + missing: missing + }; + }; + + StoreReader.prototype.executeSubSelectedArray = function (_a) { + var _this = this; + + var field = _a.field, + array = _a.array, + execContext = _a.execContext; + var missing = null; + + function handleMissing(childResult) { + if (childResult.missing) { + missing = missing || []; + missing.push.apply(missing, childResult.missing); + } + + return childResult.result; + } + + array = array.map(function (item) { + if (item === null) { + return null; + } + + if (Array.isArray(item)) { + return handleMissing(_this.executeSubSelectedArray({ + field: field, + array: item, + execContext: execContext + })); + } + + if (field.selectionSet) { + return handleMissing(_this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: item, + execContext: execContext + })); + } + + assertSelectionSetForIdValue(field, item); + return item; + }); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(array); + } + + return { + result: array, + missing: missing + }; + }; + + return StoreReader; +}(); + +exports.StoreReader = StoreReader; + +function assertSelectionSetForIdValue(field, value) { + if (!field.selectionSet && (0, _apolloUtilities.isIdValue)(value)) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(4) : new _tsInvariant.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); + } +} + +function defaultFragmentMatcher() { + return true; +} + +function assertIdValue(idValue) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), 5) : (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); +} + +function readStoreResolver(object, typename, fieldName, args, context, _a) { + var resultKey = _a.resultKey, + directives = _a.directives; + var storeKeyName = fieldName; + + if (args || directives) { + storeKeyName = (0, _apolloUtilities.getStoreKeyName)(storeKeyName, args, directives); + } + + var fieldValue = void 0; + + if (object) { + fieldValue = object[storeKeyName]; + + if (typeof fieldValue === 'undefined' && context.cacheRedirects && typeof typename === 'string') { + var type = context.cacheRedirects[typename]; + + if (type) { + var resolver = type[fieldName]; + + if (resolver) { + fieldValue = resolver(object, args, { + getCacheKey: function (storeObj) { + return (0, _apolloUtilities.toIdValue)({ + id: context.dataIdFromObject(storeObj), + typename: storeObj.__typename + }); + } + }); + } + } + } + } + + if (typeof fieldValue === 'undefined') { + return { + result: fieldValue, + missing: [{ + object: object, + fieldName: storeKeyName, + tolerable: false + }] + }; + } + + if ((0, _apolloUtilities.isJsonValue)(fieldValue)) { + fieldValue = fieldValue.json; + } + + return { + result: fieldValue + }; +} + +var ObjectCache = function () { + function ObjectCache(data) { + if (data === void 0) { + data = Object.create(null); + } + + this.data = data; + } + + ObjectCache.prototype.toObject = function () { + return this.data; + }; + + ObjectCache.prototype.get = function (dataId) { + return this.data[dataId]; + }; + + ObjectCache.prototype.set = function (dataId, value) { + this.data[dataId] = value; + }; + + ObjectCache.prototype.delete = function (dataId) { + this.data[dataId] = void 0; + }; + + ObjectCache.prototype.clear = function () { + this.data = Object.create(null); + }; + + ObjectCache.prototype.replace = function (newData) { + this.data = newData || Object.create(null); + }; + + return ObjectCache; +}(); + +exports.ObjectCache = ObjectCache; + +function defaultNormalizedCacheFactory$1(seed) { + return new ObjectCache(seed); +} + +var WriteError = function (_super) { + (0, _tslib.__extends)(WriteError, _super); + + function WriteError() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = 'WriteError'; + return _this; + } + + return WriteError; +}(Error); + +exports.WriteError = WriteError; + +function enhanceErrorWithDocument(error, document) { + var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); + enhancedError.message += '\n' + error.message; + enhancedError.stack = error.stack; + return enhancedError; +} + +var StoreWriter = function () { + function StoreWriter() {} + + StoreWriter.prototype.writeQueryToStore = function (_a) { + var query = _a.query, + result = _a.result, + _b = _a.store, + store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, + variables = _a.variables, + dataIdFromObject = _a.dataIdFromObject, + fragmentMatcherFunction = _a.fragmentMatcherFunction; + return this.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + store: store, + variables: variables, + dataIdFromObject: dataIdFromObject, + fragmentMatcherFunction: fragmentMatcherFunction + }); + }; + + StoreWriter.prototype.writeResultToStore = function (_a) { + var dataId = _a.dataId, + result = _a.result, + document = _a.document, + _b = _a.store, + store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, + variables = _a.variables, + dataIdFromObject = _a.dataIdFromObject, + fragmentMatcherFunction = _a.fragmentMatcherFunction; + var operationDefinition = (0, _apolloUtilities.getOperationDefinition)(document); + + try { + return this.writeSelectionSetToStore({ + result: result, + dataId: dataId, + selectionSet: operationDefinition.selectionSet, + context: { + store: store, + processedData: {}, + variables: (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(operationDefinition), variables), + dataIdFromObject: dataIdFromObject, + fragmentMap: (0, _apolloUtilities.createFragmentMap)((0, _apolloUtilities.getFragmentDefinitions)(document)), + fragmentMatcherFunction: fragmentMatcherFunction + } + }); + } catch (e) { + throw enhanceErrorWithDocument(e, document); + } + }; + + StoreWriter.prototype.writeSelectionSetToStore = function (_a) { + var _this = this; + + var result = _a.result, + dataId = _a.dataId, + selectionSet = _a.selectionSet, + context = _a.context; + var variables = context.variables, + store = context.store, + fragmentMap = context.fragmentMap; + selectionSet.selections.forEach(function (selection) { + var _a; + + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return; + } + + if ((0, _apolloUtilities.isField)(selection)) { + var resultFieldKey = (0, _apolloUtilities.resultKeyNameFromField)(selection); + var value = result[resultFieldKey]; + + if (typeof value !== 'undefined') { + _this.writeFieldToStore({ + dataId: dataId, + value: value, + field: selection, + context: context + }); + } else { + var isDefered = false; + var isClient = false; + + if (selection.directives && selection.directives.length) { + isDefered = selection.directives.some(function (directive) { + return directive.name && directive.name.value === 'defer'; + }); + isClient = selection.directives.some(function (directive) { + return directive.name && directive.name.value === 'client'; + }); + } + + if (!isDefered && !isClient && context.fragmentMatcherFunction) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); + } + } + } else { + var fragment = void 0; + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = (fragmentMap || {})[selection.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 6) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value + "."); + } + + var matches = true; + + if (context.fragmentMatcherFunction && fragment.typeCondition) { + var id = dataId || 'self'; + var idValue = (0, _apolloUtilities.toIdValue)({ + id: id, + typename: undefined + }); + var fakeContext = { + store: new ObjectCache((_a = {}, _a[id] = result, _a)), + cacheRedirects: {} + }; + var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); + + if (!(0, _apolloUtilities.isProduction)() && match === 'heuristic') { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('WARNING: heuristic fragment matching going on!'); + } + + matches = !!match; + } + + if (matches) { + _this.writeSelectionSetToStore({ + result: result, + selectionSet: fragment.selectionSet, + dataId: dataId, + context: context + }); + } + } + }); + return store; + }; + + StoreWriter.prototype.writeFieldToStore = function (_a) { + var _b; + + var field = _a.field, + value = _a.value, + dataId = _a.dataId, + context = _a.context; + var variables = context.variables, + dataIdFromObject = context.dataIdFromObject, + store = context.store; + var storeValue; + var storeObject; + var storeFieldName = (0, _apolloUtilities.storeKeyNameFromField)(field, variables); + + if (!field.selectionSet || value === null) { + storeValue = value != null && typeof value === 'object' ? { + type: 'json', + json: value + } : value; + } else if (Array.isArray(value)) { + var generatedId = dataId + "." + storeFieldName; + storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); + } else { + var valueDataId = dataId + "." + storeFieldName; + var generated = true; + + if (!isGeneratedId(valueDataId)) { + valueDataId = '$' + valueDataId; + } + + if (dataIdFromObject) { + var semanticId = dataIdFromObject(value); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 7) : (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); + + if (semanticId || typeof semanticId === 'number' && semanticId === 0) { + valueDataId = semanticId; + generated = false; + } + } + + if (!isDataProcessed(valueDataId, field, context.processedData)) { + this.writeSelectionSetToStore({ + dataId: valueDataId, + result: value, + selectionSet: field.selectionSet, + context: context + }); + } + + var typename = value.__typename; + storeValue = (0, _apolloUtilities.toIdValue)({ + id: valueDataId, + typename: typename + }, generated); + storeObject = store.get(dataId); + var escapedId = storeObject && storeObject[storeFieldName]; + + if (escapedId !== storeValue && (0, _apolloUtilities.isIdValue)(escapedId)) { + var hadTypename = escapedId.typename !== undefined; + var hasTypename = typename !== undefined; + var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, 8) : (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!hadTypename || hasTypename, 9) : (0, _tsInvariant.invariant)(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + + if (escapedId.generated) { + if (typenameChanged) { + if (!generated) { + store.delete(escapedId.id); + } + } else { + mergeWithGenerated(escapedId.id, storeValue.id, store); + } + } + } + } + + storeObject = store.get(dataId); + + if (!storeObject || !(0, _apolloUtilities.isEqual)(storeValue, storeObject[storeFieldName])) { + store.set(dataId, (0, _tslib.__assign)({}, storeObject, (_b = {}, _b[storeFieldName] = storeValue, _b))); + } + }; + + StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { + var _this = this; + + return value.map(function (item, index) { + if (item === null) { + return null; + } + + var itemDataId = generatedId + "." + index; + + if (Array.isArray(item)) { + return _this.processArrayValue(item, itemDataId, selectionSet, context); + } + + var generated = true; + + if (context.dataIdFromObject) { + var semanticId = context.dataIdFromObject(item); + + if (semanticId) { + itemDataId = semanticId; + generated = false; + } + } + + if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { + _this.writeSelectionSetToStore({ + dataId: itemDataId, + result: item, + selectionSet: selectionSet, + context: context + }); + } + + return (0, _apolloUtilities.toIdValue)({ + id: itemDataId, + typename: item.__typename + }, generated); + }); + }; + + return StoreWriter; +}(); + +exports.StoreWriter = StoreWriter; + +function isGeneratedId(id) { + return id[0] === '$'; +} + +function mergeWithGenerated(generatedKey, realKey, cache) { + if (generatedKey === realKey) { + return false; + } + + var generated = cache.get(generatedKey); + var real = cache.get(realKey); + var madeChanges = false; + Object.keys(generated).forEach(function (key) { + var value = generated[key]; + var realValue = real[key]; + + if ((0, _apolloUtilities.isIdValue)(value) && isGeneratedId(value.id) && (0, _apolloUtilities.isIdValue)(realValue) && !(0, _apolloUtilities.isEqual)(value, realValue) && mergeWithGenerated(value.id, realValue.id, cache)) { + madeChanges = true; + } + }); + cache.delete(generatedKey); + var newRealValue = (0, _tslib.__assign)({}, generated, real); + + if ((0, _apolloUtilities.isEqual)(newRealValue, real)) { + return madeChanges; + } + + cache.set(realKey, newRealValue); + return true; +} + +function isDataProcessed(dataId, field, processedData) { + if (!processedData) { + return false; + } + + if (processedData[dataId]) { + if (processedData[dataId].indexOf(field) >= 0) { + return true; + } else { + processedData[dataId].push(field); + } + } else { + processedData[dataId] = [field]; + } + + return false; +} + +var defaultConfig = { + fragmentMatcher: new HeuristicFragmentMatcher(), + dataIdFromObject: defaultDataIdFromObject, + addTypename: true, + resultCaching: true, + freezeResults: false +}; + +function defaultDataIdFromObject(result) { + if (result.__typename) { + if (result.id !== undefined) { + return result.__typename + ":" + result.id; + } + + if (result._id !== undefined) { + return result.__typename + ":" + result._id; + } + } + + return null; +} + +var hasOwn$1 = Object.prototype.hasOwnProperty; + +var OptimisticCacheLayer = function (_super) { + (0, _tslib.__extends)(OptimisticCacheLayer, _super); + + function OptimisticCacheLayer(optimisticId, parent, transaction) { + var _this = _super.call(this, Object.create(null)) || this; + + _this.optimisticId = optimisticId; + _this.parent = parent; + _this.transaction = transaction; + return _this; + } + + OptimisticCacheLayer.prototype.toObject = function () { + return (0, _tslib.__assign)({}, this.parent.toObject(), this.data); + }; + + OptimisticCacheLayer.prototype.get = function (dataId) { + return hasOwn$1.call(this.data, dataId) ? this.data[dataId] : this.parent.get(dataId); + }; + + return OptimisticCacheLayer; +}(ObjectCache); + +var InMemoryCache = function (_super) { + (0, _tslib.__extends)(InMemoryCache, _super); + + function InMemoryCache(config) { + if (config === void 0) { + config = {}; + } + + var _this = _super.call(this) || this; + + _this.watches = new Set(); + _this.typenameDocumentCache = new Map(); + _this.cacheKeyRoot = new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap); + _this.silenceBroadcast = false; + _this.config = (0, _tslib.__assign)({}, defaultConfig, config); + + if (_this.config.customResolvers) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.customResolvers; + } + + if (_this.config.cacheResolvers) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.cacheResolvers; + } + + _this.addTypename = _this.config.addTypename; + _this.data = _this.config.resultCaching ? new DepTrackingCache() : new ObjectCache(); + _this.optimisticData = _this.data; + _this.storeWriter = new StoreWriter(); + _this.storeReader = new StoreReader({ + cacheKeyRoot: _this.cacheKeyRoot, + freezeResults: config.freezeResults + }); + var cache = _this; + var maybeBroadcastWatch = cache.maybeBroadcastWatch; + _this.maybeBroadcastWatch = (0, _optimism.wrap)(function (c) { + return maybeBroadcastWatch.call(_this, c); + }, { + makeCacheKey: function (c) { + if (c.optimistic) { + return; + } + + if (c.previousResult) { + return; + } + + if (cache.data instanceof DepTrackingCache) { + return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); + } + } + }); + return _this; + } + + InMemoryCache.prototype.restore = function (data) { + if (data) this.data.replace(data); + return this; + }; + + InMemoryCache.prototype.extract = function (optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return (optimistic ? this.optimisticData : this.data).toObject(); + }; + + InMemoryCache.prototype.read = function (options) { + if (typeof options.rootId === 'string' && typeof this.data.get(options.rootId) === 'undefined') { + return null; + } + + return this.storeReader.readQueryFromStore({ + store: options.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(options.query), + variables: options.variables, + rootId: options.rootId, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + previousResult: options.previousResult, + config: this.config + }); + }; + + InMemoryCache.prototype.write = function (write) { + this.storeWriter.writeResultToStore({ + dataId: write.dataId, + result: write.result, + variables: write.variables, + document: this.transformDocument(write.query), + store: this.data, + dataIdFromObject: this.config.dataIdFromObject, + fragmentMatcherFunction: this.config.fragmentMatcher.match + }); + this.broadcastWatches(); + }; + + InMemoryCache.prototype.diff = function (query) { + return this.storeReader.diffQueryAgainstStore({ + store: query.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(query.query), + variables: query.variables, + returnPartialData: query.returnPartialData, + previousResult: query.previousResult, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + config: this.config + }); + }; + + InMemoryCache.prototype.watch = function (watch) { + var _this = this; + + this.watches.add(watch); + return function () { + _this.watches.delete(watch); + }; + }; + + InMemoryCache.prototype.evict = function (query) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("eviction is not implemented on InMemory Cache"); + }; + + InMemoryCache.prototype.reset = function () { + this.data.clear(); + this.broadcastWatches(); + return Promise.resolve(); + }; + + InMemoryCache.prototype.removeOptimistic = function (idToRemove) { + var toReapply = []; + var removedCount = 0; + var layer = this.optimisticData; + + while (layer instanceof OptimisticCacheLayer) { + if (layer.optimisticId === idToRemove) { + ++removedCount; + } else { + toReapply.push(layer); + } + + layer = layer.parent; + } + + if (removedCount > 0) { + this.optimisticData = layer; + + while (toReapply.length > 0) { + var layer_1 = toReapply.pop(); + this.performTransaction(layer_1.transaction, layer_1.optimisticId); + } + + this.broadcastWatches(); + } + }; + + InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { + var _a = this, + data = _a.data, + silenceBroadcast = _a.silenceBroadcast; + + this.silenceBroadcast = true; + + if (typeof optimisticId === 'string') { + this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); + } + + try { + transaction(this); + } finally { + this.silenceBroadcast = silenceBroadcast; + this.data = data; + } + + this.broadcastWatches(); + }; + + InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { + return this.performTransaction(transaction, id); + }; + + InMemoryCache.prototype.transformDocument = function (document) { + if (this.addTypename) { + var result = this.typenameDocumentCache.get(document); + + if (!result) { + result = (0, _apolloUtilities.addTypenameToDocument)(document); + this.typenameDocumentCache.set(document, result); + this.typenameDocumentCache.set(result, result); + } + + return result; + } + + return document; + }; + + InMemoryCache.prototype.broadcastWatches = function () { + var _this = this; + + if (!this.silenceBroadcast) { + this.watches.forEach(function (c) { + return _this.maybeBroadcastWatch(c); + }); + } + }; + + InMemoryCache.prototype.maybeBroadcastWatch = function (c) { + c.callback(this.diff({ + query: c.query, + variables: c.variables, + previousResult: c.previousResult && c.previousResult(), + optimistic: c.optimistic + })); + }; + + return InMemoryCache; +}(_apolloCache.ApolloCache); + + +exports.InMemoryCache = InMemoryCache; diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map new file mode 100644 index 000000000..5217a78ab --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/fixPolyfills.ts","../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["wrap","defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,IAAM,OAAO,GAAG,IAAI,GAAJ,EAAhB;;AACA,IAAI,OAAO,CAAC,GAAR,CAAY,CAAZ,EAAe,CAAf,MAAsB,OAA1B,EAAmC;AACzB,MAAA,KAAA,GAAA,OAAA,CAAA,GAAA;;AACR,EAAA,GAAG,CAAC,SAAJ,CAAc,GAAd,GAAoB,YAAA;AAAU,QAAA,IAAA,GAAA,EAAA;;SAAA,IAAA,EAAA,GAAA,C,EAAA,EAAA,GAAA,SAAA,CAAA,M,EAAA,EAAA,E,EAAO;AAAP,MAAA,IAAA,CAAA,EAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA;;;AAC5B,IAAA,KAAG,CAAC,KAAJ,CAAU,IAAV,EAAgB,IAAhB;AACA,WAAO,IAAP;AACD,GAHD;AAID;;AAGD,IAAM,OAAO,GAAG,IAAI,GAAJ,EAAhB;;AACA,IAAI,OAAO,CAAC,GAAR,CAAY,CAAZ,MAAmB,OAAvB,EAAgC;AACtB,MAAA,KAAA,GAAA,OAAA,CAAA,GAAA;;AACR,EAAA,GAAG,CAAC,SAAJ,CAAc,GAAd,GAAoB,YAAA;AAAU,QAAA,IAAA,GAAA,EAAA;;SAAA,IAAA,EAAA,GAAA,C,EAAA,EAAA,GAAA,SAAA,CAAA,M,EAAA,EAAA,E,EAAO;AAAP,MAAA,IAAA,CAAA,EAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CA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AA,GAAV,YAAA;AAAA,QAAA,KAAA,GAAA,IAAA;;AACE,QAAI,CAAC,KAAK,gBAAV,EAA4B;AAC1B,WAAK,OAAL,CAAa,OAAb,CAAqB,UAAA,CAAA,EAAC;AAAI,eAAA,KAAI,CAAC,mBAAL,CAAyB,CAAzB,CAAA;AAA2B,OAArD;AACD;AACF,GAJS;;AAQF,EAAA,aAAA,CAAA,SAAA,CAAA,mBAAA,GAAR,UAA4B,CAA5B,EAAiD;AAC/C,IAAA,CAAC,CAAC,QAAF,CACE,KAAK,IAAL,CAAU;AACR,MAAA,KAAK,EAAE,CAAC,CAAC,KADD;AAER,MAAA,SAAS,EAAE,CAAC,CAAC,SAFL;AAGR,MAAA,cAAc,EAAE,CAAC,CAAC,cAAF,IAAoB,CAAC,CAAC,cAAF,EAH5B;AAIR,MAAA,UAAU,EAAE,CAAC,CAAC;AAJN,KAAV,CADF;AAQD,GATO;;AAUV,SAAA,aAAA;AAxQA,C,CAAmC,wB","sourcesContent":["// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n\nexport {}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n};\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js new file mode 100644 index 000000000..d7de12286 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js @@ -0,0 +1 @@ +exports.__esModule=!0,exports.assertIdValue=function(e){(0,i.invariant)((0,r.isIdValue)(e),5)},exports.defaultDataIdFromObject=j,exports.defaultNormalizedCacheFactory=function(e){return new x(e)},exports.enhanceErrorWithDocument=R,exports.WriteError=exports.StoreWriter=exports.StoreReader=exports.ObjectCache=exports.IntrospectionFragmentMatcher=exports.InMemoryCache=exports.HeuristicFragmentMatcher=void 0;var e=require("tslib"),t=require("apollo-cache"),r=require("apollo-utilities"),a=require("optimism"),i=require("ts-invariant"),n=new Map;if(n.set(1,2)!==n){var o=n.set;Map.prototype.set=function(){for(var e=[],t=0;t-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}();exports.IntrospectionFragmentMatcher=h;var y=Object.prototype.hasOwnProperty,m=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=(0,a.wrap)(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){y.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){y.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function v(e){return new m(e)}var g=function(){function t(e){var t=this,i=void 0===e?{}:e,n=i.cacheKeyRoot,o=void 0===n?new a.KeyTrie(r.canUseWeakMap):n,s=i.freezeResults,c=void 0!==s&&s,u=this.executeStoreQuery,l=this.executeSelectionSet,d=this.executeSubSelectedArray;this.freezeResults=c,this.executeStoreQuery=(0,a.wrap)(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,a=e.contextValue,i=e.variableValues,n=e.fragmentMatcher;if(a.store instanceof m)return o.lookup(a.store,t,n,JSON.stringify(i),r.id)}}),this.executeSelectionSet=(0,a.wrap)(function(e){return l.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,a=e.execContext;if(a.contextValue.store instanceof m)return o.lookup(a.contextValue.store,t,a.fragmentMatcher,JSON.stringify(a.variableValues),r.id)}}),this.executeSubSelectedArray=(0,a.wrap)(function(e){return d.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,a=e.execContext;if(a.contextValue.store instanceof m)return o.lookup(a.contextValue.store,t,r,JSON.stringify(a.variableValues))}})}return t.prototype.readQueryFromStore=function(t){return this.diffQueryAgainstStore((0,e.__assign)({},t,{returnPartialData:!1})).result},t.prototype.diffQueryAgainstStore=function(e){var t=e.store,a=e.query,n=e.variables,o=e.previousResult,s=e.returnPartialData,c=void 0===s||s,u=e.rootId,l=void 0===u?"ROOT_QUERY":u,d=e.fragmentMatcherFunction,p=e.config,f=(0,r.getQueryDefinition)(a);n=(0,r.assign)({},(0,r.getDefaultValues)(f),n);var h={store:t,dataIdFromObject:p&&p.dataIdFromObject||null,cacheRedirects:p&&p.cacheRedirects||{}},y=this.executeStoreQuery({query:a,rootValue:{type:"id",id:l,generated:!0,typename:"Query"},contextValue:h,variableValues:n,fragmentMatcher:d}),m=y.missing&&y.missing.length>0;return m&&!c&&y.missing.forEach(function(e){if(!e.tolerable)throw new i.InvariantError(2)}),o&&(0,r.isEqual)(o,y.result)&&(y.result=o),{result:y.result,complete:!m}},t.prototype.executeStoreQuery=function(e){var t=e.query,a=e.rootValue,i=e.contextValue,n=e.variableValues,o=e.fragmentMatcher,s=void 0===o?S:o,c=(0,r.getMainDefinition)(t),u=(0,r.getFragmentDefinitions)(t),l={query:t,fragmentMap:(0,r.createFragmentMap)(u),contextValue:i,variableValues:n,fragmentMatcher:s};return this.executeSelectionSet({selectionSet:c.selectionSet,rootValue:a,execContext:l})},t.prototype.executeSelectionSet=function(t){var a=this,n=t.selectionSet,o=t.rootValue,s=t.execContext,c=s.fragmentMap,u=s.contextValue,l=s.variableValues,d={result:null},p=[],f=u.store.get(o.id),h=f&&f.__typename||"ROOT_QUERY"===o.id&&"Query"||void 0;function y(e){var t;return e.missing&&(d.missing=d.missing||[],(t=d.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach(function(t){var n;if((0,r.shouldInclude)(t,l))if((0,r.isField)(t)){var d=y(a.executeField(f,h,t,s));void 0!==d&&p.push(((n={})[(0,r.resultKeyNameFromField)(t)]=d,n))}else{var m=void 0;if((0,r.isInlineFragment)(t))m=t;else if(!(m=c[t.name.value]))throw new i.InvariantError(3);var v=m.typeCondition.name.value,g=s.fragmentMatcher(o,v,u);if(g){var b=a.executeSelectionSet({selectionSet:m.selectionSet,rootValue:o,execContext:s});"heuristic"===g&&b.missing&&(b=(0,e.__assign)({},b,{missing:b.missing.map(function(t){return(0,e.__assign)({},t,{tolerable:!0})})})),p.push(y(b))}}}),d.result=(0,r.mergeDeepArray)(p),this.freezeResults,d},t.prototype.executeField=function(e,t,a,i){var n=i.variableValues,o=i.contextValue,s=function(e,t,a,i,n,o){o.resultKey;var s=o.directives,c=a;(i||s)&&(c=(0,r.getStoreKeyName)(c,i,s));var u=void 0;if(e&&void 0===(u=e[c])&&n.cacheRedirects&&"string"==typeof t){var l=n.cacheRedirects[t];if(l){var d=l[a];d&&(u=d(e,i,{getCacheKey:function(e){return(0,r.toIdValue)({id:n.dataIdFromObject(e),typename:e.__typename})}}))}}if(void 0===u)return{result:u,missing:[{object:e,fieldName:c,tolerable:!1}]};(0,r.isJsonValue)(u)&&(u=u.json);return{result:u}}(e,t,a.name.value,(0,r.argumentsObjectFromField)(a,n),o,{resultKey:(0,r.resultKeyNameFromField)(a),directives:(0,r.getDirectiveInfoFromField)(a,n)});return Array.isArray(s.result)?this.combineExecResults(s,this.executeSubSelectedArray({field:a,array:s.result,execContext:i})):a.selectionSet?null==s.result?s:this.combineExecResults(s,this.executeSelectionSet({selectionSet:a.selectionSet,rootValue:s.result,execContext:i})):(b(a,s.result),this.freezeResults,s)},t.prototype.combineExecResults=function(){for(var e=[],t=0;t=0)return!0;r[e].push(t)}else r[e]=[t];return!1}exports.StoreWriter=I;var _={fragmentMatcher:new f,dataIdFromObject:j,addTypename:!0,resultCaching:!0,freezeResults:!1};function j(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var V=Object.prototype.hasOwnProperty,M=function(t){function r(e,r,a){var i=t.call(this,Object.create(null))||this;return i.optimisticId=e,i.parent=r,i.transaction=a,i}return(0,e.__extends)(r,t),r.prototype.toObject=function(){return(0,e.__assign)({},this.parent.toObject(),this.data)},r.prototype.get=function(e){return V.call(this.data,e)?this.data[e]:this.parent.get(e)},r}(x),D=function(t){function n(i){void 0===i&&(i={});var n=t.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new a.KeyTrie(r.canUseWeakMap),n.silenceBroadcast=!1,n.config=(0,e.__assign)({},_,i),n.config.customResolvers&&(n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&(n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=n.config.addTypename,n.data=n.config.resultCaching?new m:new x,n.optimisticData=n.data,n.storeWriter=new I,n.storeReader=new g({cacheKeyRoot:n.cacheKeyRoot,freezeResults:i.freezeResults});var o=n,s=o.maybeBroadcastWatch;return n.maybeBroadcastWatch=(0,a.wrap)(function(e){return s.call(n,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return o.data instanceof m?o.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return(0,e.__extends)(n,t),n.prototype.restore=function(e){return e&&this.data.replace(e),this},n.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},n.prototype.read=function(e){return"string"==typeof e.rootId&&void 0===this.data.get(e.rootId)?null:this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:this.config.fragmentMatcher.match,previousResult:e.previousResult,config:this.config})},n.prototype.write=function(e){this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:this.config.fragmentMatcher.match}),this.broadcastWatches()},n.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:this.config.fragmentMatcher.match,config:this.config})},n.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},n.prototype.evict=function(e){throw new i.InvariantError(1)},n.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},n.prototype.removeOptimistic=function(e){for(var t=[],r=0,a=this.optimisticData;a instanceof M;)a.optimisticId===e?++r:t.push(a),a=a.parent;if(r>0){for(this.optimisticData=a;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},n.prototype.performTransaction=function(e,t){var r=this.data,a=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new M(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=a,this.data=r}this.broadcastWatches()},n.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},n.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=(0,r.addTypenameToDocument)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},n.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},n.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},n}(t.ApolloCache);exports.InMemoryCache=D; diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js new file mode 100644 index 000000000..fce1b8287 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js @@ -0,0 +1,1022 @@ +import { __assign, __extends } from 'tslib'; +import { ApolloCache } from 'apollo-cache'; +import { isTest, getQueryDefinition, assign, getDefaultValues, isEqual, getMainDefinition, getFragmentDefinitions, createFragmentMap, shouldInclude, isField, resultKeyNameFromField, isInlineFragment, mergeDeepArray, argumentsObjectFromField, getDirectiveInfoFromField, maybeDeepFreeze, isIdValue, getStoreKeyName, toIdValue, isJsonValue, canUseWeakMap, getOperationDefinition, isProduction, storeKeyNameFromField, addTypenameToDocument } from 'apollo-utilities'; +import { wrap as wrap$1, KeyTrie } from 'optimism'; +import { invariant, InvariantError } from 'ts-invariant'; + +var testMap = new Map(); +if (testMap.set(1, 2) !== testMap) { + var set_1 = testMap.set; + Map.prototype.set = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + set_1.apply(this, args); + return this; + }; +} +var testSet = new Set(); +if (testSet.add(3) !== testSet) { + var add_1 = testSet.add; + Set.prototype.add = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + add_1.apply(this, args); + return this; + }; +} +var frozen = {}; +if (typeof Object.freeze === 'function') { + Object.freeze(frozen); +} +try { + testMap.set(frozen, frozen).delete(frozen); +} +catch (_a) { + var wrap = function (method) { + return method && (function (obj) { + try { + testMap.set(obj, obj).delete(obj); + } + finally { + return method.call(Object, obj); + } + }); + }; + Object.freeze = wrap(Object.freeze); + Object.seal = wrap(Object.seal); + Object.preventExtensions = wrap(Object.preventExtensions); +} + +var haveWarned = false; +function shouldWarn() { + var answer = !haveWarned; + if (!isTest()) { + haveWarned = true; + } + return answer; +} +var HeuristicFragmentMatcher = (function () { + function HeuristicFragmentMatcher() { + } + HeuristicFragmentMatcher.prototype.ensureReady = function () { + return Promise.resolve(); + }; + HeuristicFragmentMatcher.prototype.canBypassInit = function () { + return true; + }; + HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + if (!obj) { + return isRootQuery; + } + var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + if (!__typename) { + if (shouldWarn()) { + process.env.NODE_ENV === "production" || invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); + process.env.NODE_ENV === "production" || invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); + process.env.NODE_ENV === "production" || invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); + } + return 'heuristic'; + } + if (__typename === typeCondition) { + return true; + } + if (shouldWarn()) { + process.env.NODE_ENV === "production" || invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + + 'queries contain union or interface types. Apollo Client will not be ' + + 'able to accurately map fragments. To make this error go away, use ' + + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); + } + return 'heuristic'; + }; + return HeuristicFragmentMatcher; +}()); +var IntrospectionFragmentMatcher = (function () { + function IntrospectionFragmentMatcher(options) { + if (options && options.introspectionQueryResultData) { + this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); + this.isReady = true; + } + else { + this.isReady = false; + } + this.match = this.match.bind(this); + } + IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + process.env.NODE_ENV === "production" ? invariant(this.isReady, 10) : invariant(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + if (!obj) { + return isRootQuery; + } + var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + process.env.NODE_ENV === "production" ? invariant(__typename, 11) : invariant(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); + if (__typename === typeCondition) { + return true; + } + var implementingTypes = this.possibleTypesMap[typeCondition]; + if (implementingTypes && implementingTypes.indexOf(__typename) > -1) { + return true; + } + return false; + }; + IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { + var typeMap = {}; + introspectionResultData.__schema.types.forEach(function (type) { + if (type.kind === 'UNION' || type.kind === 'INTERFACE') { + typeMap[type.name] = type.possibleTypes.map(function (implementingType) { return implementingType.name; }); + } + }); + return typeMap; + }; + return IntrospectionFragmentMatcher; +}()); + +var hasOwn = Object.prototype.hasOwnProperty; +var DepTrackingCache = (function () { + function DepTrackingCache(data) { + var _this = this; + if (data === void 0) { data = Object.create(null); } + this.data = data; + this.depend = wrap$1(function (dataId) { return _this.data[dataId]; }, { + disposable: true, + makeCacheKey: function (dataId) { + return dataId; + } + }); + } + DepTrackingCache.prototype.toObject = function () { + return this.data; + }; + DepTrackingCache.prototype.get = function (dataId) { + this.depend(dataId); + return this.data[dataId]; + }; + DepTrackingCache.prototype.set = function (dataId, value) { + var oldValue = this.data[dataId]; + if (value !== oldValue) { + this.data[dataId] = value; + this.depend.dirty(dataId); + } + }; + DepTrackingCache.prototype.delete = function (dataId) { + if (hasOwn.call(this.data, dataId)) { + delete this.data[dataId]; + this.depend.dirty(dataId); + } + }; + DepTrackingCache.prototype.clear = function () { + this.replace(null); + }; + DepTrackingCache.prototype.replace = function (newData) { + var _this = this; + if (newData) { + Object.keys(newData).forEach(function (dataId) { + _this.set(dataId, newData[dataId]); + }); + Object.keys(this.data).forEach(function (dataId) { + if (!hasOwn.call(newData, dataId)) { + _this.delete(dataId); + } + }); + } + else { + Object.keys(this.data).forEach(function (dataId) { + _this.delete(dataId); + }); + } + }; + return DepTrackingCache; +}()); +function defaultNormalizedCacheFactory(seed) { + return new DepTrackingCache(seed); +} + +var StoreReader = (function () { + function StoreReader(_a) { + var _this = this; + var _b = _a === void 0 ? {} : _a, _c = _b.cacheKeyRoot, cacheKeyRoot = _c === void 0 ? new KeyTrie(canUseWeakMap) : _c, _d = _b.freezeResults, freezeResults = _d === void 0 ? false : _d; + var _e = this, executeStoreQuery = _e.executeStoreQuery, executeSelectionSet = _e.executeSelectionSet, executeSubSelectedArray = _e.executeSubSelectedArray; + this.freezeResults = freezeResults; + this.executeStoreQuery = wrap$1(function (options) { + return executeStoreQuery.call(_this, options); + }, { + makeCacheKey: function (_a) { + var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, fragmentMatcher = _a.fragmentMatcher; + if (contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); + } + } + }); + this.executeSelectionSet = wrap$1(function (options) { + return executeSelectionSet.call(_this, options); + }, { + makeCacheKey: function (_a) { + var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); + } + } + }); + this.executeSubSelectedArray = wrap$1(function (options) { + return executeSubSelectedArray.call(_this, options); + }, { + makeCacheKey: function (_a) { + var field = _a.field, array = _a.array, execContext = _a.execContext; + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); + } + } + }); + } + StoreReader.prototype.readQueryFromStore = function (options) { + var optsPatch = { returnPartialData: false }; + return this.diffQueryAgainstStore(__assign({}, options, optsPatch)).result; + }; + StoreReader.prototype.diffQueryAgainstStore = function (_a) { + var store = _a.store, query = _a.query, variables = _a.variables, previousResult = _a.previousResult, _b = _a.returnPartialData, returnPartialData = _b === void 0 ? true : _b, _c = _a.rootId, rootId = _c === void 0 ? 'ROOT_QUERY' : _c, fragmentMatcherFunction = _a.fragmentMatcherFunction, config = _a.config; + var queryDefinition = getQueryDefinition(query); + variables = assign({}, getDefaultValues(queryDefinition), variables); + var context = { + store: store, + dataIdFromObject: (config && config.dataIdFromObject) || null, + cacheRedirects: (config && config.cacheRedirects) || {}, + }; + var execResult = this.executeStoreQuery({ + query: query, + rootValue: { + type: 'id', + id: rootId, + generated: true, + typename: 'Query', + }, + contextValue: context, + variableValues: variables, + fragmentMatcher: fragmentMatcherFunction, + }); + var hasMissingFields = execResult.missing && execResult.missing.length > 0; + if (hasMissingFields && !returnPartialData) { + execResult.missing.forEach(function (info) { + if (info.tolerable) + return; + throw process.env.NODE_ENV === "production" ? new InvariantError(2) : new InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); + }); + } + if (previousResult) { + if (isEqual(previousResult, execResult.result)) { + execResult.result = previousResult; + } + } + return { + result: execResult.result, + complete: !hasMissingFields, + }; + }; + StoreReader.prototype.executeStoreQuery = function (_a) { + var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, _b = _a.fragmentMatcher, fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; + var mainDefinition = getMainDefinition(query); + var fragments = getFragmentDefinitions(query); + var fragmentMap = createFragmentMap(fragments); + var execContext = { + query: query, + fragmentMap: fragmentMap, + contextValue: contextValue, + variableValues: variableValues, + fragmentMatcher: fragmentMatcher, + }; + return this.executeSelectionSet({ + selectionSet: mainDefinition.selectionSet, + rootValue: rootValue, + execContext: execContext, + }); + }; + StoreReader.prototype.executeSelectionSet = function (_a) { + var _this = this; + var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; + var fragmentMap = execContext.fragmentMap, contextValue = execContext.contextValue, variables = execContext.variableValues; + var finalResult = { result: null }; + var objectsToMerge = []; + var object = contextValue.store.get(rootValue.id); + var typename = (object && object.__typename) || + (rootValue.id === 'ROOT_QUERY' && 'Query') || + void 0; + function handleMissing(result) { + var _a; + if (result.missing) { + finalResult.missing = finalResult.missing || []; + (_a = finalResult.missing).push.apply(_a, result.missing); + } + return result.result; + } + selectionSet.selections.forEach(function (selection) { + var _a; + if (!shouldInclude(selection, variables)) { + return; + } + if (isField(selection)) { + var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); + if (typeof fieldResult !== 'undefined') { + objectsToMerge.push((_a = {}, + _a[resultKeyNameFromField(selection)] = fieldResult, + _a)); + } + } + else { + var fragment = void 0; + if (isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = fragmentMap[selection.name.value]; + if (!fragment) { + throw process.env.NODE_ENV === "production" ? new InvariantError(3) : new InvariantError("No fragment named " + selection.name.value); + } + } + var typeCondition = fragment.typeCondition.name.value; + var match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue); + if (match) { + var fragmentExecResult = _this.executeSelectionSet({ + selectionSet: fragment.selectionSet, + rootValue: rootValue, + execContext: execContext, + }); + if (match === 'heuristic' && fragmentExecResult.missing) { + fragmentExecResult = __assign({}, fragmentExecResult, { missing: fragmentExecResult.missing.map(function (info) { + return __assign({}, info, { tolerable: true }); + }) }); + } + objectsToMerge.push(handleMissing(fragmentExecResult)); + } + } + }); + finalResult.result = mergeDeepArray(objectsToMerge); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(finalResult.result); + } + return finalResult; + }; + StoreReader.prototype.executeField = function (object, typename, field, execContext) { + var variables = execContext.variableValues, contextValue = execContext.contextValue; + var fieldName = field.name.value; + var args = argumentsObjectFromField(field, variables); + var info = { + resultKey: resultKeyNameFromField(field), + directives: getDirectiveInfoFromField(field, variables), + }; + var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); + if (Array.isArray(readStoreResult.result)) { + return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ + field: field, + array: readStoreResult.result, + execContext: execContext, + })); + } + if (!field.selectionSet) { + assertSelectionSetForIdValue(field, readStoreResult.result); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + maybeDeepFreeze(readStoreResult); + } + return readStoreResult; + } + if (readStoreResult.result == null) { + return readStoreResult; + } + return this.combineExecResults(readStoreResult, this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: readStoreResult.result, + execContext: execContext, + })); + }; + StoreReader.prototype.combineExecResults = function () { + var execResults = []; + for (var _i = 0; _i < arguments.length; _i++) { + execResults[_i] = arguments[_i]; + } + var missing = null; + execResults.forEach(function (execResult) { + if (execResult.missing) { + missing = missing || []; + missing.push.apply(missing, execResult.missing); + } + }); + return { + result: execResults.pop().result, + missing: missing, + }; + }; + StoreReader.prototype.executeSubSelectedArray = function (_a) { + var _this = this; + var field = _a.field, array = _a.array, execContext = _a.execContext; + var missing = null; + function handleMissing(childResult) { + if (childResult.missing) { + missing = missing || []; + missing.push.apply(missing, childResult.missing); + } + return childResult.result; + } + array = array.map(function (item) { + if (item === null) { + return null; + } + if (Array.isArray(item)) { + return handleMissing(_this.executeSubSelectedArray({ + field: field, + array: item, + execContext: execContext, + })); + } + if (field.selectionSet) { + return handleMissing(_this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: item, + execContext: execContext, + })); + } + assertSelectionSetForIdValue(field, item); + return item; + }); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(array); + } + return { result: array, missing: missing }; + }; + return StoreReader; +}()); +function assertSelectionSetForIdValue(field, value) { + if (!field.selectionSet && isIdValue(value)) { + throw process.env.NODE_ENV === "production" ? new InvariantError(4) : new InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); + } +} +function defaultFragmentMatcher() { + return true; +} +function assertIdValue(idValue) { + process.env.NODE_ENV === "production" ? invariant(isIdValue(idValue), 5) : invariant(isIdValue(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); +} +function readStoreResolver(object, typename, fieldName, args, context, _a) { + var resultKey = _a.resultKey, directives = _a.directives; + var storeKeyName = fieldName; + if (args || directives) { + storeKeyName = getStoreKeyName(storeKeyName, args, directives); + } + var fieldValue = void 0; + if (object) { + fieldValue = object[storeKeyName]; + if (typeof fieldValue === 'undefined' && + context.cacheRedirects && + typeof typename === 'string') { + var type = context.cacheRedirects[typename]; + if (type) { + var resolver = type[fieldName]; + if (resolver) { + fieldValue = resolver(object, args, { + getCacheKey: function (storeObj) { + return toIdValue({ + id: context.dataIdFromObject(storeObj), + typename: storeObj.__typename, + }); + }, + }); + } + } + } + } + if (typeof fieldValue === 'undefined') { + return { + result: fieldValue, + missing: [{ + object: object, + fieldName: storeKeyName, + tolerable: false, + }], + }; + } + if (isJsonValue(fieldValue)) { + fieldValue = fieldValue.json; + } + return { + result: fieldValue, + }; +} + +var ObjectCache = (function () { + function ObjectCache(data) { + if (data === void 0) { data = Object.create(null); } + this.data = data; + } + ObjectCache.prototype.toObject = function () { + return this.data; + }; + ObjectCache.prototype.get = function (dataId) { + return this.data[dataId]; + }; + ObjectCache.prototype.set = function (dataId, value) { + this.data[dataId] = value; + }; + ObjectCache.prototype.delete = function (dataId) { + this.data[dataId] = void 0; + }; + ObjectCache.prototype.clear = function () { + this.data = Object.create(null); + }; + ObjectCache.prototype.replace = function (newData) { + this.data = newData || Object.create(null); + }; + return ObjectCache; +}()); +function defaultNormalizedCacheFactory$1(seed) { + return new ObjectCache(seed); +} + +var WriteError = (function (_super) { + __extends(WriteError, _super); + function WriteError() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = 'WriteError'; + return _this; + } + return WriteError; +}(Error)); +function enhanceErrorWithDocument(error, document) { + var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); + enhancedError.message += '\n' + error.message; + enhancedError.stack = error.stack; + return enhancedError; +} +var StoreWriter = (function () { + function StoreWriter() { + } + StoreWriter.prototype.writeQueryToStore = function (_a) { + var query = _a.query, result = _a.result, _b = _a.store, store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; + return this.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + store: store, + variables: variables, + dataIdFromObject: dataIdFromObject, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + }; + StoreWriter.prototype.writeResultToStore = function (_a) { + var dataId = _a.dataId, result = _a.result, document = _a.document, _b = _a.store, store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; + var operationDefinition = getOperationDefinition(document); + try { + return this.writeSelectionSetToStore({ + result: result, + dataId: dataId, + selectionSet: operationDefinition.selectionSet, + context: { + store: store, + processedData: {}, + variables: assign({}, getDefaultValues(operationDefinition), variables), + dataIdFromObject: dataIdFromObject, + fragmentMap: createFragmentMap(getFragmentDefinitions(document)), + fragmentMatcherFunction: fragmentMatcherFunction, + }, + }); + } + catch (e) { + throw enhanceErrorWithDocument(e, document); + } + }; + StoreWriter.prototype.writeSelectionSetToStore = function (_a) { + var _this = this; + var result = _a.result, dataId = _a.dataId, selectionSet = _a.selectionSet, context = _a.context; + var variables = context.variables, store = context.store, fragmentMap = context.fragmentMap; + selectionSet.selections.forEach(function (selection) { + var _a; + if (!shouldInclude(selection, variables)) { + return; + } + if (isField(selection)) { + var resultFieldKey = resultKeyNameFromField(selection); + var value = result[resultFieldKey]; + if (typeof value !== 'undefined') { + _this.writeFieldToStore({ + dataId: dataId, + value: value, + field: selection, + context: context, + }); + } + else { + var isDefered = false; + var isClient = false; + if (selection.directives && selection.directives.length) { + isDefered = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'defer'; }); + isClient = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'client'; }); + } + if (!isDefered && !isClient && context.fragmentMatcherFunction) { + process.env.NODE_ENV === "production" || invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); + } + } + } + else { + var fragment = void 0; + if (isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = (fragmentMap || {})[selection.name.value]; + process.env.NODE_ENV === "production" ? invariant(fragment, 6) : invariant(fragment, "No fragment named " + selection.name.value + "."); + } + var matches = true; + if (context.fragmentMatcherFunction && fragment.typeCondition) { + var id = dataId || 'self'; + var idValue = toIdValue({ id: id, typename: undefined }); + var fakeContext = { + store: new ObjectCache((_a = {}, _a[id] = result, _a)), + cacheRedirects: {}, + }; + var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); + if (!isProduction() && match === 'heuristic') { + process.env.NODE_ENV === "production" || invariant.error('WARNING: heuristic fragment matching going on!'); + } + matches = !!match; + } + if (matches) { + _this.writeSelectionSetToStore({ + result: result, + selectionSet: fragment.selectionSet, + dataId: dataId, + context: context, + }); + } + } + }); + return store; + }; + StoreWriter.prototype.writeFieldToStore = function (_a) { + var _b; + var field = _a.field, value = _a.value, dataId = _a.dataId, context = _a.context; + var variables = context.variables, dataIdFromObject = context.dataIdFromObject, store = context.store; + var storeValue; + var storeObject; + var storeFieldName = storeKeyNameFromField(field, variables); + if (!field.selectionSet || value === null) { + storeValue = + value != null && typeof value === 'object' + ? + { type: 'json', json: value } + : + value; + } + else if (Array.isArray(value)) { + var generatedId = dataId + "." + storeFieldName; + storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); + } + else { + var valueDataId = dataId + "." + storeFieldName; + var generated = true; + if (!isGeneratedId(valueDataId)) { + valueDataId = '$' + valueDataId; + } + if (dataIdFromObject) { + var semanticId = dataIdFromObject(value); + process.env.NODE_ENV === "production" ? invariant(!semanticId || !isGeneratedId(semanticId), 7) : invariant(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); + if (semanticId || + (typeof semanticId === 'number' && semanticId === 0)) { + valueDataId = semanticId; + generated = false; + } + } + if (!isDataProcessed(valueDataId, field, context.processedData)) { + this.writeSelectionSetToStore({ + dataId: valueDataId, + result: value, + selectionSet: field.selectionSet, + context: context, + }); + } + var typename = value.__typename; + storeValue = toIdValue({ id: valueDataId, typename: typename }, generated); + storeObject = store.get(dataId); + var escapedId = storeObject && storeObject[storeFieldName]; + if (escapedId !== storeValue && isIdValue(escapedId)) { + var hadTypename = escapedId.typename !== undefined; + var hasTypename = typename !== undefined; + var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; + process.env.NODE_ENV === "production" ? invariant(!generated || escapedId.generated || typenameChanged, 8) : invariant(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + process.env.NODE_ENV === "production" ? invariant(!hadTypename || hasTypename, 9) : invariant(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + if (escapedId.generated) { + if (typenameChanged) { + if (!generated) { + store.delete(escapedId.id); + } + } + else { + mergeWithGenerated(escapedId.id, storeValue.id, store); + } + } + } + } + storeObject = store.get(dataId); + if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) { + store.set(dataId, __assign({}, storeObject, (_b = {}, _b[storeFieldName] = storeValue, _b))); + } + }; + StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { + var _this = this; + return value.map(function (item, index) { + if (item === null) { + return null; + } + var itemDataId = generatedId + "." + index; + if (Array.isArray(item)) { + return _this.processArrayValue(item, itemDataId, selectionSet, context); + } + var generated = true; + if (context.dataIdFromObject) { + var semanticId = context.dataIdFromObject(item); + if (semanticId) { + itemDataId = semanticId; + generated = false; + } + } + if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { + _this.writeSelectionSetToStore({ + dataId: itemDataId, + result: item, + selectionSet: selectionSet, + context: context, + }); + } + return toIdValue({ id: itemDataId, typename: item.__typename }, generated); + }); + }; + return StoreWriter; +}()); +function isGeneratedId(id) { + return id[0] === '$'; +} +function mergeWithGenerated(generatedKey, realKey, cache) { + if (generatedKey === realKey) { + return false; + } + var generated = cache.get(generatedKey); + var real = cache.get(realKey); + var madeChanges = false; + Object.keys(generated).forEach(function (key) { + var value = generated[key]; + var realValue = real[key]; + if (isIdValue(value) && + isGeneratedId(value.id) && + isIdValue(realValue) && + !isEqual(value, realValue) && + mergeWithGenerated(value.id, realValue.id, cache)) { + madeChanges = true; + } + }); + cache.delete(generatedKey); + var newRealValue = __assign({}, generated, real); + if (isEqual(newRealValue, real)) { + return madeChanges; + } + cache.set(realKey, newRealValue); + return true; +} +function isDataProcessed(dataId, field, processedData) { + if (!processedData) { + return false; + } + if (processedData[dataId]) { + if (processedData[dataId].indexOf(field) >= 0) { + return true; + } + else { + processedData[dataId].push(field); + } + } + else { + processedData[dataId] = [field]; + } + return false; +} + +var defaultConfig = { + fragmentMatcher: new HeuristicFragmentMatcher(), + dataIdFromObject: defaultDataIdFromObject, + addTypename: true, + resultCaching: true, + freezeResults: false, +}; +function defaultDataIdFromObject(result) { + if (result.__typename) { + if (result.id !== undefined) { + return result.__typename + ":" + result.id; + } + if (result._id !== undefined) { + return result.__typename + ":" + result._id; + } + } + return null; +} +var hasOwn$1 = Object.prototype.hasOwnProperty; +var OptimisticCacheLayer = (function (_super) { + __extends(OptimisticCacheLayer, _super); + function OptimisticCacheLayer(optimisticId, parent, transaction) { + var _this = _super.call(this, Object.create(null)) || this; + _this.optimisticId = optimisticId; + _this.parent = parent; + _this.transaction = transaction; + return _this; + } + OptimisticCacheLayer.prototype.toObject = function () { + return __assign({}, this.parent.toObject(), this.data); + }; + OptimisticCacheLayer.prototype.get = function (dataId) { + return hasOwn$1.call(this.data, dataId) + ? this.data[dataId] + : this.parent.get(dataId); + }; + return OptimisticCacheLayer; +}(ObjectCache)); +var InMemoryCache = (function (_super) { + __extends(InMemoryCache, _super); + function InMemoryCache(config) { + if (config === void 0) { config = {}; } + var _this = _super.call(this) || this; + _this.watches = new Set(); + _this.typenameDocumentCache = new Map(); + _this.cacheKeyRoot = new KeyTrie(canUseWeakMap); + _this.silenceBroadcast = false; + _this.config = __assign({}, defaultConfig, config); + if (_this.config.customResolvers) { + process.env.NODE_ENV === "production" || invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.customResolvers; + } + if (_this.config.cacheResolvers) { + process.env.NODE_ENV === "production" || invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.cacheResolvers; + } + _this.addTypename = _this.config.addTypename; + _this.data = _this.config.resultCaching + ? new DepTrackingCache() + : new ObjectCache(); + _this.optimisticData = _this.data; + _this.storeWriter = new StoreWriter(); + _this.storeReader = new StoreReader({ + cacheKeyRoot: _this.cacheKeyRoot, + freezeResults: config.freezeResults, + }); + var cache = _this; + var maybeBroadcastWatch = cache.maybeBroadcastWatch; + _this.maybeBroadcastWatch = wrap$1(function (c) { + return maybeBroadcastWatch.call(_this, c); + }, { + makeCacheKey: function (c) { + if (c.optimistic) { + return; + } + if (c.previousResult) { + return; + } + if (cache.data instanceof DepTrackingCache) { + return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); + } + } + }); + return _this; + } + InMemoryCache.prototype.restore = function (data) { + if (data) + this.data.replace(data); + return this; + }; + InMemoryCache.prototype.extract = function (optimistic) { + if (optimistic === void 0) { optimistic = false; } + return (optimistic ? this.optimisticData : this.data).toObject(); + }; + InMemoryCache.prototype.read = function (options) { + if (typeof options.rootId === 'string' && + typeof this.data.get(options.rootId) === 'undefined') { + return null; + } + return this.storeReader.readQueryFromStore({ + store: options.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(options.query), + variables: options.variables, + rootId: options.rootId, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + previousResult: options.previousResult, + config: this.config, + }); + }; + InMemoryCache.prototype.write = function (write) { + this.storeWriter.writeResultToStore({ + dataId: write.dataId, + result: write.result, + variables: write.variables, + document: this.transformDocument(write.query), + store: this.data, + dataIdFromObject: this.config.dataIdFromObject, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + }); + this.broadcastWatches(); + }; + InMemoryCache.prototype.diff = function (query) { + return this.storeReader.diffQueryAgainstStore({ + store: query.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(query.query), + variables: query.variables, + returnPartialData: query.returnPartialData, + previousResult: query.previousResult, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + config: this.config, + }); + }; + InMemoryCache.prototype.watch = function (watch) { + var _this = this; + this.watches.add(watch); + return function () { + _this.watches.delete(watch); + }; + }; + InMemoryCache.prototype.evict = function (query) { + throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("eviction is not implemented on InMemory Cache"); + }; + InMemoryCache.prototype.reset = function () { + this.data.clear(); + this.broadcastWatches(); + return Promise.resolve(); + }; + InMemoryCache.prototype.removeOptimistic = function (idToRemove) { + var toReapply = []; + var removedCount = 0; + var layer = this.optimisticData; + while (layer instanceof OptimisticCacheLayer) { + if (layer.optimisticId === idToRemove) { + ++removedCount; + } + else { + toReapply.push(layer); + } + layer = layer.parent; + } + if (removedCount > 0) { + this.optimisticData = layer; + while (toReapply.length > 0) { + var layer_1 = toReapply.pop(); + this.performTransaction(layer_1.transaction, layer_1.optimisticId); + } + this.broadcastWatches(); + } + }; + InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { + var _a = this, data = _a.data, silenceBroadcast = _a.silenceBroadcast; + this.silenceBroadcast = true; + if (typeof optimisticId === 'string') { + this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); + } + try { + transaction(this); + } + finally { + this.silenceBroadcast = silenceBroadcast; + this.data = data; + } + this.broadcastWatches(); + }; + InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { + return this.performTransaction(transaction, id); + }; + InMemoryCache.prototype.transformDocument = function (document) { + if (this.addTypename) { + var result = this.typenameDocumentCache.get(document); + if (!result) { + result = addTypenameToDocument(document); + this.typenameDocumentCache.set(document, result); + this.typenameDocumentCache.set(result, result); + } + return result; + } + return document; + }; + InMemoryCache.prototype.broadcastWatches = function () { + var _this = this; + if (!this.silenceBroadcast) { + this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c); }); + } + }; + InMemoryCache.prototype.maybeBroadcastWatch = function (c) { + c.callback(this.diff({ + query: c.query, + variables: c.variables, + previousResult: c.previousResult && c.previousResult(), + optimistic: c.optimistic, + })); + }; + return InMemoryCache; +}(ApolloCache)); + +export { HeuristicFragmentMatcher, InMemoryCache, IntrospectionFragmentMatcher, ObjectCache, StoreReader, StoreWriter, WriteError, assertIdValue, defaultDataIdFromObject, defaultNormalizedCacheFactory$1 as defaultNormalizedCacheFactory, enhanceErrorWithDocument }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map new file mode 100644 index 000000000..a97021550 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/fixPolyfills.ts","../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"sourcesContent":["// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n\nexport {}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n};\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"],"names":["wrap","defaultNormalizedCacheFactory","tslib_1.__extends","hasOwn"],"mappings":";;;;;;AAEA,IAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;AAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC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QAHC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;SACxD;KACF;IAIO,2CAAmB,GAA3B,UAA4B,CAAqB;QAC/C,CAAC,CAAC,QAAQ,CACR,IAAI,CAAC,IAAI,CAAC;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE;YACtD,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CACH,CAAC;KACH;IACH,oBAAC;CAxQD,CAAmC,WAAW;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js new file mode 100644 index 000000000..789bd8f2f --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js @@ -0,0 +1,1336 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "tslib", "apollo-cache", "apollo-utilities", "optimism", "ts-invariant"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("tslib"), require("apollo-cache"), require("apollo-utilities"), require("optimism"), require("ts-invariant")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.tslib, global.apolloCache, global.apolloUtilities, global.optimism, global.tsInvariant); + global.unknown = mod.exports; + } +})(this, function (_exports, _tslib, _apolloCache, _apolloUtilities, _optimism, _tsInvariant) { + + _exports.__esModule = true; + _exports.assertIdValue = assertIdValue; + _exports.defaultDataIdFromObject = defaultDataIdFromObject; + _exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory$1; + _exports.enhanceErrorWithDocument = enhanceErrorWithDocument; + _exports.WriteError = _exports.StoreWriter = _exports.StoreReader = _exports.ObjectCache = _exports.IntrospectionFragmentMatcher = _exports.InMemoryCache = _exports.HeuristicFragmentMatcher = void 0; + var testMap = new Map(); + + if (testMap.set(1, 2) !== testMap) { + var set_1 = testMap.set; + + Map.prototype.set = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + set_1.apply(this, args); + return this; + }; + } + + var testSet = new Set(); + + if (testSet.add(3) !== testSet) { + var add_1 = testSet.add; + + Set.prototype.add = function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + add_1.apply(this, args); + return this; + }; + } + + var frozen = {}; + + if (typeof Object.freeze === 'function') { + Object.freeze(frozen); + } + + try { + testMap.set(frozen, frozen).delete(frozen); + } catch (_a) { + var wrap = function (method) { + return method && function (obj) { + try { + testMap.set(obj, obj).delete(obj); + } finally { + return method.call(Object, obj); + } + }; + }; + + Object.freeze = wrap(Object.freeze); + Object.seal = wrap(Object.seal); + Object.preventExtensions = wrap(Object.preventExtensions); + } + + var haveWarned = false; + + function shouldWarn() { + var answer = !haveWarned; + + if (!(0, _apolloUtilities.isTest)()) { + haveWarned = true; + } + + return answer; + } + + var HeuristicFragmentMatcher = function () { + function HeuristicFragmentMatcher() {} + + HeuristicFragmentMatcher.prototype.ensureReady = function () { + return Promise.resolve(); + }; + + HeuristicFragmentMatcher.prototype.canBypassInit = function () { + return true; + }; + + HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + + if (!obj) { + return isRootQuery; + } + + var _a = obj.__typename, + __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + + if (!__typename) { + if (shouldWarn()) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); + } + + return 'heuristic'; + } + + if (__typename === typeCondition) { + return true; + } + + if (shouldWarn()) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + 'queries contain union or interface types. Apollo Client will not be ' + 'able to accurately map fragments. To make this error go away, use ' + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); + } + + return 'heuristic'; + }; + + return HeuristicFragmentMatcher; + }(); + + _exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; + + var IntrospectionFragmentMatcher = function () { + function IntrospectionFragmentMatcher(options) { + if (options && options.introspectionQueryResultData) { + this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); + this.isReady = true; + } else { + this.isReady = false; + } + + this.match = this.match.bind(this); + } + + IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(this.isReady, 10) : (0, _tsInvariant.invariant)(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + + if (!obj) { + return isRootQuery; + } + + var _a = obj.__typename, + __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(__typename, 11) : (0, _tsInvariant.invariant)(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); + + if (__typename === typeCondition) { + return true; + } + + var implementingTypes = this.possibleTypesMap[typeCondition]; + + if (implementingTypes && implementingTypes.indexOf(__typename) > -1) { + return true; + } + + return false; + }; + + IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { + var typeMap = {}; + + introspectionResultData.__schema.types.forEach(function (type) { + if (type.kind === 'UNION' || type.kind === 'INTERFACE') { + typeMap[type.name] = type.possibleTypes.map(function (implementingType) { + return implementingType.name; + }); + } + }); + + return typeMap; + }; + + return IntrospectionFragmentMatcher; + }(); + + _exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; + var hasOwn = Object.prototype.hasOwnProperty; + + var DepTrackingCache = function () { + function DepTrackingCache(data) { + var _this = this; + + if (data === void 0) { + data = Object.create(null); + } + + this.data = data; + this.depend = (0, _optimism.wrap)(function (dataId) { + return _this.data[dataId]; + }, { + disposable: true, + makeCacheKey: function (dataId) { + return dataId; + } + }); + } + + DepTrackingCache.prototype.toObject = function () { + return this.data; + }; + + DepTrackingCache.prototype.get = function (dataId) { + this.depend(dataId); + return this.data[dataId]; + }; + + DepTrackingCache.prototype.set = function (dataId, value) { + var oldValue = this.data[dataId]; + + if (value !== oldValue) { + this.data[dataId] = value; + this.depend.dirty(dataId); + } + }; + + DepTrackingCache.prototype.delete = function (dataId) { + if (hasOwn.call(this.data, dataId)) { + delete this.data[dataId]; + this.depend.dirty(dataId); + } + }; + + DepTrackingCache.prototype.clear = function () { + this.replace(null); + }; + + DepTrackingCache.prototype.replace = function (newData) { + var _this = this; + + if (newData) { + Object.keys(newData).forEach(function (dataId) { + _this.set(dataId, newData[dataId]); + }); + Object.keys(this.data).forEach(function (dataId) { + if (!hasOwn.call(newData, dataId)) { + _this.delete(dataId); + } + }); + } else { + Object.keys(this.data).forEach(function (dataId) { + _this.delete(dataId); + }); + } + }; + + return DepTrackingCache; + }(); + + function defaultNormalizedCacheFactory(seed) { + return new DepTrackingCache(seed); + } + + var StoreReader = function () { + function StoreReader(_a) { + var _this = this; + + var _b = _a === void 0 ? {} : _a, + _c = _b.cacheKeyRoot, + cacheKeyRoot = _c === void 0 ? new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap) : _c, + _d = _b.freezeResults, + freezeResults = _d === void 0 ? false : _d; + + var _e = this, + executeStoreQuery = _e.executeStoreQuery, + executeSelectionSet = _e.executeSelectionSet, + executeSubSelectedArray = _e.executeSubSelectedArray; + + this.freezeResults = freezeResults; + this.executeStoreQuery = (0, _optimism.wrap)(function (options) { + return executeStoreQuery.call(_this, options); + }, { + makeCacheKey: function (_a) { + var query = _a.query, + rootValue = _a.rootValue, + contextValue = _a.contextValue, + variableValues = _a.variableValues, + fragmentMatcher = _a.fragmentMatcher; + + if (contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); + } + } + }); + this.executeSelectionSet = (0, _optimism.wrap)(function (options) { + return executeSelectionSet.call(_this, options); + }, { + makeCacheKey: function (_a) { + var selectionSet = _a.selectionSet, + rootValue = _a.rootValue, + execContext = _a.execContext; + + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); + } + } + }); + this.executeSubSelectedArray = (0, _optimism.wrap)(function (options) { + return executeSubSelectedArray.call(_this, options); + }, { + makeCacheKey: function (_a) { + var field = _a.field, + array = _a.array, + execContext = _a.execContext; + + if (execContext.contextValue.store instanceof DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); + } + } + }); + } + + StoreReader.prototype.readQueryFromStore = function (options) { + var optsPatch = { + returnPartialData: false + }; + return this.diffQueryAgainstStore((0, _tslib.__assign)({}, options, optsPatch)).result; + }; + + StoreReader.prototype.diffQueryAgainstStore = function (_a) { + var store = _a.store, + query = _a.query, + variables = _a.variables, + previousResult = _a.previousResult, + _b = _a.returnPartialData, + returnPartialData = _b === void 0 ? true : _b, + _c = _a.rootId, + rootId = _c === void 0 ? 'ROOT_QUERY' : _c, + fragmentMatcherFunction = _a.fragmentMatcherFunction, + config = _a.config; + var queryDefinition = (0, _apolloUtilities.getQueryDefinition)(query); + variables = (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(queryDefinition), variables); + var context = { + store: store, + dataIdFromObject: config && config.dataIdFromObject || null, + cacheRedirects: config && config.cacheRedirects || {} + }; + var execResult = this.executeStoreQuery({ + query: query, + rootValue: { + type: 'id', + id: rootId, + generated: true, + typename: 'Query' + }, + contextValue: context, + variableValues: variables, + fragmentMatcher: fragmentMatcherFunction + }); + var hasMissingFields = execResult.missing && execResult.missing.length > 0; + + if (hasMissingFields && !returnPartialData) { + execResult.missing.forEach(function (info) { + if (info.tolerable) return; + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(2) : new _tsInvariant.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); + }); + } + + if (previousResult) { + if ((0, _apolloUtilities.isEqual)(previousResult, execResult.result)) { + execResult.result = previousResult; + } + } + + return { + result: execResult.result, + complete: !hasMissingFields + }; + }; + + StoreReader.prototype.executeStoreQuery = function (_a) { + var query = _a.query, + rootValue = _a.rootValue, + contextValue = _a.contextValue, + variableValues = _a.variableValues, + _b = _a.fragmentMatcher, + fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; + var mainDefinition = (0, _apolloUtilities.getMainDefinition)(query); + var fragments = (0, _apolloUtilities.getFragmentDefinitions)(query); + var fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); + var execContext = { + query: query, + fragmentMap: fragmentMap, + contextValue: contextValue, + variableValues: variableValues, + fragmentMatcher: fragmentMatcher + }; + return this.executeSelectionSet({ + selectionSet: mainDefinition.selectionSet, + rootValue: rootValue, + execContext: execContext + }); + }; + + StoreReader.prototype.executeSelectionSet = function (_a) { + var _this = this; + + var selectionSet = _a.selectionSet, + rootValue = _a.rootValue, + execContext = _a.execContext; + var fragmentMap = execContext.fragmentMap, + contextValue = execContext.contextValue, + variables = execContext.variableValues; + var finalResult = { + result: null + }; + var objectsToMerge = []; + var object = contextValue.store.get(rootValue.id); + var typename = object && object.__typename || rootValue.id === 'ROOT_QUERY' && 'Query' || void 0; + + function handleMissing(result) { + var _a; + + if (result.missing) { + finalResult.missing = finalResult.missing || []; + + (_a = finalResult.missing).push.apply(_a, result.missing); + } + + return result.result; + } + + selectionSet.selections.forEach(function (selection) { + var _a; + + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return; + } + + if ((0, _apolloUtilities.isField)(selection)) { + var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); + + if (typeof fieldResult !== 'undefined') { + objectsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); + } + } else { + var fragment = void 0; + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = fragmentMap[selection.name.value]; + + if (!fragment) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); + } + } + + var typeCondition = fragment.typeCondition.name.value; + var match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue); + + if (match) { + var fragmentExecResult = _this.executeSelectionSet({ + selectionSet: fragment.selectionSet, + rootValue: rootValue, + execContext: execContext + }); + + if (match === 'heuristic' && fragmentExecResult.missing) { + fragmentExecResult = (0, _tslib.__assign)({}, fragmentExecResult, { + missing: fragmentExecResult.missing.map(function (info) { + return (0, _tslib.__assign)({}, info, { + tolerable: true + }); + }) + }); + } + + objectsToMerge.push(handleMissing(fragmentExecResult)); + } + } + }); + finalResult.result = (0, _apolloUtilities.mergeDeepArray)(objectsToMerge); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(finalResult.result); + } + + return finalResult; + }; + + StoreReader.prototype.executeField = function (object, typename, field, execContext) { + var variables = execContext.variableValues, + contextValue = execContext.contextValue; + var fieldName = field.name.value; + var args = (0, _apolloUtilities.argumentsObjectFromField)(field, variables); + var info = { + resultKey: (0, _apolloUtilities.resultKeyNameFromField)(field), + directives: (0, _apolloUtilities.getDirectiveInfoFromField)(field, variables) + }; + var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); + + if (Array.isArray(readStoreResult.result)) { + return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ + field: field, + array: readStoreResult.result, + execContext: execContext + })); + } + + if (!field.selectionSet) { + assertSelectionSetForIdValue(field, readStoreResult.result); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + (0, _apolloUtilities.maybeDeepFreeze)(readStoreResult); + } + + return readStoreResult; + } + + if (readStoreResult.result == null) { + return readStoreResult; + } + + return this.combineExecResults(readStoreResult, this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: readStoreResult.result, + execContext: execContext + })); + }; + + StoreReader.prototype.combineExecResults = function () { + var execResults = []; + + for (var _i = 0; _i < arguments.length; _i++) { + execResults[_i] = arguments[_i]; + } + + var missing = null; + execResults.forEach(function (execResult) { + if (execResult.missing) { + missing = missing || []; + missing.push.apply(missing, execResult.missing); + } + }); + return { + result: execResults.pop().result, + missing: missing + }; + }; + + StoreReader.prototype.executeSubSelectedArray = function (_a) { + var _this = this; + + var field = _a.field, + array = _a.array, + execContext = _a.execContext; + var missing = null; + + function handleMissing(childResult) { + if (childResult.missing) { + missing = missing || []; + missing.push.apply(missing, childResult.missing); + } + + return childResult.result; + } + + array = array.map(function (item) { + if (item === null) { + return null; + } + + if (Array.isArray(item)) { + return handleMissing(_this.executeSubSelectedArray({ + field: field, + array: item, + execContext: execContext + })); + } + + if (field.selectionSet) { + return handleMissing(_this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: item, + execContext: execContext + })); + } + + assertSelectionSetForIdValue(field, item); + return item; + }); + + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(array); + } + + return { + result: array, + missing: missing + }; + }; + + return StoreReader; + }(); + + _exports.StoreReader = StoreReader; + + function assertSelectionSetForIdValue(field, value) { + if (!field.selectionSet && (0, _apolloUtilities.isIdValue)(value)) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(4) : new _tsInvariant.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); + } + } + + function defaultFragmentMatcher() { + return true; + } + + function assertIdValue(idValue) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), 5) : (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); + } + + function readStoreResolver(object, typename, fieldName, args, context, _a) { + var resultKey = _a.resultKey, + directives = _a.directives; + var storeKeyName = fieldName; + + if (args || directives) { + storeKeyName = (0, _apolloUtilities.getStoreKeyName)(storeKeyName, args, directives); + } + + var fieldValue = void 0; + + if (object) { + fieldValue = object[storeKeyName]; + + if (typeof fieldValue === 'undefined' && context.cacheRedirects && typeof typename === 'string') { + var type = context.cacheRedirects[typename]; + + if (type) { + var resolver = type[fieldName]; + + if (resolver) { + fieldValue = resolver(object, args, { + getCacheKey: function (storeObj) { + return (0, _apolloUtilities.toIdValue)({ + id: context.dataIdFromObject(storeObj), + typename: storeObj.__typename + }); + } + }); + } + } + } + } + + if (typeof fieldValue === 'undefined') { + return { + result: fieldValue, + missing: [{ + object: object, + fieldName: storeKeyName, + tolerable: false + }] + }; + } + + if ((0, _apolloUtilities.isJsonValue)(fieldValue)) { + fieldValue = fieldValue.json; + } + + return { + result: fieldValue + }; + } + + var ObjectCache = function () { + function ObjectCache(data) { + if (data === void 0) { + data = Object.create(null); + } + + this.data = data; + } + + ObjectCache.prototype.toObject = function () { + return this.data; + }; + + ObjectCache.prototype.get = function (dataId) { + return this.data[dataId]; + }; + + ObjectCache.prototype.set = function (dataId, value) { + this.data[dataId] = value; + }; + + ObjectCache.prototype.delete = function (dataId) { + this.data[dataId] = void 0; + }; + + ObjectCache.prototype.clear = function () { + this.data = Object.create(null); + }; + + ObjectCache.prototype.replace = function (newData) { + this.data = newData || Object.create(null); + }; + + return ObjectCache; + }(); + + _exports.ObjectCache = ObjectCache; + + function defaultNormalizedCacheFactory$1(seed) { + return new ObjectCache(seed); + } + + var WriteError = function (_super) { + (0, _tslib.__extends)(WriteError, _super); + + function WriteError() { + var _this = _super !== null && _super.apply(this, arguments) || this; + + _this.type = 'WriteError'; + return _this; + } + + return WriteError; + }(Error); + + _exports.WriteError = WriteError; + + function enhanceErrorWithDocument(error, document) { + var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); + enhancedError.message += '\n' + error.message; + enhancedError.stack = error.stack; + return enhancedError; + } + + var StoreWriter = function () { + function StoreWriter() {} + + StoreWriter.prototype.writeQueryToStore = function (_a) { + var query = _a.query, + result = _a.result, + _b = _a.store, + store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, + variables = _a.variables, + dataIdFromObject = _a.dataIdFromObject, + fragmentMatcherFunction = _a.fragmentMatcherFunction; + return this.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + store: store, + variables: variables, + dataIdFromObject: dataIdFromObject, + fragmentMatcherFunction: fragmentMatcherFunction + }); + }; + + StoreWriter.prototype.writeResultToStore = function (_a) { + var dataId = _a.dataId, + result = _a.result, + document = _a.document, + _b = _a.store, + store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, + variables = _a.variables, + dataIdFromObject = _a.dataIdFromObject, + fragmentMatcherFunction = _a.fragmentMatcherFunction; + var operationDefinition = (0, _apolloUtilities.getOperationDefinition)(document); + + try { + return this.writeSelectionSetToStore({ + result: result, + dataId: dataId, + selectionSet: operationDefinition.selectionSet, + context: { + store: store, + processedData: {}, + variables: (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(operationDefinition), variables), + dataIdFromObject: dataIdFromObject, + fragmentMap: (0, _apolloUtilities.createFragmentMap)((0, _apolloUtilities.getFragmentDefinitions)(document)), + fragmentMatcherFunction: fragmentMatcherFunction + } + }); + } catch (e) { + throw enhanceErrorWithDocument(e, document); + } + }; + + StoreWriter.prototype.writeSelectionSetToStore = function (_a) { + var _this = this; + + var result = _a.result, + dataId = _a.dataId, + selectionSet = _a.selectionSet, + context = _a.context; + var variables = context.variables, + store = context.store, + fragmentMap = context.fragmentMap; + selectionSet.selections.forEach(function (selection) { + var _a; + + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return; + } + + if ((0, _apolloUtilities.isField)(selection)) { + var resultFieldKey = (0, _apolloUtilities.resultKeyNameFromField)(selection); + var value = result[resultFieldKey]; + + if (typeof value !== 'undefined') { + _this.writeFieldToStore({ + dataId: dataId, + value: value, + field: selection, + context: context + }); + } else { + var isDefered = false; + var isClient = false; + + if (selection.directives && selection.directives.length) { + isDefered = selection.directives.some(function (directive) { + return directive.name && directive.name.value === 'defer'; + }); + isClient = selection.directives.some(function (directive) { + return directive.name && directive.name.value === 'client'; + }); + } + + if (!isDefered && !isClient && context.fragmentMatcherFunction) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); + } + } + } else { + var fragment = void 0; + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = (fragmentMap || {})[selection.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 6) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value + "."); + } + + var matches = true; + + if (context.fragmentMatcherFunction && fragment.typeCondition) { + var id = dataId || 'self'; + var idValue = (0, _apolloUtilities.toIdValue)({ + id: id, + typename: undefined + }); + var fakeContext = { + store: new ObjectCache((_a = {}, _a[id] = result, _a)), + cacheRedirects: {} + }; + var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); + + if (!(0, _apolloUtilities.isProduction)() && match === 'heuristic') { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('WARNING: heuristic fragment matching going on!'); + } + + matches = !!match; + } + + if (matches) { + _this.writeSelectionSetToStore({ + result: result, + selectionSet: fragment.selectionSet, + dataId: dataId, + context: context + }); + } + } + }); + return store; + }; + + StoreWriter.prototype.writeFieldToStore = function (_a) { + var _b; + + var field = _a.field, + value = _a.value, + dataId = _a.dataId, + context = _a.context; + var variables = context.variables, + dataIdFromObject = context.dataIdFromObject, + store = context.store; + var storeValue; + var storeObject; + var storeFieldName = (0, _apolloUtilities.storeKeyNameFromField)(field, variables); + + if (!field.selectionSet || value === null) { + storeValue = value != null && typeof value === 'object' ? { + type: 'json', + json: value + } : value; + } else if (Array.isArray(value)) { + var generatedId = dataId + "." + storeFieldName; + storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); + } else { + var valueDataId = dataId + "." + storeFieldName; + var generated = true; + + if (!isGeneratedId(valueDataId)) { + valueDataId = '$' + valueDataId; + } + + if (dataIdFromObject) { + var semanticId = dataIdFromObject(value); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 7) : (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); + + if (semanticId || typeof semanticId === 'number' && semanticId === 0) { + valueDataId = semanticId; + generated = false; + } + } + + if (!isDataProcessed(valueDataId, field, context.processedData)) { + this.writeSelectionSetToStore({ + dataId: valueDataId, + result: value, + selectionSet: field.selectionSet, + context: context + }); + } + + var typename = value.__typename; + storeValue = (0, _apolloUtilities.toIdValue)({ + id: valueDataId, + typename: typename + }, generated); + storeObject = store.get(dataId); + var escapedId = storeObject && storeObject[storeFieldName]; + + if (escapedId !== storeValue && (0, _apolloUtilities.isIdValue)(escapedId)) { + var hadTypename = escapedId.typename !== undefined; + var hasTypename = typename !== undefined; + var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, 8) : (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!hadTypename || hasTypename, 9) : (0, _tsInvariant.invariant)(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + + if (escapedId.generated) { + if (typenameChanged) { + if (!generated) { + store.delete(escapedId.id); + } + } else { + mergeWithGenerated(escapedId.id, storeValue.id, store); + } + } + } + } + + storeObject = store.get(dataId); + + if (!storeObject || !(0, _apolloUtilities.isEqual)(storeValue, storeObject[storeFieldName])) { + store.set(dataId, (0, _tslib.__assign)({}, storeObject, (_b = {}, _b[storeFieldName] = storeValue, _b))); + } + }; + + StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { + var _this = this; + + return value.map(function (item, index) { + if (item === null) { + return null; + } + + var itemDataId = generatedId + "." + index; + + if (Array.isArray(item)) { + return _this.processArrayValue(item, itemDataId, selectionSet, context); + } + + var generated = true; + + if (context.dataIdFromObject) { + var semanticId = context.dataIdFromObject(item); + + if (semanticId) { + itemDataId = semanticId; + generated = false; + } + } + + if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { + _this.writeSelectionSetToStore({ + dataId: itemDataId, + result: item, + selectionSet: selectionSet, + context: context + }); + } + + return (0, _apolloUtilities.toIdValue)({ + id: itemDataId, + typename: item.__typename + }, generated); + }); + }; + + return StoreWriter; + }(); + + _exports.StoreWriter = StoreWriter; + + function isGeneratedId(id) { + return id[0] === '$'; + } + + function mergeWithGenerated(generatedKey, realKey, cache) { + if (generatedKey === realKey) { + return false; + } + + var generated = cache.get(generatedKey); + var real = cache.get(realKey); + var madeChanges = false; + Object.keys(generated).forEach(function (key) { + var value = generated[key]; + var realValue = real[key]; + + if ((0, _apolloUtilities.isIdValue)(value) && isGeneratedId(value.id) && (0, _apolloUtilities.isIdValue)(realValue) && !(0, _apolloUtilities.isEqual)(value, realValue) && mergeWithGenerated(value.id, realValue.id, cache)) { + madeChanges = true; + } + }); + cache.delete(generatedKey); + var newRealValue = (0, _tslib.__assign)({}, generated, real); + + if ((0, _apolloUtilities.isEqual)(newRealValue, real)) { + return madeChanges; + } + + cache.set(realKey, newRealValue); + return true; + } + + function isDataProcessed(dataId, field, processedData) { + if (!processedData) { + return false; + } + + if (processedData[dataId]) { + if (processedData[dataId].indexOf(field) >= 0) { + return true; + } else { + processedData[dataId].push(field); + } + } else { + processedData[dataId] = [field]; + } + + return false; + } + + var defaultConfig = { + fragmentMatcher: new HeuristicFragmentMatcher(), + dataIdFromObject: defaultDataIdFromObject, + addTypename: true, + resultCaching: true, + freezeResults: false + }; + + function defaultDataIdFromObject(result) { + if (result.__typename) { + if (result.id !== undefined) { + return result.__typename + ":" + result.id; + } + + if (result._id !== undefined) { + return result.__typename + ":" + result._id; + } + } + + return null; + } + + var hasOwn$1 = Object.prototype.hasOwnProperty; + + var OptimisticCacheLayer = function (_super) { + (0, _tslib.__extends)(OptimisticCacheLayer, _super); + + function OptimisticCacheLayer(optimisticId, parent, transaction) { + var _this = _super.call(this, Object.create(null)) || this; + + _this.optimisticId = optimisticId; + _this.parent = parent; + _this.transaction = transaction; + return _this; + } + + OptimisticCacheLayer.prototype.toObject = function () { + return (0, _tslib.__assign)({}, this.parent.toObject(), this.data); + }; + + OptimisticCacheLayer.prototype.get = function (dataId) { + return hasOwn$1.call(this.data, dataId) ? this.data[dataId] : this.parent.get(dataId); + }; + + return OptimisticCacheLayer; + }(ObjectCache); + + var InMemoryCache = function (_super) { + (0, _tslib.__extends)(InMemoryCache, _super); + + function InMemoryCache(config) { + if (config === void 0) { + config = {}; + } + + var _this = _super.call(this) || this; + + _this.watches = new Set(); + _this.typenameDocumentCache = new Map(); + _this.cacheKeyRoot = new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap); + _this.silenceBroadcast = false; + _this.config = (0, _tslib.__assign)({}, defaultConfig, config); + + if (_this.config.customResolvers) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.customResolvers; + } + + if (_this.config.cacheResolvers) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.cacheResolvers; + } + + _this.addTypename = _this.config.addTypename; + _this.data = _this.config.resultCaching ? new DepTrackingCache() : new ObjectCache(); + _this.optimisticData = _this.data; + _this.storeWriter = new StoreWriter(); + _this.storeReader = new StoreReader({ + cacheKeyRoot: _this.cacheKeyRoot, + freezeResults: config.freezeResults + }); + var cache = _this; + var maybeBroadcastWatch = cache.maybeBroadcastWatch; + _this.maybeBroadcastWatch = (0, _optimism.wrap)(function (c) { + return maybeBroadcastWatch.call(_this, c); + }, { + makeCacheKey: function (c) { + if (c.optimistic) { + return; + } + + if (c.previousResult) { + return; + } + + if (cache.data instanceof DepTrackingCache) { + return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); + } + } + }); + return _this; + } + + InMemoryCache.prototype.restore = function (data) { + if (data) this.data.replace(data); + return this; + }; + + InMemoryCache.prototype.extract = function (optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return (optimistic ? this.optimisticData : this.data).toObject(); + }; + + InMemoryCache.prototype.read = function (options) { + if (typeof options.rootId === 'string' && typeof this.data.get(options.rootId) === 'undefined') { + return null; + } + + return this.storeReader.readQueryFromStore({ + store: options.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(options.query), + variables: options.variables, + rootId: options.rootId, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + previousResult: options.previousResult, + config: this.config + }); + }; + + InMemoryCache.prototype.write = function (write) { + this.storeWriter.writeResultToStore({ + dataId: write.dataId, + result: write.result, + variables: write.variables, + document: this.transformDocument(write.query), + store: this.data, + dataIdFromObject: this.config.dataIdFromObject, + fragmentMatcherFunction: this.config.fragmentMatcher.match + }); + this.broadcastWatches(); + }; + + InMemoryCache.prototype.diff = function (query) { + return this.storeReader.diffQueryAgainstStore({ + store: query.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(query.query), + variables: query.variables, + returnPartialData: query.returnPartialData, + previousResult: query.previousResult, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + config: this.config + }); + }; + + InMemoryCache.prototype.watch = function (watch) { + var _this = this; + + this.watches.add(watch); + return function () { + _this.watches.delete(watch); + }; + }; + + InMemoryCache.prototype.evict = function (query) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("eviction is not implemented on InMemory Cache"); + }; + + InMemoryCache.prototype.reset = function () { + this.data.clear(); + this.broadcastWatches(); + return Promise.resolve(); + }; + + InMemoryCache.prototype.removeOptimistic = function (idToRemove) { + var toReapply = []; + var removedCount = 0; + var layer = this.optimisticData; + + while (layer instanceof OptimisticCacheLayer) { + if (layer.optimisticId === idToRemove) { + ++removedCount; + } else { + toReapply.push(layer); + } + + layer = layer.parent; + } + + if (removedCount > 0) { + this.optimisticData = layer; + + while (toReapply.length > 0) { + var layer_1 = toReapply.pop(); + this.performTransaction(layer_1.transaction, layer_1.optimisticId); + } + + this.broadcastWatches(); + } + }; + + InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { + var _a = this, + data = _a.data, + silenceBroadcast = _a.silenceBroadcast; + + this.silenceBroadcast = true; + + if (typeof optimisticId === 'string') { + this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); + } + + try { + transaction(this); + } finally { + this.silenceBroadcast = silenceBroadcast; + this.data = data; + } + + this.broadcastWatches(); + }; + + InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { + return this.performTransaction(transaction, id); + }; + + InMemoryCache.prototype.transformDocument = function (document) { + if (this.addTypename) { + var result = this.typenameDocumentCache.get(document); + + if (!result) { + result = (0, _apolloUtilities.addTypenameToDocument)(document); + this.typenameDocumentCache.set(document, result); + this.typenameDocumentCache.set(result, result); + } + + return result; + } + + return document; + }; + + InMemoryCache.prototype.broadcastWatches = function () { + var _this = this; + + if (!this.silenceBroadcast) { + this.watches.forEach(function (c) { + return _this.maybeBroadcastWatch(c); + }); + } + }; + + InMemoryCache.prototype.maybeBroadcastWatch = function (c) { + c.callback(this.diff({ + query: c.query, + variables: c.variables, + previousResult: c.previousResult && c.previousResult(), + optimistic: c.optimistic + })); + }; + + return InMemoryCache; + }(_apolloCache.ApolloCache); + + + _exports.InMemoryCache = InMemoryCache; +}); diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map new file mode 100644 index 000000000..565ed26fc --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/fixPolyfills.ts","../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["wrap","defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,OAAO,GAAG,IAAI,GAAJ,EAAhB;;AACA,MAAI,OAAO,CAAC,GAAR,CAAY,CAAZ,EAAe,CAAf,MAAsB,OAA1B,EAAmC;AACzB,QAAA,KAAA,GAAA,OAAA,CAAA,GAAA;;AACR,IAAA,GAAG,CAAC,SAAJ,CAAc,GAAd,GAAoB,YAAA;AAAU,UAAA,IAAA,GAAA,EAAA;;WAAA,IAAA,EAAA,GAAA,C,EAAA,EAAA,GAAA,SAAA,CAAA,M,EAAA,EAAA,E,EAAO;AAAP,QAAA,IAAA,CAAA,EAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA;;;AAC5B,MAAA,KAAG,CAAC,KAAJ,CAAU,IAAV,EAAgB,IAAh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AAA,CAAA,iBAAA,GAAP,UAAyB,QAAzB,EAA+C;AAC7C,UAAI,KAAK,WAAT,EAAsB;AACpB,YAAI,MAAM,GAAG,KAAK,qBAAL,CAA2B,GAA3B,CAA+B,QAA/B,CAAb;;AACA,YAAI,CAAC,MAAL,EAAa;AACX,UAAA,MAAM,GAAG,4CAAsB,QAAtB,CAAT;AACA,eAAK,qBAAL,CAA2B,GAA3B,CAA+B,QAA/B,EAAyC,MAAzC;AAIA,eAAK,qBAAL,CAA2B,GAA3B,CAA+B,MAA/B,EAAuC,MAAvC;AACD;;AACD,eAAO,MAAP;AACD;;AACD,aAAO,QAAP;AACD,KAdM;;AAgBG,IAAA,aAAA,CAAA,SAAA,CAAA,gBAAA,GAAV,YAAA;AAAA,UAAA,KAAA,GAAA,IAAA;;AACE,UAAI,CAAC,KAAK,gBAAV,EAA4B;AAC1B,aAAK,OAAL,CAAa,OAAb,CAAqB,UAAA,CAAA,EAAC;AAAI,iBAAA,KAAI,CAAC,mBAAL,CAAyB,CAAzB,CAAA;AAA2B,SAArD;AACD;AACF,KAJS;;AAQF,IAAA,aAAA,CAAA,SAAA,CAAA,mBAAA,GAAR,UAA4B,CAA5B,EAAiD;AAC/C,MAAA,CAAC,CAAC,QAAF,CACE,KAAK,IAAL,CAAU;AACR,QAAA,KAAK,EAAE,CAAC,CAAC,KADD;AAER,QAAA,SAAS,EAAE,CAAC,CAAC,SAFL;AAGR,QAAA,cAAc,EAAE,CAAC,CAAC,cAAF,IAAoB,CAAC,CAAC,cAAF,EAH5B;AAIR,QAAA,UAAU,EAAE,CAAC,CAAC;AAJN,OAAV,CADF;AAQD,KATO;;AAUV,WAAA,aAAA;AAxQA,G,CAAmC,wB","sourcesContent":["// Make sure Map.prototype.set returns the Map instance, per spec.\n// https://github.com/apollographql/apollo-client/issues/4024\nconst testMap = new Map();\nif (testMap.set(1, 2) !== testMap) {\n const { set } = testMap;\n Map.prototype.set = function (...args) {\n set.apply(this, args);\n return this;\n };\n}\n\n// Make sure Set.prototype.add returns the Set instance, per spec.\nconst testSet = new Set();\nif (testSet.add(3) !== testSet) {\n const { add } = testSet;\n Set.prototype.add = function (...args) {\n add.apply(this, args);\n return this;\n };\n}\n\nconst frozen = {};\nif (typeof Object.freeze === 'function') {\n Object.freeze(frozen);\n}\n\ntry {\n // If non-extensible objects can't be stored as keys in a Map, make sure we\n // do not freeze/seal/etc. an object without first attempting to put it in a\n // Map. For example, this gives the React Native Map polyfill a chance to tag\n // objects before they become non-extensible:\n // https://github.com/facebook/react-native/blob/98a6f19d7c/Libraries/vendor/core/Map.js#L44-L50\n // https://github.com/apollographql/react-apollo/issues/2442#issuecomment-426489517\n testMap.set(frozen, frozen).delete(frozen);\n} catch {\n const wrap = (method: (obj: T) => T): typeof method => {\n return method && (obj => {\n try {\n // If .set succeeds, also call .delete to avoid leaking memory.\n testMap.set(obj, obj).delete(obj);\n } finally {\n // If .set or .delete fails, the exception will be silently swallowed\n // by this return-from-finally statement:\n return method.call(Object, obj);\n }\n });\n };\n Object.freeze = wrap(Object.freeze);\n Object.seal = wrap(Object.seal);\n Object.preventExtensions = wrap(Object.preventExtensions);\n}\n\nexport {}\n","import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // XXX here we reach an issue - we don't know if this fragment should match or not. It's either:\n // 1. A fragment on a non-matching concrete type or interface or union\n // 2. A fragment on a matching interface or union\n // If it's 1, we don't want to return anything, if it's 2 we want to match. We can't tell the\n // difference, so we warn the user, but still try to match it (backcompat).\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (implementingTypes && implementingTypes.indexOf(__typename) > -1) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((\n dataId: string,\n ) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n }\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (! hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n};\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType {\n const optsPatch = { returnPartialData: false };\n\n return this.diffQueryAgainstStore({\n ...options,\n ...optsPatch,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: (config && config.dataIdFromObject) || null,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition = fragment.typeCondition.name.value;\n\n const match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] = null;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop().result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] = null;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n return toIdValue({\n id: context.dataIdFromObject(storeObj),\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n public get(dataId: string) {\n return this.data[dataId];\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document);\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n previousResult: options.previousResult,\n config: this.config,\n });\n }\n\n public write(write: Cache.WriteOptions): void {\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction: this.config.fragmentMatcher.match,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop();\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts new file mode 100644 index 000000000..8f285a231 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts @@ -0,0 +1,14 @@ +import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; +export declare class DepTrackingCache implements NormalizedCache { + private data; + private depend; + constructor(data?: NormalizedCacheObject); + toObject(): NormalizedCacheObject; + get(dataId: string): StoreObject; + set(dataId: string, value: StoreObject): void; + delete(dataId: string): void; + clear(): void; + replace(newData: NormalizedCacheObject): void; +} +export declare function defaultNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; +//# sourceMappingURL=depTrackingCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map new file mode 100644 index 000000000..1354f0a93 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"depTrackingCache.d.ts","sourceRoot":"","sources":["src/depTrackingCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK9E,qBAAa,gBAAiB,YAAW,eAAe;IAK1C,OAAO,CAAC,IAAI;IAFxB,OAAO,CAAC,MAAM,CAAmD;gBAE7C,IAAI,GAAE,qBAA2C;IAW9D,QAAQ,IAAI,qBAAqB;IAIjC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAKhC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW;IAQtC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO5B,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;CAgBrD;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js new file mode 100644 index 000000000..d14a281a6 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var optimism_1 = require("optimism"); +var hasOwn = Object.prototype.hasOwnProperty; +var DepTrackingCache = (function () { + function DepTrackingCache(data) { + var _this = this; + if (data === void 0) { data = Object.create(null); } + this.data = data; + this.depend = optimism_1.wrap(function (dataId) { return _this.data[dataId]; }, { + disposable: true, + makeCacheKey: function (dataId) { + return dataId; + } + }); + } + DepTrackingCache.prototype.toObject = function () { + return this.data; + }; + DepTrackingCache.prototype.get = function (dataId) { + this.depend(dataId); + return this.data[dataId]; + }; + DepTrackingCache.prototype.set = function (dataId, value) { + var oldValue = this.data[dataId]; + if (value !== oldValue) { + this.data[dataId] = value; + this.depend.dirty(dataId); + } + }; + DepTrackingCache.prototype.delete = function (dataId) { + if (hasOwn.call(this.data, dataId)) { + delete this.data[dataId]; + this.depend.dirty(dataId); + } + }; + DepTrackingCache.prototype.clear = function () { + this.replace(null); + }; + DepTrackingCache.prototype.replace = function (newData) { + var _this = this; + if (newData) { + Object.keys(newData).forEach(function (dataId) { + _this.set(dataId, newData[dataId]); + }); + Object.keys(this.data).forEach(function (dataId) { + if (!hasOwn.call(newData, dataId)) { + _this.delete(dataId); + } + }); + } + else { + Object.keys(this.data).forEach(function (dataId) { + _this.delete(dataId); + }); + } + }; + return DepTrackingCache; +}()); +exports.DepTrackingCache = DepTrackingCache; +function defaultNormalizedCacheFactory(seed) { + return new DepTrackingCache(seed); +} +exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory; +//# sourceMappingURL=depTrackingCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map new file mode 100644 index 000000000..33299bc23 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"depTrackingCache.js","sourceRoot":"","sources":["../src/depTrackingCache.ts"],"names":[],"mappings":";;AACA,qCAA2D;AAE3D,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAE/C;IAKE,0BAAoB,IAAiD;QAArE,iBASC;QATmB,qBAAA,EAAA,OAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAAjD,SAAI,GAAJ,IAAI,CAA6C;QACnE,IAAI,CAAC,MAAM,GAAG,eAAI,CAAC,UACjB,MAAc,IACX,OAAA,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAjB,CAAiB,EAAE;YACtB,UAAU,EAAE,IAAI;YAChB,YAAY,EAAZ,UAAa,MAAc;gBACzB,OAAO,MAAM,CAAC;YAChB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,mCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,8BAAG,GAAV,UAAW,MAAc;QACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEM,8BAAG,GAAV,UAAW,MAAc,EAAE,KAAkB;QAC3C,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,QAAQ,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC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/apollo-cache-inmemory/lib/fixPolyfills.d.ts b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts new file mode 100644 index 000000000..3dba080c3 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=fixPolyfills.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map new file mode 100644 index 000000000..3a65eb411 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fixPolyfills.d.ts","sourceRoot":"","sources":["src/fixPolyfills.ts"],"names":[],"mappings":"AAoDA,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js new file mode 100644 index 000000000..4a686ea43 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var testMap = new Map(); +if (testMap.set(1, 2) !== testMap) { + var set_1 = testMap.set; + Map.prototype.set = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + set_1.apply(this, args); + return this; + }; +} +var testSet = new Set(); +if (testSet.add(3) !== testSet) { + var add_1 = testSet.add; + Set.prototype.add = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + add_1.apply(this, args); + return this; + }; +} +var frozen = {}; +if (typeof Object.freeze === 'function') { + Object.freeze(frozen); +} +try { + testMap.set(frozen, frozen).delete(frozen); +} +catch (_a) { + var wrap = function (method) { + return method && (function (obj) { + try { + testMap.set(obj, obj).delete(obj); + } + finally { + return method.call(Object, obj); + } + }); + }; + Object.freeze = wrap(Object.freeze); + Object.seal = wrap(Object.seal); + Object.preventExtensions = wrap(Object.preventExtensions); +} +//# sourceMappingURL=fixPolyfills.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map new file mode 100644 index 000000000..b5c30353b --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fixPolyfills.js","sourceRoot":"","sources":["../src/fixPolyfills.ts"],"names":[],"mappings":";;AAEA,IAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;AAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,EAAE;IACzB,IAAA,mBAAG,CAAa;IACxB,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG;QAAU,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACnC,KAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;CACH;AAGD,IAAM,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;AAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;IACtB,IAAA,mBAAG,CAAa;IACxB,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG;QAAU,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QACnC,KAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;CACH;AAED,IAAM,MAAM,GAAG,EAAE,CAAC;AAClB,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE;IACvC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,IAAI;IAOF,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CAC5C;AAAC,WAAM;IACN,IAAM,IAAI,GAAG,UAAC,MAAwB;QACpC,OAAO,MAAM,IAAI,CAAC,UAAA,GAAG;YACnB,IAAI;gBAEF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aACnC;oBAAS;gBAGR,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAC3D"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts new file mode 100644 index 000000000..1b8ee5ace --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts @@ -0,0 +1,18 @@ +import { IdValue } from 'apollo-utilities'; +import { ReadStoreContext, FragmentMatcherInterface, IntrospectionResultData } from './types'; +export declare class HeuristicFragmentMatcher implements FragmentMatcherInterface { + constructor(); + ensureReady(): Promise; + canBypassInit(): boolean; + match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean | 'heuristic'; +} +export declare class IntrospectionFragmentMatcher implements FragmentMatcherInterface { + private isReady; + private possibleTypesMap; + constructor(options?: { + introspectionQueryResultData?: IntrospectionResultData; + }); + match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean; + private parseIntrospectionResult; +} +//# sourceMappingURL=fragmentMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map new file mode 100644 index 000000000..17391bbb5 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcher.d.ts","sourceRoot":"","sources":["src/fragmentMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EAExB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAgBjB,qBAAa,wBAAyB,YAAW,wBAAwB;;IAKhE,WAAW;IAIX,aAAa;IAIb,KAAK,CACV,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,GAAG,WAAW;CAoDzB;AAED,qBAAa,4BAA6B,YAAW,wBAAwB;IAC3E,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,CAAC,EAAE;QACpB,4BAA4B,CAAC,EAAE,uBAAuB,CAAC;KACxD;IAaM,KAAK,CACV,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB;IAoC3B,OAAO,CAAC,wBAAwB;CAajC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js new file mode 100644 index 000000000..78bfec833 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var apollo_utilities_1 = require("apollo-utilities"); +var ts_invariant_1 = require("ts-invariant"); +var haveWarned = false; +function shouldWarn() { + var answer = !haveWarned; + if (!apollo_utilities_1.isTest()) { + haveWarned = true; + } + return answer; +} +var HeuristicFragmentMatcher = (function () { + function HeuristicFragmentMatcher() { + } + HeuristicFragmentMatcher.prototype.ensureReady = function () { + return Promise.resolve(); + }; + HeuristicFragmentMatcher.prototype.canBypassInit = function () { + return true; + }; + HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + if (!obj) { + return isRootQuery; + } + var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + if (!__typename) { + if (shouldWarn()) { + ts_invariant_1.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); + ts_invariant_1.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); + ts_invariant_1.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); + } + return 'heuristic'; + } + if (__typename === typeCondition) { + return true; + } + if (shouldWarn()) { + ts_invariant_1.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + + 'queries contain union or interface types. Apollo Client will not be ' + + 'able to accurately map fragments. To make this error go away, use ' + + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); + } + return 'heuristic'; + }; + return HeuristicFragmentMatcher; +}()); +exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; +var IntrospectionFragmentMatcher = (function () { + function IntrospectionFragmentMatcher(options) { + if (options && options.introspectionQueryResultData) { + this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); + this.isReady = true; + } + else { + this.isReady = false; + } + this.match = this.match.bind(this); + } + IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { + ts_invariant_1.invariant(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); + var obj = context.store.get(idValue.id); + var isRootQuery = idValue.id === 'ROOT_QUERY'; + if (!obj) { + return isRootQuery; + } + var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; + ts_invariant_1.invariant(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); + if (__typename === typeCondition) { + return true; + } + var implementingTypes = this.possibleTypesMap[typeCondition]; + if (implementingTypes && implementingTypes.indexOf(__typename) > -1) { + return true; + } + return false; + }; + IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { + var typeMap = {}; + introspectionResultData.__schema.types.forEach(function (type) { + if (type.kind === 'UNION' || type.kind === 'INTERFACE') { + typeMap[type.name] = type.possibleTypes.map(function (implementingType) { return implementingType.name; }); + } + }); + return typeMap; + }; + return IntrospectionFragmentMatcher; +}()); +exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; +//# sourceMappingURL=fragmentMatcher.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map new file mode 100644 index 000000000..9a2fd4d0c --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcher.js","sourceRoot":"","sources":["../src/fragmentMatcher.ts"],"names":[],"mappings":";;AAAA,qDAAmD;AACnD,6CAAyC;AASzC,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,SAAS,UAAU;IACjB,IAAM,MAAM,GAAG,CAAC,UAAU,CAAC;IAE3B,IAAI,CAAC,yBAAM,EAAE,EAAE;QACb,UAAU,GAAG,IAAI,CAAC;KACnB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAKD;IACE;IAEA,CAAC;IAEM,8CAAW,GAAlB;QACE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEM,gDAAa,GAApB;QACE,OAAO,IAAI,CAAC;IACd,CAA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C;IACH,mCAAC;AAAD,CAAC,AAvED,IAuEC;AAvEY,oEAA4B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts new file mode 100644 index 000000000..4946cffbf --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts @@ -0,0 +1,3 @@ +declare const query: any; +export default query; +//# sourceMappingURL=fragmentMatcherIntrospectionQuery.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map new file mode 100644 index 000000000..58ba5cdb8 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcherIntrospectionQuery.d.ts","sourceRoot":"","sources":["src/fragmentMatcherIntrospectionQuery.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK,EAAE,GA8FZ,CAAC;AAEF,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js new file mode 100644 index 000000000..c591b414e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var query = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__schema', + }, + arguments: [], + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: 'types', + }, + arguments: [], + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: 'kind', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: 'name', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: 'possibleTypes', + }, + arguments: [], + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: 'name', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +}; +exports.default = query; +//# sourceMappingURL=fragmentMatcherIntrospectionQuery.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map new file mode 100644 index 000000000..d64dd3a1d --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fragmentMatcherIntrospectionQuery.js","sourceRoot":"","sources":["../src/fragmentMatcherIntrospectionQuery.ts"],"names":[],"mappings":";;AAAA,IAAM,KAAK,GAAQ;IACjB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE;QACX;YACE,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,OAAO;YAClB,IAAI,EAAE,IAAI;YACV,mBAAmB,EAAE,IAAI;YACzB,UAAU,EAAE,EAAE;YACd,YAAY,EAAE;gBACZ,IAAI,EAAE,cAAc;gBACpB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,IAAI;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,UAAU;yBAClB;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;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts new file mode 100644 index 000000000..5c7f743ea --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts @@ -0,0 +1,46 @@ +import './fixPolyfills'; +import { DocumentNode } from 'graphql'; +import { Cache, ApolloCache, Transaction } from 'apollo-cache'; +import { ApolloReducerConfig, NormalizedCache, NormalizedCacheObject } from './types'; +import { ObjectCache } from './objectCache'; +export interface InMemoryCacheConfig extends ApolloReducerConfig { + resultCaching?: boolean; + freezeResults?: boolean; +} +export declare function defaultDataIdFromObject(result: any): string | null; +export declare class OptimisticCacheLayer extends ObjectCache { + readonly optimisticId: string; + readonly parent: NormalizedCache; + readonly transaction: Transaction; + constructor(optimisticId: string, parent: NormalizedCache, transaction: Transaction); + toObject(): NormalizedCacheObject; + get(dataId: string): import("./types").StoreObject; +} +export declare class InMemoryCache extends ApolloCache { + private data; + private optimisticData; + protected config: InMemoryCacheConfig; + private watches; + private addTypename; + private typenameDocumentCache; + private storeReader; + private storeWriter; + private cacheKeyRoot; + private silenceBroadcast; + constructor(config?: InMemoryCacheConfig); + restore(data: NormalizedCacheObject): this; + extract(optimistic?: boolean): NormalizedCacheObject; + read(options: Cache.ReadOptions): T | null; + write(write: Cache.WriteOptions): void; + diff(query: Cache.DiffOptions): Cache.DiffResult; + watch(watch: Cache.WatchOptions): () => void; + evict(query: Cache.EvictOptions): Cache.EvictionResult; + reset(): Promise; + removeOptimistic(idToRemove: string): void; + performTransaction(transaction: Transaction, optimisticId?: string): void; + recordOptimisticTransaction(transaction: Transaction, id: string): void; + transformDocument(document: DocumentNode): DocumentNode; + protected broadcastWatches(): void; + private maybeBroadcastWatch; +} +//# sourceMappingURL=inMemoryCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map new file mode 100644 index 000000000..9773e9bbd --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryCache.d.ts","sourceRoot":"","sources":["src/inMemoryCache.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAS/D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAMjB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAUD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAUlE;AAID,qBAAa,oBAAqB,SAAQ,WAAW;aAEjC,YAAY,EAAE,MAAM;aAGpB,MAAM,EAAE,eAAe;aACvB,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC;gBAJ/C,YAAY,EAAE,MAAM,EAGpB,MAAM,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC;IAK1D,QAAQ,IAAI,qBAAqB;IAUjC,GAAG,CAAC,MAAM,EAAE,MAAM;CAK1B;AAED,qBAAa,aAAc,SAAQ,WAAW,CAAC,qBAAqB,CAAC;IACnE,OAAO,CAAC,IAAI,CAAkB;IAC9B,OAAO,CAAC,cAAc,CAAkB;IAExC,SAAS,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACtC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,qBAAqB,CAAyC;IACtE,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,YAAY,CAAsC;IAI1D,OAAO,CAAC,gBAAgB,CAAkB;gBAE9B,MAAM,GAAE,mBAAwB;IAyErC,OAAO,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI;IAK1C,OAAO,CAAC,UAAU,GAAE,OAAe,GAAG,qBAAqB;IAI3D,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI;IAiB7C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI;IActC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAYtD,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,IAAI;IAQ5C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,cAAc;IAItD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,gBAAgB,CAAC,UAAU,EAAE,MAAM;IA6BnC,kBAAkB,CACvB,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC,EAI/C,YAAY,CAAC,EAAE,MAAM;IA6BhB,2BAA2B,CAChC,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC,EAC/C,EAAE,EAAE,MAAM;IAKL,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY;IAgB9D,SAAS,CAAC,gBAAgB;IAQ1B,OAAO,CAAC,mBAAmB;CAU5B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js new file mode 100644 index 000000000..f3120d3f6 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js @@ -0,0 +1,233 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +require("./fixPolyfills"); +var apollo_cache_1 = require("apollo-cache"); +var apollo_utilities_1 = require("apollo-utilities"); +var optimism_1 = require("optimism"); +var ts_invariant_1 = require("ts-invariant"); +var fragmentMatcher_1 = require("./fragmentMatcher"); +var readFromStore_1 = require("./readFromStore"); +var writeToStore_1 = require("./writeToStore"); +var depTrackingCache_1 = require("./depTrackingCache"); +var optimism_2 = require("optimism"); +var objectCache_1 = require("./objectCache"); +var defaultConfig = { + fragmentMatcher: new fragmentMatcher_1.HeuristicFragmentMatcher(), + dataIdFromObject: defaultDataIdFromObject, + addTypename: true, + resultCaching: true, + freezeResults: false, +}; +function defaultDataIdFromObject(result) { + if (result.__typename) { + if (result.id !== undefined) { + return result.__typename + ":" + result.id; + } + if (result._id !== undefined) { + return result.__typename + ":" + result._id; + } + } + return null; +} +exports.defaultDataIdFromObject = defaultDataIdFromObject; +var hasOwn = Object.prototype.hasOwnProperty; +var OptimisticCacheLayer = (function (_super) { + tslib_1.__extends(OptimisticCacheLayer, _super); + function OptimisticCacheLayer(optimisticId, parent, transaction) { + var _this = _super.call(this, Object.create(null)) || this; + _this.optimisticId = optimisticId; + _this.parent = parent; + _this.transaction = transaction; + return _this; + } + OptimisticCacheLayer.prototype.toObject = function () { + return tslib_1.__assign({}, this.parent.toObject(), this.data); + }; + OptimisticCacheLayer.prototype.get = function (dataId) { + return hasOwn.call(this.data, dataId) + ? this.data[dataId] + : this.parent.get(dataId); + }; + return OptimisticCacheLayer; +}(objectCache_1.ObjectCache)); +exports.OptimisticCacheLayer = OptimisticCacheLayer; +var InMemoryCache = (function (_super) { + tslib_1.__extends(InMemoryCache, _super); + function InMemoryCache(config) { + if (config === void 0) { config = {}; } + var _this = _super.call(this) || this; + _this.watches = new Set(); + _this.typenameDocumentCache = new Map(); + _this.cacheKeyRoot = new optimism_2.KeyTrie(apollo_utilities_1.canUseWeakMap); + _this.silenceBroadcast = false; + _this.config = tslib_1.__assign({}, defaultConfig, config); + if (_this.config.customResolvers) { + ts_invariant_1.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.customResolvers; + } + if (_this.config.cacheResolvers) { + ts_invariant_1.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); + _this.config.cacheRedirects = _this.config.cacheResolvers; + } + _this.addTypename = _this.config.addTypename; + _this.data = _this.config.resultCaching + ? new depTrackingCache_1.DepTrackingCache() + : new objectCache_1.ObjectCache(); + _this.optimisticData = _this.data; + _this.storeWriter = new writeToStore_1.StoreWriter(); + _this.storeReader = new readFromStore_1.StoreReader({ + cacheKeyRoot: _this.cacheKeyRoot, + freezeResults: config.freezeResults, + }); + var cache = _this; + var maybeBroadcastWatch = cache.maybeBroadcastWatch; + _this.maybeBroadcastWatch = optimism_1.wrap(function (c) { + return maybeBroadcastWatch.call(_this, c); + }, { + makeCacheKey: function (c) { + if (c.optimistic) { + return; + } + if (c.previousResult) { + return; + } + if (cache.data instanceof depTrackingCache_1.DepTrackingCache) { + return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); + } + } + }); + return _this; + } + InMemoryCache.prototype.restore = function (data) { + if (data) + this.data.replace(data); + return this; + }; + InMemoryCache.prototype.extract = function (optimistic) { + if (optimistic === void 0) { optimistic = false; } + return (optimistic ? this.optimisticData : this.data).toObject(); + }; + InMemoryCache.prototype.read = function (options) { + if (typeof options.rootId === 'string' && + typeof this.data.get(options.rootId) === 'undefined') { + return null; + } + return this.storeReader.readQueryFromStore({ + store: options.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(options.query), + variables: options.variables, + rootId: options.rootId, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + previousResult: options.previousResult, + config: this.config, + }); + }; + InMemoryCache.prototype.write = function (write) { + this.storeWriter.writeResultToStore({ + dataId: write.dataId, + result: write.result, + variables: write.variables, + document: this.transformDocument(write.query), + store: this.data, + dataIdFromObject: this.config.dataIdFromObject, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + }); + this.broadcastWatches(); + }; + InMemoryCache.prototype.diff = function (query) { + return this.storeReader.diffQueryAgainstStore({ + store: query.optimistic ? this.optimisticData : this.data, + query: this.transformDocument(query.query), + variables: query.variables, + returnPartialData: query.returnPartialData, + previousResult: query.previousResult, + fragmentMatcherFunction: this.config.fragmentMatcher.match, + config: this.config, + }); + }; + InMemoryCache.prototype.watch = function (watch) { + var _this = this; + this.watches.add(watch); + return function () { + _this.watches.delete(watch); + }; + }; + InMemoryCache.prototype.evict = function (query) { + throw new ts_invariant_1.InvariantError("eviction is not implemented on InMemory Cache"); + }; + InMemoryCache.prototype.reset = function () { + this.data.clear(); + this.broadcastWatches(); + return Promise.resolve(); + }; + InMemoryCache.prototype.removeOptimistic = function (idToRemove) { + var toReapply = []; + var removedCount = 0; + var layer = this.optimisticData; + while (layer instanceof OptimisticCacheLayer) { + if (layer.optimisticId === idToRemove) { + ++removedCount; + } + else { + toReapply.push(layer); + } + layer = layer.parent; + } + if (removedCount > 0) { + this.optimisticData = layer; + while (toReapply.length > 0) { + var layer_1 = toReapply.pop(); + this.performTransaction(layer_1.transaction, layer_1.optimisticId); + } + this.broadcastWatches(); + } + }; + InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { + var _a = this, data = _a.data, silenceBroadcast = _a.silenceBroadcast; + this.silenceBroadcast = true; + if (typeof optimisticId === 'string') { + this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); + } + try { + transaction(this); + } + finally { + this.silenceBroadcast = silenceBroadcast; + this.data = data; + } + this.broadcastWatches(); + }; + InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { + return this.performTransaction(transaction, id); + }; + InMemoryCache.prototype.transformDocument = function (document) { + if (this.addTypename) { + var result = this.typenameDocumentCache.get(document); + if (!result) { + result = apollo_utilities_1.addTypenameToDocument(document); + this.typenameDocumentCache.set(document, result); + this.typenameDocumentCache.set(result, result); + } + return result; + } + return document; + }; + InMemoryCache.prototype.broadcastWatches = function () { + var _this = this; + if (!this.silenceBroadcast) { + this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c); }); + } + }; + InMemoryCache.prototype.maybeBroadcastWatch = function (c) { + c.callback(this.diff({ + query: c.query, + variables: c.variables, + previousResult: c.previousResult && c.previousResult(), + optimistic: c.optimistic, + })); + }; + return InMemoryCache; +}(apollo_cache_1.ApolloCache)); +exports.InMemoryCache = InMemoryCache; +//# sourceMappingURL=inMemoryCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map new file mode 100644 index 000000000..7b9ebc207 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"inMemoryCache.js","sourceRoot":"","sources":["../src/inMemoryCache.ts"],"names":[],"mappings":";;;AACA,0BAAwB;AAIxB,6CAA+D;AAE/D,qDAAwE;AAExE,qCAAgC;AAEhC,6CAAyD;AAEzD,qDAA6D;AAO7D,iDAA8C;AAC9C,+CAA6C;AAC7C,uDAAsD;AACtD,qCAAmC;AACnC,6CAA4C;AAO5C,IAAM,aAAa,GAAwB;IACzC,eAAe,EAAE,IAAI,0CAAwB,EAAE;IAC/C,gBAAgB,EAAE,uBAAuB;IACzC,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,SAAgB,uBAAuB,CAAC,MAAW;IACjD,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE;YAC3B,OAAU,MAAM,CAAC,UAAU,SAAI,MAAM,CAAC,EAAI,CAAC;SAC5C;QAC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,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE;YACtD,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CACH,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAxQD,CAAmC,0BAAW,GAwQ7C;AAxQY,sCAAa"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.d.ts b/node_modules/apollo-cache-inmemory/lib/index.d.ts new file mode 100644 index 000000000..dbc18441d --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/index.d.ts @@ -0,0 +1,7 @@ +export { InMemoryCache, InMemoryCacheConfig, defaultDataIdFromObject, } from './inMemoryCache'; +export * from './readFromStore'; +export * from './writeToStore'; +export * from './fragmentMatcher'; +export * from './objectCache'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.d.ts.map b/node_modules/apollo-cache-inmemory/lib/index.d.ts.map new file mode 100644 index 000000000..111c29e6e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.js b/node_modules/apollo-cache-inmemory/lib/index.js new file mode 100644 index 000000000..a4343949e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/index.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var inMemoryCache_1 = require("./inMemoryCache"); +exports.InMemoryCache = inMemoryCache_1.InMemoryCache; +exports.defaultDataIdFromObject = inMemoryCache_1.defaultDataIdFromObject; +tslib_1.__exportStar(require("./readFromStore"), exports); +tslib_1.__exportStar(require("./writeToStore"), exports); +tslib_1.__exportStar(require("./fragmentMatcher"), exports); +tslib_1.__exportStar(require("./objectCache"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.js.map b/node_modules/apollo-cache-inmemory/lib/index.js.map new file mode 100644 index 000000000..96285b26e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAHvB,wCAAA,aAAa,CAAA;AAEb,kDAAA,uBAAuB,CAAA;AAGzB,0DAAgC;AAChC,yDAA+B;AAC/B,4DAAkC;AAClC,wDAA8B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts new file mode 100644 index 000000000..cc9b7aadd --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts @@ -0,0 +1,13 @@ +import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; +export declare class MapCache implements NormalizedCache { + private cache; + constructor(data?: NormalizedCacheObject); + get(dataId: string): StoreObject; + set(dataId: string, value: StoreObject): void; + delete(dataId: string): void; + clear(): void; + toObject(): NormalizedCacheObject; + replace(newData: NormalizedCacheObject): void; +} +export declare function mapNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; +//# sourceMappingURL=mapCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map new file mode 100644 index 000000000..b36f0ec6a --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mapCache.d.ts","sourceRoot":"","sources":["src/mapCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM9E,qBAAa,QAAS,YAAW,eAAe;IAC9C,OAAO,CAAC,KAAK,CAA2B;gBAE5B,IAAI,GAAE,qBAA0B;IAIrC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAIhC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI;IAI7C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,IAAI,IAAI;IAIb,QAAQ,IAAI,qBAAqB;IAQjC,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;CAMrD;AAED,wBAAgB,yBAAyB,CACvC,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.js b/node_modules/apollo-cache-inmemory/lib/mapCache.js new file mode 100644 index 000000000..f3f870e2e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/mapCache.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MapCache = (function () { + function MapCache(data) { + if (data === void 0) { data = {}; } + this.cache = new Map(Object.entries(data)); + } + MapCache.prototype.get = function (dataId) { + return this.cache.get("" + dataId); + }; + MapCache.prototype.set = function (dataId, value) { + this.cache.set("" + dataId, value); + }; + MapCache.prototype.delete = function (dataId) { + this.cache.delete("" + dataId); + }; + MapCache.prototype.clear = function () { + return this.cache.clear(); + }; + MapCache.prototype.toObject = function () { + var obj = {}; + this.cache.forEach(function (dataId, key) { + obj[key] = dataId; + }); + return obj; + }; + MapCache.prototype.replace = function (newData) { + var _this = this; + this.cache.clear(); + Object.entries(newData).forEach(function (_a) { + var dataId = _a[0], value = _a[1]; + return _this.cache.set(dataId, value); + }); + }; + return MapCache; +}()); +exports.MapCache = MapCache; +function mapNormalizedCacheFactory(seed) { + return new MapCache(seed); +} +exports.mapNormalizedCacheFactory = mapNormalizedCacheFactory; +//# sourceMappingURL=mapCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.js.map b/node_modules/apollo-cache-inmemory/lib/mapCache.js.map new file mode 100644 index 000000000..d1f93e557 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/mapCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mapCache.js","sourceRoot":"","sources":["../src/mapCache.ts"],"names":[],"mappings":";;AAMA;IAGE,kBAAY,IAAgC;QAAhC,qBAAA,EAAA,SAAgC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;IAEM,sBAAG,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAG,MAAQ,CAAC,CAAC;IACrC,CAAC;IAEM,sBAAG,GAAV,UAAW,MAAc,EAAE,KAAkB;QAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAG,MAAQ,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAEM,yBAAM,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAG,MAAQ,CAAC,CAAC;IACjC,CAAC;IAEM,wBAAK,GAAZ;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAEM,2BAAQ,GAAf;QACE,IAAM,GAAG,GAA0B,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,GAAG;YAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,0BAAO,GAAd,UAAe,OAA8B;QAA7C,iBAKC;QAJC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAC,EAAe;gBAAd,cAAM,EAAE,aAAK;YAC7C,OAAA,KAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;QAA7B,CAA6B,CAC9B,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AArCD,IAqCC;AArCY,4BAAQ;AAuCrB,SAAgB,yBAAyB,CACvC,IAA4B;IAE5B,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAJD,8DAIC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts new file mode 100644 index 000000000..a3bb8f599 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts @@ -0,0 +1,13 @@ +import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; +export declare class ObjectCache implements NormalizedCache { + protected data: NormalizedCacheObject; + constructor(data?: NormalizedCacheObject); + toObject(): NormalizedCacheObject; + get(dataId: string): StoreObject; + set(dataId: string, value: StoreObject): void; + delete(dataId: string): void; + clear(): void; + replace(newData: NormalizedCacheObject): void; +} +export declare function defaultNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; +//# sourceMappingURL=objectCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map new file mode 100644 index 000000000..87d7af509 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectCache.d.ts","sourceRoot":"","sources":["src/objectCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9E,qBAAa,WAAY,YAAW,eAAe;IACrC,SAAS,CAAC,IAAI,EAAE,qBAAqB;gBAA3B,IAAI,GAAE,qBAA2C;IAEhE,QAAQ;IAGR,GAAG,CAAC,MAAM,EAAE,MAAM;IAIlB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW;IAItC,MAAM,CAAC,MAAM,EAAE,MAAM;IAIrB,KAAK;IAIL,OAAO,CAAC,OAAO,EAAE,qBAAqB;CAG9C;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.js b/node_modules/apollo-cache-inmemory/lib/objectCache.js new file mode 100644 index 000000000..f55bac8d4 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/objectCache.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ObjectCache = (function () { + function ObjectCache(data) { + if (data === void 0) { data = Object.create(null); } + this.data = data; + } + ObjectCache.prototype.toObject = function () { + return this.data; + }; + ObjectCache.prototype.get = function (dataId) { + return this.data[dataId]; + }; + ObjectCache.prototype.set = function (dataId, value) { + this.data[dataId] = value; + }; + ObjectCache.prototype.delete = function (dataId) { + this.data[dataId] = void 0; + }; + ObjectCache.prototype.clear = function () { + this.data = Object.create(null); + }; + ObjectCache.prototype.replace = function (newData) { + this.data = newData || Object.create(null); + }; + return ObjectCache; +}()); +exports.ObjectCache = ObjectCache; +function defaultNormalizedCacheFactory(seed) { + return new ObjectCache(seed); +} +exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory; +//# sourceMappingURL=objectCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.js.map b/node_modules/apollo-cache-inmemory/lib/objectCache.js.map new file mode 100644 index 000000000..ea2a3ab01 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/objectCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"objectCache.js","sourceRoot":"","sources":["../src/objectCache.ts"],"names":[],"mappings":";;AAEA;IACE,qBAAsB,IAAiD;QAAjD,qBAAA,EAAA,OAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAAjD,SAAI,GAAJ,IAAI,CAA6C;IAAG,CAAC;IAEpE,8BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACM,yBAAG,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IAEM,yBAAG,GAAV,UAAW,MAAc,EAAE,KAAkB;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IAEM,4BAAM,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7B,CAAC;IAEM,2BAAK,GAAZ;QACE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAEM,6BAAO,GAAd,UAAe,OAA8B;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACH,kBAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,kCAAW;AA2BxB,SAAgB,6BAA6B,CAC3C,IAA4B;IAE5B,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAJD,sEAIC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts new file mode 100644 index 000000000..20056345f --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts @@ -0,0 +1,34 @@ +import { IdValue } from 'apollo-utilities'; +import { Cache } from 'apollo-cache'; +import { ReadStoreContext, DiffQueryAgainstStoreOptions, ReadQueryOptions, StoreObject } from './types'; +import { KeyTrie } from 'optimism'; +export declare type VariableMap = { + [name: string]: any; +}; +export declare type FragmentMatcher = (rootValue: any, typeCondition: string, context: ReadStoreContext) => boolean | 'heuristic'; +export declare type ExecResultMissingField = { + object: StoreObject; + fieldName: string; + tolerable: boolean; +}; +export declare type ExecResult = { + result: R; + missing?: ExecResultMissingField[]; +}; +export interface StoreReaderConfig { + cacheKeyRoot?: KeyTrie; + freezeResults?: boolean; +} +export declare class StoreReader { + private freezeResults; + constructor({ cacheKeyRoot, freezeResults, }?: StoreReaderConfig); + readQueryFromStore(options: ReadQueryOptions): QueryType; + diffQueryAgainstStore({ store, query, variables, previousResult, returnPartialData, rootId, fragmentMatcherFunction, config, }: DiffQueryAgainstStoreOptions): Cache.DiffResult; + private executeStoreQuery; + private executeSelectionSet; + private executeField; + private combineExecResults; + private executeSubSelectedArray; +} +export declare function assertIdValue(idValue: IdValue): void; +//# sourceMappingURL=readFromStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map new file mode 100644 index 000000000..4d496314a --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["src/readFromStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,OAAO,EAYR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,EAChB,WAAW,EACZ,MAAM,SAAS,CAAC;AAUjB,OAAO,EAAQ,OAAO,EAAE,MAAM,UAAU,CAAC;AAIzC,oBAAY,WAAW,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAElD,oBAAY,eAAe,GAAG,CAC5B,SAAS,EAAE,GAAG,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,KACtB,OAAO,GAAG,WAAW,CAAC;AAe3B,oBAAY,sBAAsB,GAAG;IACnC,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,UAAU,CAAC,CAAC,GAAG,GAAG,IAAI;IAChC,MAAM,EAAE,CAAC,CAAC;IAEV,OAAO,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACpC,CAAC;AAuBF,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,aAAa,CAAU;gBAEnB,EACV,YAAiD,EACjD,aAAqB,GACtB,GAAE,iBAAsB;IAqFlB,kBAAkB,CAAC,SAAS,EACjC,OAAO,EAAE,gBAAgB,GACxB,SAAS;IAiBL,qBAAqB,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAwB,EACxB,MAAqB,EACrB,uBAAuB,EACvB,MAAM,GACP,EAAE,4BAA4B,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAwErD,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,mBAAmB;IA2F3B,OAAO,CAAC,YAAY;IA8DpB,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,uBAAuB;CAmDhC;AAmBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,QAK7C"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.js b/node_modules/apollo-cache-inmemory/lib/readFromStore.js new file mode 100644 index 000000000..afc2ee984 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/readFromStore.js @@ -0,0 +1,318 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_utilities_1 = require("apollo-utilities"); +var optimism_1 = require("optimism"); +var depTrackingCache_1 = require("./depTrackingCache"); +var ts_invariant_1 = require("ts-invariant"); +; +var StoreReader = (function () { + function StoreReader(_a) { + var _this = this; + var _b = _a === void 0 ? {} : _a, _c = _b.cacheKeyRoot, cacheKeyRoot = _c === void 0 ? new optimism_1.KeyTrie(apollo_utilities_1.canUseWeakMap) : _c, _d = _b.freezeResults, freezeResults = _d === void 0 ? false : _d; + var _e = this, executeStoreQuery = _e.executeStoreQuery, executeSelectionSet = _e.executeSelectionSet, executeSubSelectedArray = _e.executeSubSelectedArray; + this.freezeResults = freezeResults; + this.executeStoreQuery = optimism_1.wrap(function (options) { + return executeStoreQuery.call(_this, options); + }, { + makeCacheKey: function (_a) { + var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, fragmentMatcher = _a.fragmentMatcher; + if (contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { + return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); + } + } + }); + this.executeSelectionSet = optimism_1.wrap(function (options) { + return executeSelectionSet.call(_this, options); + }, { + makeCacheKey: function (_a) { + var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; + if (execContext.contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); + } + } + }); + this.executeSubSelectedArray = optimism_1.wrap(function (options) { + return executeSubSelectedArray.call(_this, options); + }, { + makeCacheKey: function (_a) { + var field = _a.field, array = _a.array, execContext = _a.execContext; + if (execContext.contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { + return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); + } + } + }); + } + StoreReader.prototype.readQueryFromStore = function (options) { + var optsPatch = { returnPartialData: false }; + return this.diffQueryAgainstStore(tslib_1.__assign({}, options, optsPatch)).result; + }; + StoreReader.prototype.diffQueryAgainstStore = function (_a) { + var store = _a.store, query = _a.query, variables = _a.variables, previousResult = _a.previousResult, _b = _a.returnPartialData, returnPartialData = _b === void 0 ? true : _b, _c = _a.rootId, rootId = _c === void 0 ? 'ROOT_QUERY' : _c, fragmentMatcherFunction = _a.fragmentMatcherFunction, config = _a.config; + var queryDefinition = apollo_utilities_1.getQueryDefinition(query); + variables = apollo_utilities_1.assign({}, apollo_utilities_1.getDefaultValues(queryDefinition), variables); + var context = { + store: store, + dataIdFromObject: (config && config.dataIdFromObject) || null, + cacheRedirects: (config && config.cacheRedirects) || {}, + }; + var execResult = this.executeStoreQuery({ + query: query, + rootValue: { + type: 'id', + id: rootId, + generated: true, + typename: 'Query', + }, + contextValue: context, + variableValues: variables, + fragmentMatcher: fragmentMatcherFunction, + }); + var hasMissingFields = execResult.missing && execResult.missing.length > 0; + if (hasMissingFields && !returnPartialData) { + execResult.missing.forEach(function (info) { + if (info.tolerable) + return; + throw new ts_invariant_1.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); + }); + } + if (previousResult) { + if (apollo_utilities_1.isEqual(previousResult, execResult.result)) { + execResult.result = previousResult; + } + } + return { + result: execResult.result, + complete: !hasMissingFields, + }; + }; + StoreReader.prototype.executeStoreQuery = function (_a) { + var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, _b = _a.fragmentMatcher, fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; + var mainDefinition = apollo_utilities_1.getMainDefinition(query); + var fragments = apollo_utilities_1.getFragmentDefinitions(query); + var fragmentMap = apollo_utilities_1.createFragmentMap(fragments); + var execContext = { + query: query, + fragmentMap: fragmentMap, + contextValue: contextValue, + variableValues: variableValues, + fragmentMatcher: fragmentMatcher, + }; + return this.executeSelectionSet({ + selectionSet: mainDefinition.selectionSet, + rootValue: rootValue, + execContext: execContext, + }); + }; + StoreReader.prototype.executeSelectionSet = function (_a) { + var _this = this; + var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; + var fragmentMap = execContext.fragmentMap, contextValue = execContext.contextValue, variables = execContext.variableValues; + var finalResult = { result: null }; + var objectsToMerge = []; + var object = contextValue.store.get(rootValue.id); + var typename = (object && object.__typename) || + (rootValue.id === 'ROOT_QUERY' && 'Query') || + void 0; + function handleMissing(result) { + var _a; + if (result.missing) { + finalResult.missing = finalResult.missing || []; + (_a = finalResult.missing).push.apply(_a, result.missing); + } + return result.result; + } + selectionSet.selections.forEach(function (selection) { + var _a; + if (!apollo_utilities_1.shouldInclude(selection, variables)) { + return; + } + if (apollo_utilities_1.isField(selection)) { + var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); + if (typeof fieldResult !== 'undefined') { + objectsToMerge.push((_a = {}, + _a[apollo_utilities_1.resultKeyNameFromField(selection)] = fieldResult, + _a)); + } + } + else { + var fragment = void 0; + if (apollo_utilities_1.isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = fragmentMap[selection.name.value]; + if (!fragment) { + throw new ts_invariant_1.InvariantError("No fragment named " + selection.name.value); + } + } + var typeCondition = fragment.typeCondition.name.value; + var match = execContext.fragmentMatcher(rootValue, typeCondition, contextValue); + if (match) { + var fragmentExecResult = _this.executeSelectionSet({ + selectionSet: fragment.selectionSet, + rootValue: rootValue, + execContext: execContext, + }); + if (match === 'heuristic' && fragmentExecResult.missing) { + fragmentExecResult = tslib_1.__assign({}, fragmentExecResult, { missing: fragmentExecResult.missing.map(function (info) { + return tslib_1.__assign({}, info, { tolerable: true }); + }) }); + } + objectsToMerge.push(handleMissing(fragmentExecResult)); + } + } + }); + finalResult.result = apollo_utilities_1.mergeDeepArray(objectsToMerge); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(finalResult.result); + } + return finalResult; + }; + StoreReader.prototype.executeField = function (object, typename, field, execContext) { + var variables = execContext.variableValues, contextValue = execContext.contextValue; + var fieldName = field.name.value; + var args = apollo_utilities_1.argumentsObjectFromField(field, variables); + var info = { + resultKey: apollo_utilities_1.resultKeyNameFromField(field), + directives: apollo_utilities_1.getDirectiveInfoFromField(field, variables), + }; + var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); + if (Array.isArray(readStoreResult.result)) { + return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ + field: field, + array: readStoreResult.result, + execContext: execContext, + })); + } + if (!field.selectionSet) { + assertSelectionSetForIdValue(field, readStoreResult.result); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + apollo_utilities_1.maybeDeepFreeze(readStoreResult); + } + return readStoreResult; + } + if (readStoreResult.result == null) { + return readStoreResult; + } + return this.combineExecResults(readStoreResult, this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: readStoreResult.result, + execContext: execContext, + })); + }; + StoreReader.prototype.combineExecResults = function () { + var execResults = []; + for (var _i = 0; _i < arguments.length; _i++) { + execResults[_i] = arguments[_i]; + } + var missing = null; + execResults.forEach(function (execResult) { + if (execResult.missing) { + missing = missing || []; + missing.push.apply(missing, execResult.missing); + } + }); + return { + result: execResults.pop().result, + missing: missing, + }; + }; + StoreReader.prototype.executeSubSelectedArray = function (_a) { + var _this = this; + var field = _a.field, array = _a.array, execContext = _a.execContext; + var missing = null; + function handleMissing(childResult) { + if (childResult.missing) { + missing = missing || []; + missing.push.apply(missing, childResult.missing); + } + return childResult.result; + } + array = array.map(function (item) { + if (item === null) { + return null; + } + if (Array.isArray(item)) { + return handleMissing(_this.executeSubSelectedArray({ + field: field, + array: item, + execContext: execContext, + })); + } + if (field.selectionSet) { + return handleMissing(_this.executeSelectionSet({ + selectionSet: field.selectionSet, + rootValue: item, + execContext: execContext, + })); + } + assertSelectionSetForIdValue(field, item); + return item; + }); + if (this.freezeResults && process.env.NODE_ENV !== 'production') { + Object.freeze(array); + } + return { result: array, missing: missing }; + }; + return StoreReader; +}()); +exports.StoreReader = StoreReader; +function assertSelectionSetForIdValue(field, value) { + if (!field.selectionSet && apollo_utilities_1.isIdValue(value)) { + throw new ts_invariant_1.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); + } +} +function defaultFragmentMatcher() { + return true; +} +function assertIdValue(idValue) { + ts_invariant_1.invariant(apollo_utilities_1.isIdValue(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); +} +exports.assertIdValue = assertIdValue; +function readStoreResolver(object, typename, fieldName, args, context, _a) { + var resultKey = _a.resultKey, directives = _a.directives; + var storeKeyName = fieldName; + if (args || directives) { + storeKeyName = apollo_utilities_1.getStoreKeyName(storeKeyName, args, directives); + } + var fieldValue = void 0; + if (object) { + fieldValue = object[storeKeyName]; + if (typeof fieldValue === 'undefined' && + context.cacheRedirects && + typeof typename === 'string') { + var type = context.cacheRedirects[typename]; + if (type) { + var resolver = type[fieldName]; + if (resolver) { + fieldValue = resolver(object, args, { + getCacheKey: function (storeObj) { + return apollo_utilities_1.toIdValue({ + id: context.dataIdFromObject(storeObj), + typename: storeObj.__typename, + }); + }, + }); + } + } + } + } + if (typeof fieldValue === 'undefined') { + return { + result: fieldValue, + missing: [{ + object: object, + fieldName: storeKeyName, + tolerable: false, + }], + }; + } + if (apollo_utilities_1.isJsonValue(fieldValue)) { + fieldValue = fieldValue.json; + } + return { + result: fieldValue, + }; +} +//# sourceMappingURL=readFromStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map b/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map new file mode 100644 index 000000000..bd68617db --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"readFromStore.js","sour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CAAC;SACH,CAAC;KACH;IAED,IAAI,8BAAW,CAAC,UAAU,CAAC,EAAE;QAC3B,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;KAC9B;IAED,OAAO;QACL,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.d.ts b/node_modules/apollo-cache-inmemory/lib/types.d.ts new file mode 100644 index 000000000..02e4f5491 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/types.d.ts @@ -0,0 +1,80 @@ +import { DocumentNode } from 'graphql'; +import { FragmentMatcher } from './readFromStore'; +import { Transaction } from 'apollo-cache'; +import { IdValue, StoreValue } from 'apollo-utilities'; +export interface IdGetterObj extends Object { + __typename?: string; + id?: string; +} +export declare type IdGetter = (value: IdGetterObj) => string | null | undefined; +export interface NormalizedCache { + get(dataId: string): StoreObject; + set(dataId: string, value: StoreObject): void; + delete(dataId: string): void; + clear(): void; + toObject(): NormalizedCacheObject; + replace(newData: NormalizedCacheObject): void; +} +export interface NormalizedCacheObject { + [dataId: string]: StoreObject; +} +export interface StoreObject { + __typename?: string; + [storeFieldKey: string]: StoreValue; +} +export declare type OptimisticStoreItem = { + id: string; + data: NormalizedCacheObject; + transaction: Transaction; +}; +export declare type ReadQueryOptions = { + store: NormalizedCache; + query: DocumentNode; + fragmentMatcherFunction?: FragmentMatcher; + variables?: Object; + previousResult?: any; + rootId?: string; + config?: ApolloReducerConfig; +}; +export declare type DiffQueryAgainstStoreOptions = ReadQueryOptions & { + returnPartialData?: boolean; +}; +export declare type ApolloReducerConfig = { + dataIdFromObject?: IdGetter; + fragmentMatcher?: FragmentMatcherInterface; + addTypename?: boolean; + cacheRedirects?: CacheResolverMap; +}; +export declare type ReadStoreContext = { + readonly store: NormalizedCache; + readonly cacheRedirects: CacheResolverMap; + readonly dataIdFromObject?: IdGetter; +}; +export interface FragmentMatcherInterface { + match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean | 'heuristic'; +} +export declare type PossibleTypesMap = { + [key: string]: string[]; +}; +export declare type IntrospectionResultData = { + __schema: { + types: { + kind: string; + name: string; + possibleTypes: { + name: string; + }[]; + }[]; + }; +}; +export declare type CacheResolver = (rootValue: any, args: { + [argName: string]: any; +}, context: any) => any; +export declare type CacheResolverMap = { + [typeName: string]: { + [fieldName: string]: CacheResolver; + }; +}; +export declare type CustomResolver = CacheResolver; +export declare type CustomResolverMap = CacheResolverMap; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.d.ts.map b/node_modules/apollo-cache-inmemory/lib/types.d.ts.map new file mode 100644 index 000000000..d9a2dbf94 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AACD,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,CAC7B,KAAK,EAAE,WAAW,KACf,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAM/B,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,IAAI,IAAI,CAA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AAwB;IACvC,KAAK,CACH,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,GAAG,WAAW,CAAC;CAC1B;AAED,oBAAY,gBAAgB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAC;AAE3D,oBAAY,uBAAuB,GAAG;IACpC,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,aAAa,EAAE;gBACb,IAAI,EAAE,MAAM,CAAC;aACd,EAAE,CAAC;SACL,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,oBAAY,aAAa,GAAG,CAC1B,SAAS,EAAE,GAAG,EACd,IAAI,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAChC,OAAO,EAAE,GAAG,KACT,GAAG,CAAC;AAET,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC;KACpC,CAAC;CACH,CAAC;AAGF,oBAAY,cAAc,GAAG,aAAa,CAAC;AAC3C,oBAAY,iBAAiB,GAAG,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.js b/node_modules/apollo-cache-inmemory/lib/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.js.map b/node_modules/apollo-cache-inmemory/lib/types.js.map new file mode 100644 index 000000000..c768b7900 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts b/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts new file mode 100644 index 000000000..83d54aee9 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts @@ -0,0 +1,46 @@ +import { SelectionSetNode, FieldNode, DocumentNode } from 'graphql'; +import { FragmentMatcher } from './readFromStore'; +import { FragmentMap } from 'apollo-utilities'; +import { IdGetter, NormalizedCache } from './types'; +export declare class WriteError extends Error { + type: string; +} +export declare function enhanceErrorWithDocument(error: Error, document: DocumentNode): WriteError; +export declare type WriteContext = { + readonly store: NormalizedCache; + readonly processedData?: { + [x: string]: FieldNode[]; + }; + readonly variables?: any; + readonly dataIdFromObject?: IdGetter; + readonly fragmentMap?: FragmentMap; + readonly fragmentMatcherFunction?: FragmentMatcher; +}; +export declare class StoreWriter { + writeQueryToStore({ query, result, store, variables, dataIdFromObject, fragmentMatcherFunction, }: { + query: DocumentNode; + result: Object; + store?: NormalizedCache; + variables?: Object; + dataIdFromObject?: IdGetter; + fragmentMatcherFunction?: FragmentMatcher; + }): NormalizedCache; + writeResultToStore({ dataId, result, document, store, variables, dataIdFromObject, fragmentMatcherFunction, }: { + dataId: string; + result: any; + document: DocumentNode; + store?: NormalizedCache; + variables?: Object; + dataIdFromObject?: IdGetter; + fragmentMatcherFunction?: FragmentMatcher; + }): NormalizedCache; + writeSelectionSetToStore({ result, dataId, selectionSet, context, }: { + dataId: string; + result: any; + selectionSet: SelectionSetNode; + context: WriteContext; + }): NormalizedCache; + private writeFieldToStore; + private processArrayValue; +} +//# sourceMappingURL=writeToStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map new file mode 100644 index 000000000..6a8213135 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/writeToStore.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C,EACxB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAuC,EACvC,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GACxB,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,GAAG,CAAC;QACZ,QAAQ,EAAE,YAAY,CAAC;QACvB,KAAK,CAAC,EAAE,eAAe,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;QAC5B,uBAAuB,CAAC,EAAE,eAAe,CAAC;KAC3C,GAAG,eAAe;IA2BZ,wBAAwB,CAAC,EAC9B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,OAAO,GACR,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,GAAG,CAAC;QACZ,YAAY,EAAE,gBAAgB,CAAC;QAC/B,OAAO,EAAE,YAAY,CAAC;KACvB,GAAG,eAAe;IAwGnB,OAAO,CAAC,iBAAiB;IAgJzB,OAAO,CAAC,iBAAiB;CA2C1B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.js b/node_modules/apollo-cache-inmemory/lib/writeToStore.js new file mode 100644 index 000000000..d86181165 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/writeToStore.js @@ -0,0 +1,276 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_utilities_1 = require("apollo-utilities"); +var ts_invariant_1 = require("ts-invariant"); +var objectCache_1 = require("./objectCache"); +var depTrackingCache_1 = require("./depTrackingCache"); +var WriteError = (function (_super) { + tslib_1.__extends(WriteError, _super); + function WriteError() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.type = 'WriteError'; + return _this; + } + return WriteError; +}(Error)); +exports.WriteError = WriteError; +function enhanceErrorWithDocument(error, document) { + var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); + enhancedError.message += '\n' + error.message; + enhancedError.stack = error.stack; + return enhancedError; +} +exports.enhanceErrorWithDocument = enhanceErrorWithDocument; +var StoreWriter = (function () { + function StoreWriter() { + } + StoreWriter.prototype.writeQueryToStore = function (_a) { + var query = _a.query, result = _a.result, _b = _a.store, store = _b === void 0 ? depTrackingCache_1.defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; + return this.writeResultToStore({ + dataId: 'ROOT_QUERY', + result: result, + document: query, + store: store, + variables: variables, + dataIdFromObject: dataIdFromObject, + fragmentMatcherFunction: fragmentMatcherFunction, + }); + }; + StoreWriter.prototype.writeResultToStore = function (_a) { + var dataId = _a.dataId, result = _a.result, document = _a.document, _b = _a.store, store = _b === void 0 ? depTrackingCache_1.defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; + var operationDefinition = apollo_utilities_1.getOperationDefinition(document); + try { + return this.writeSelectionSetToStore({ + result: result, + dataId: dataId, + selectionSet: operationDefinition.selectionSet, + context: { + store: store, + processedData: {}, + variables: apollo_utilities_1.assign({}, apollo_utilities_1.getDefaultValues(operationDefinition), variables), + dataIdFromObject: dataIdFromObject, + fragmentMap: apollo_utilities_1.createFragmentMap(apollo_utilities_1.getFragmentDefinitions(document)), + fragmentMatcherFunction: fragmentMatcherFunction, + }, + }); + } + catch (e) { + throw enhanceErrorWithDocument(e, document); + } + }; + StoreWriter.prototype.writeSelectionSetToStore = function (_a) { + var _this = this; + var result = _a.result, dataId = _a.dataId, selectionSet = _a.selectionSet, context = _a.context; + var variables = context.variables, store = context.store, fragmentMap = context.fragmentMap; + selectionSet.selections.forEach(function (selection) { + var _a; + if (!apollo_utilities_1.shouldInclude(selection, variables)) { + return; + } + if (apollo_utilities_1.isField(selection)) { + var resultFieldKey = apollo_utilities_1.resultKeyNameFromField(selection); + var value = result[resultFieldKey]; + if (typeof value !== 'undefined') { + _this.writeFieldToStore({ + dataId: dataId, + value: value, + field: selection, + context: context, + }); + } + else { + var isDefered = false; + var isClient = false; + if (selection.directives && selection.directives.length) { + isDefered = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'defer'; }); + isClient = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'client'; }); + } + if (!isDefered && !isClient && context.fragmentMatcherFunction) { + ts_invariant_1.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); + } + } + } + else { + var fragment = void 0; + if (apollo_utilities_1.isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = (fragmentMap || {})[selection.name.value]; + ts_invariant_1.invariant(fragment, "No fragment named " + selection.name.value + "."); + } + var matches = true; + if (context.fragmentMatcherFunction && fragment.typeCondition) { + var id = dataId || 'self'; + var idValue = apollo_utilities_1.toIdValue({ id: id, typename: undefined }); + var fakeContext = { + store: new objectCache_1.ObjectCache((_a = {}, _a[id] = result, _a)), + cacheRedirects: {}, + }; + var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); + if (!apollo_utilities_1.isProduction() && match === 'heuristic') { + ts_invariant_1.invariant.error('WARNING: heuristic fragment matching going on!'); + } + matches = !!match; + } + if (matches) { + _this.writeSelectionSetToStore({ + result: result, + selectionSet: fragment.selectionSet, + dataId: dataId, + context: context, + }); + } + } + }); + return store; + }; + StoreWriter.prototype.writeFieldToStore = function (_a) { + var _b; + var field = _a.field, value = _a.value, dataId = _a.dataId, context = _a.context; + var variables = context.variables, dataIdFromObject = context.dataIdFromObject, store = context.store; + var storeValue; + var storeObject; + var storeFieldName = apollo_utilities_1.storeKeyNameFromField(field, variables); + if (!field.selectionSet || value === null) { + storeValue = + value != null && typeof value === 'object' + ? + { type: 'json', json: value } + : + value; + } + else if (Array.isArray(value)) { + var generatedId = dataId + "." + storeFieldName; + storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); + } + else { + var valueDataId = dataId + "." + storeFieldName; + var generated = true; + if (!isGeneratedId(valueDataId)) { + valueDataId = '$' + valueDataId; + } + if (dataIdFromObject) { + var semanticId = dataIdFromObject(value); + ts_invariant_1.invariant(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); + if (semanticId || + (typeof semanticId === 'number' && semanticId === 0)) { + valueDataId = semanticId; + generated = false; + } + } + if (!isDataProcessed(valueDataId, field, context.processedData)) { + this.writeSelectionSetToStore({ + dataId: valueDataId, + result: value, + selectionSet: field.selectionSet, + context: context, + }); + } + var typename = value.__typename; + storeValue = apollo_utilities_1.toIdValue({ id: valueDataId, typename: typename }, generated); + storeObject = store.get(dataId); + var escapedId = storeObject && storeObject[storeFieldName]; + if (escapedId !== storeValue && apollo_utilities_1.isIdValue(escapedId)) { + var hadTypename = escapedId.typename !== undefined; + var hasTypename = typename !== undefined; + var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; + ts_invariant_1.invariant(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + ts_invariant_1.invariant(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); + if (escapedId.generated) { + if (typenameChanged) { + if (!generated) { + store.delete(escapedId.id); + } + } + else { + mergeWithGenerated(escapedId.id, storeValue.id, store); + } + } + } + } + storeObject = store.get(dataId); + if (!storeObject || !apollo_utilities_1.isEqual(storeValue, storeObject[storeFieldName])) { + store.set(dataId, tslib_1.__assign({}, storeObject, (_b = {}, _b[storeFieldName] = storeValue, _b))); + } + }; + StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { + var _this = this; + return value.map(function (item, index) { + if (item === null) { + return null; + } + var itemDataId = generatedId + "." + index; + if (Array.isArray(item)) { + return _this.processArrayValue(item, itemDataId, selectionSet, context); + } + var generated = true; + if (context.dataIdFromObject) { + var semanticId = context.dataIdFromObject(item); + if (semanticId) { + itemDataId = semanticId; + generated = false; + } + } + if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { + _this.writeSelectionSetToStore({ + dataId: itemDataId, + result: item, + selectionSet: selectionSet, + context: context, + }); + } + return apollo_utilities_1.toIdValue({ id: itemDataId, typename: item.__typename }, generated); + }); + }; + return StoreWriter; +}()); +exports.StoreWriter = StoreWriter; +function isGeneratedId(id) { + return id[0] === '$'; +} +function mergeWithGenerated(generatedKey, realKey, cache) { + if (generatedKey === realKey) { + return false; + } + var generated = cache.get(generatedKey); + var real = cache.get(realKey); + var madeChanges = false; + Object.keys(generated).forEach(function (key) { + var value = generated[key]; + var realValue = real[key]; + if (apollo_utilities_1.isIdValue(value) && + isGeneratedId(value.id) && + apollo_utilities_1.isIdValue(realValue) && + !apollo_utilities_1.isEqual(value, realValue) && + mergeWithGenerated(value.id, realValue.id, cache)) { + madeChanges = true; + } + }); + cache.delete(generatedKey); + var newRealValue = tslib_1.__assign({}, generated, real); + if (apollo_utilities_1.isEqual(newRealValue, real)) { + return madeChanges; + } + cache.set(realKey, newRealValue); + return true; +} +function isDataProcessed(dataId, field, processedData) { + if (!processedData) { + return false; + } + if (processedData[dataId]) { + if (processedData[dataId].indexOf(field) >= 0) { + return true; + } + else { + processedData[dataId].push(field); + } + } + else { + processedData[dataId] = [field]; + } + return false; +} +//# sourceMappingURL=writeToStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map b/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map new file mode 100644 index 000000000..31b9af312 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"writeToStore.js","sourceRoot":"","sources":["../src/writeToStore.ts"],"names":[],"mappings":";;;AASA,qDAkB0B;AAE1B,6CAAyC;AAEzC,6CAA4C;AAC5C,uDAAmE;AASnE;IAAgC,sCAA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inmemory/package.json b/node_modules/apollo-cache-inmemory/package.json new file mode 100644 index 000000000..1053218e9 --- /dev/null +++ b/node_modules/apollo-cache-inmemory/package.json @@ -0,0 +1,52 @@ +{ + "name": "apollo-cache-inmemory", + "version": "1.6.2", + "description": "Core abstract of Caching layer for Apollo Client", + "author": "James Baxley ", + "contributors": [ + "James Baxley ", + "Jonas Helfer ", + "Sashko Stubailo ", + "James Burgess ", + "Bazyli Brzóska " + ], + "license": "MIT", + "main": "./lib/bundle.cjs.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": [ + "./lib/fixPolyfills.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-client.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-client/issues" + }, + "homepage": "https://github.com/apollographql/apollo-client#readme", + "scripts": { + "prepare": "npm run build", + "coverage": "jest --coverage", + "test": "tsc -p tsconfig.json --noEmit && jest", + "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts", + "prebuild": "npm run clean", + "build": "tsc -b .", + "postbuild": "npm run bundle", + "bundle": "../../node_modules/rollup/bin/rollup -c rollup.config.js", + "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", + "clean": "rm -rf coverage/* lib/*", + "prepublishOnly": "npm run build" + }, + "dependencies": { + "apollo-cache": "^1.3.2", + "apollo-utilities": "^1.3.2", + "optimism": "^0.9.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "peerDependencies": { + "graphql": "0.11.7 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "gitHead": "656fd9fbcf82df5cd6b9512e4c9b90b808e300ad" +} diff --git a/node_modules/apollo-cache/CHANGELOG.md b/node_modules/apollo-cache/CHANGELOG.md new file mode 100644 index 000000000..c9adb0e2a --- /dev/null +++ b/node_modules/apollo-cache/CHANGELOG.md @@ -0,0 +1,72 @@ +# CHANGELOG + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). + +---- + +### 1.1.12 + +- No changes. + +### 1.1.11 + +- No changes. + +### 1.1.10 + +- Added optional generics to cache manipulation methods (typescript). + [PR #3541](https://github.com/apollographql/apollo-client/pull/3541) + +### 1.1.9 + +- No public facing functionality changes. +- Various internal code cleanup, tooling and dependency changes. + +### 1.1.8 + +- Not documented + +### 1.1.7 + +- Not documented + +### 1.1.6 + +- Improve code coverage +- Map coverage to original source + +### 1.1.3 + +- Dependency updates + +### 1.1.2 + +- Dependency updates + +### 1.1.1 + +- Dependency updates + +### 1.1.0 + +- Add cache.writeData to base cache type & DataProxy + [PR #2818](https://github.com/apollographql/apollo-client/pull/2818) + +### 1.0.3 + +- Dependency updates + +### 1.0.2 + +- Package dependency updates + +### 1.0.1 + +- Improved rollup builds + +### 1.0.0 + +- Initial solid cache API diff --git a/node_modules/apollo-cache/LICENSE b/node_modules/apollo-cache/LICENSE new file mode 100644 index 000000000..278ee9d8c --- /dev/null +++ b/node_modules/apollo-cache/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/apollo-cache/jest.config.js b/node_modules/apollo-cache/jest.config.js new file mode 100644 index 000000000..48f0a891e --- /dev/null +++ b/node_modules/apollo-cache/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../../config/jest.config.settings'), +}; diff --git a/node_modules/apollo-cache/lib/bundle.cjs.js b/node_modules/apollo-cache/lib/bundle.cjs.js new file mode 100644 index 000000000..25b0a4e70 --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.cjs.js @@ -0,0 +1,194 @@ +exports.__esModule = true; +exports.Cache = exports.ApolloCache = void 0; + +var _apolloUtilities = require("apollo-utilities"); + +function queryFromPojo(obj) { + var op = { + kind: 'OperationDefinition', + operation: 'query', + name: { + kind: 'Name', + value: 'GeneratedClientQuery' + }, + selectionSet: selectionSetFromObj(obj) + }; + var out = { + kind: 'Document', + definitions: [op] + }; + return out; +} + +function fragmentFromPojo(obj, typename) { + var frag = { + kind: 'FragmentDefinition', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: typename || '__FakeType' + } + }, + name: { + kind: 'Name', + value: 'GeneratedClientQuery' + }, + selectionSet: selectionSetFromObj(obj) + }; + var out = { + kind: 'Document', + definitions: [frag] + }; + return out; +} + +function selectionSetFromObj(obj) { + if (typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'string' || typeof obj === 'undefined' || obj === null) { + return null; + } + + if (Array.isArray(obj)) { + return selectionSetFromObj(obj[0]); + } + + var selections = []; + Object.keys(obj).forEach(function (key) { + var nestedSelSet = selectionSetFromObj(obj[key]); + var field = { + kind: 'Field', + name: { + kind: 'Name', + value: key + }, + selectionSet: nestedSelSet || undefined + }; + selections.push(field); + }); + var selectionSet = { + kind: 'SelectionSet', + selections: selections + }; + return selectionSet; +} + +var justTypenameQuery = { + kind: 'Document', + definitions: [{ + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [{ + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__typename' + }, + arguments: [], + directives: [], + selectionSet: null + }] + } + }] +}; + +var ApolloCache = function () { + function ApolloCache() {} + + ApolloCache.prototype.transformDocument = function (document) { + return document; + }; + + ApolloCache.prototype.transformForLink = function (document) { + return document; + }; + + ApolloCache.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.read({ + query: options.query, + variables: options.variables, + optimistic: optimistic + }); + }; + + ApolloCache.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.read({ + query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName), + variables: options.variables, + rootId: options.id, + optimistic: optimistic + }); + }; + + ApolloCache.prototype.writeQuery = function (options) { + this.write({ + dataId: 'ROOT_QUERY', + result: options.data, + query: options.query, + variables: options.variables + }); + }; + + ApolloCache.prototype.writeFragment = function (options) { + this.write({ + dataId: options.id, + result: options.data, + variables: options.variables, + query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName) + }); + }; + + ApolloCache.prototype.writeData = function (_a) { + var id = _a.id, + data = _a.data; + + if (typeof id !== 'undefined') { + var typenameResult = null; + + try { + typenameResult = this.read({ + rootId: id, + optimistic: false, + query: justTypenameQuery + }); + } catch (e) {} + + var __typename = typenameResult && typenameResult.__typename || '__ClientData'; + + var dataToWrite = Object.assign({ + __typename: __typename + }, data); + this.writeFragment({ + id: id, + fragment: fragmentFromPojo(dataToWrite, __typename), + data: dataToWrite + }); + } else { + this.writeQuery({ + query: queryFromPojo(data), + data: data + }); + } + }; + + return ApolloCache; +}(); + +exports.ApolloCache = ApolloCache; +var Cache; +exports.Cache = Cache; + +(function (Cache) {})(Cache || (exports.Cache = Cache = {})); diff --git a/node_modules/apollo-cache/lib/bundle.cjs.js.map b/node_modules/apollo-cache/lib/bundle.cjs.js.map new file mode 100644 index 000000000..dee6b9477 --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/utils.ts","../src/cache.ts","../src/types/Cache.ts"],"names":[],"mappings":";;;;;;;SAQgB,a,CAAc,G,EAAQ;AACpC,MAAM,EAAE,GAA4B;AAClC,IAAA,IAAI,EAAE,qBAD4B;AAElC,IAAA,SAAS,EAAE,OAFuB;AAGlC,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,KAAK,EAAE;AAFH,KAH4B;AAOlC,IAAA,YAAY,EAAE,mBAAmB,CAAC,GAAD;AAPC,GAApC;AAUA,MAAM,GAAG,GAAiB;AACxB,IAAA,IAAI,EAAE,UADkB;AAExB,IAAA,WAAW,EAAE,CAAC,EAAD;AAFW,GAA1B;AAKA,SAAO,GAAP;AACD;;AAED,SAAgB,gBAAhB,CAAiC,GAAjC,EAA2C,QAA3C,EAA4D;AAC1D,MAAM,IAAI,GAA2B;AACnC,IAAA,IAAI,EAAE,oBAD6B;AAEnC,IAAA,aAAa,EAAE;AACb,MAAA,IAAI,EAAE,WADO;AAEb,MAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,MADF;AAEJ,QAAA,KAAK,EAAE,QAAQ,IAAI;AAFf;AAFO,KAFoB;AASnC,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,KAAK,EAAE;AAFH,KAT6B;AAanC,IAAA,YAAY,EAAE,mBAAmB,CAAC,GAAD;AAbE,GAArC;AAgBA,MAAM,GAAG,GAAiB;AACxB,IAAA,IAAI,EAAE,UADkB;AAExB,IAAA,WAAW,EAAE,CAAC,IAAD;AAFW,GAA1B;AAKA,SAAO,GAAP;AACD;;AAED,SAAS,mBAAT,CAA6B,GAA7B,EAAqC;AACnC,MACE,OAAO,GAAP,KAAe,QAAf,IACA,OAAO,GAAP,KAAe,SADf,IA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KA5BD,MA4BO;AACL,WAAK,UAAL,CAAgB;AAAE,QAAA,KAAK,EAAE,aAAa,CAAC,IAAD,CAAtB;AAA8B,QAAA,IAAI,EAAA;AAAlC,OAAhB;AACD;AACF,GAnCM;;AAoCT,SAAA,WAAA;AAAC,C;;;ICnJgB,K;;;AAAjB,CAAA,UAAiB,KAAjB,EAAsB,CAqCrB,CArCD,EAAiB,KAAK,qBAAL,KAAK,GAAA,EAAA,CAAtB,E","sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/bundle.cjs.min.js b/node_modules/apollo-cache/lib/bundle.cjs.min.js new file mode 100644 index 000000000..5b9e384d0 --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.cjs.min.js @@ -0,0 +1 @@ +exports.__esModule=!0,exports.Cache=exports.ApolloCache=void 0;var e=require("apollo-utilities");function t(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(e)}]}}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return i(e[0]);var t=[];return Object.keys(e).forEach(function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:i(e[n])||void 0};t.push(r)}),{kind:"SelectionSet",selections:t}}var n,r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},a=function(){function n(){}return n.prototype.transformDocument=function(e){return e},n.prototype.transformForLink=function(e){return e},n.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},n.prototype.readFragment=function(t,i){return void 0===i&&(i=!1),this.read({query:(0,e.getFragmentQueryDocument)(t.fragment,t.fragmentName),variables:t.variables,rootId:t.id,optimistic:i})},n.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},n.prototype.writeFragment=function(t){this.write({dataId:t.id,result:t.data,variables:t.variables,query:(0,e.getFragmentQueryDocument)(t.fragment,t.fragmentName)})},n.prototype.writeData=function(e){var n,a,o=e.id,u=e.data;if(void 0!==o){var l=null;try{l=this.read({rootId:o,optimistic:!1,query:r})}catch(e){}var s=l&&l.__typename||"__ClientData",d=Object.assign({__typename:s},u);this.writeFragment({id:o,fragment:(n=d,a=s,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:a||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(n)}]}),data:d})}else this.writeQuery({query:t(u),data:u})},n}();exports.ApolloCache=a,exports.Cache=n,n||(exports.Cache=n={}); diff --git a/node_modules/apollo-cache/lib/bundle.esm.js b/node_modules/apollo-cache/lib/bundle.esm.js new file mode 100644 index 000000000..7f3e30ecd --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.esm.js @@ -0,0 +1,175 @@ +import { getFragmentQueryDocument } from 'apollo-utilities'; + +function queryFromPojo(obj) { + var op = { + kind: 'OperationDefinition', + operation: 'query', + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + var out = { + kind: 'Document', + definitions: [op], + }; + return out; +} +function fragmentFromPojo(obj, typename) { + var frag = { + kind: 'FragmentDefinition', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: typename || '__FakeType', + }, + }, + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + var out = { + kind: 'Document', + definitions: [frag], + }; + return out; +} +function selectionSetFromObj(obj) { + if (typeof obj === 'number' || + typeof obj === 'boolean' || + typeof obj === 'string' || + typeof obj === 'undefined' || + obj === null) { + return null; + } + if (Array.isArray(obj)) { + return selectionSetFromObj(obj[0]); + } + var selections = []; + Object.keys(obj).forEach(function (key) { + var nestedSelSet = selectionSetFromObj(obj[key]); + var field = { + kind: 'Field', + name: { + kind: 'Name', + value: key, + }, + selectionSet: nestedSelSet || undefined, + }; + selections.push(field); + }); + var selectionSet = { + kind: 'SelectionSet', + selections: selections, + }; + return selectionSet; +} +var justTypenameQuery = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__typename', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + ], + }, + }, + ], +}; + +var ApolloCache = (function () { + function ApolloCache() { + } + ApolloCache.prototype.transformDocument = function (document) { + return document; + }; + ApolloCache.prototype.transformForLink = function (document) { + return document; + }; + ApolloCache.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.read({ + query: options.query, + variables: options.variables, + optimistic: optimistic, + }); + }; + ApolloCache.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.read({ + query: getFragmentQueryDocument(options.fragment, options.fragmentName), + variables: options.variables, + rootId: options.id, + optimistic: optimistic, + }); + }; + ApolloCache.prototype.writeQuery = function (options) { + this.write({ + dataId: 'ROOT_QUERY', + result: options.data, + query: options.query, + variables: options.variables, + }); + }; + ApolloCache.prototype.writeFragment = function (options) { + this.write({ + dataId: options.id, + result: options.data, + variables: options.variables, + query: getFragmentQueryDocument(options.fragment, options.fragmentName), + }); + }; + ApolloCache.prototype.writeData = function (_a) { + var id = _a.id, data = _a.data; + if (typeof id !== 'undefined') { + var typenameResult = null; + try { + typenameResult = this.read({ + rootId: id, + optimistic: false, + query: justTypenameQuery, + }); + } + catch (e) { + } + var __typename = (typenameResult && typenameResult.__typename) || '__ClientData'; + var dataToWrite = Object.assign({ __typename: __typename }, data); + this.writeFragment({ + id: id, + fragment: fragmentFromPojo(dataToWrite, __typename), + data: dataToWrite, + }); + } + else { + this.writeQuery({ query: queryFromPojo(data), data: data }); + } + }; + return ApolloCache; +}()); + +var Cache; +(function (Cache) { +})(Cache || (Cache = {})); + +export { ApolloCache, Cache }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-cache/lib/bundle.esm.js.map b/node_modules/apollo-cache/lib/bundle.esm.js.map new file mode 100644 index 000000000..04ac58c35 --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/utils.ts","../src/cache.ts","../src/types/Cache.ts"],"sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"],"names":[],"mappings":";;SAQgB,aAAa,CAAC,GAAQ;IACpC,IAAM,EAAE,GAA4B;QAClC,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,CAAC,EAAE,CAAC;KAClB,CAAC;IAEF,OAAO,GAAG,CAAC;CACZ;AAED,SAAgB,gBAAgB,CAAC,GAAQ,EAAE,QAAiB;IAC1D,IAAM,IAAI,GAA2B;QACnC,IAAI,EAAE,oBAAoB;QAC1B,aAAa,EAAE;YACb,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,QAAQ,IAAI,YAAY;aAChC;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,CAAC,IAAI,CAAC;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pB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,KAAK,EAAE,wBAAwB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC;SACxE,CAAC,CAAC;KACJ;IAEM,+BAAS,GAAhB,UAA8B,EAGE;YAF9B,UAAE,EACF,cAAI;QAEJ,IAAI,OAAO,EAAE,KAAK,WAAW,EAAE;YAC7B,IAAI,cAAc,GAAG,IAAI,CAAC;YAK1B,IAAI;gBACF,cAAc,GAAG,IAAI,CAAC,IAAI,CAAM;oBAC9B,MAAM,EAAE,EAAE;oBACV,UAAU,EAAE,KAAK;oBACjB,KAAK,EAAE,iBAAiB;iBACzB,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;aAEX;YAGD,IAAM,UAAU,GACd,CAAC,cAAc,IAAI,cAAc,CAAC,UAAU,KAAK,cAAc,CAAC;YAGlE,IAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,YAAA,EAAE,EAAE,IAAI,CAAC,CAAC;YAExD,IAAI,CAAC,aAAa,CAAC;gBACjB,EAAE,IAAA;gBACF,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC;gBACnD,IAAI,EAAE,WAAW;aAClB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;SACvD;KACF;IACH,kBAAC;CAAA;;ICnJgB,KAAK,CAqCrB;AArCD,WAAiB,KAAK;CAqCrB,EArCgB,KAAK,KAAL,KAAK,QAqCrB;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/bundle.umd.js b/node_modules/apollo-cache/lib/bundle.umd.js new file mode 100644 index 000000000..654ef7f80 --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.umd.js @@ -0,0 +1,208 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "apollo-utilities"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("apollo-utilities")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.apolloUtilities); + global.unknown = mod.exports; + } +})(this, function (_exports, _apolloUtilities) { + + _exports.__esModule = true; + _exports.Cache = _exports.ApolloCache = void 0; + + function queryFromPojo(obj) { + var op = { + kind: 'OperationDefinition', + operation: 'query', + name: { + kind: 'Name', + value: 'GeneratedClientQuery' + }, + selectionSet: selectionSetFromObj(obj) + }; + var out = { + kind: 'Document', + definitions: [op] + }; + return out; + } + + function fragmentFromPojo(obj, typename) { + var frag = { + kind: 'FragmentDefinition', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: typename || '__FakeType' + } + }, + name: { + kind: 'Name', + value: 'GeneratedClientQuery' + }, + selectionSet: selectionSetFromObj(obj) + }; + var out = { + kind: 'Document', + definitions: [frag] + }; + return out; + } + + function selectionSetFromObj(obj) { + if (typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'string' || typeof obj === 'undefined' || obj === null) { + return null; + } + + if (Array.isArray(obj)) { + return selectionSetFromObj(obj[0]); + } + + var selections = []; + Object.keys(obj).forEach(function (key) { + var nestedSelSet = selectionSetFromObj(obj[key]); + var field = { + kind: 'Field', + name: { + kind: 'Name', + value: key + }, + selectionSet: nestedSelSet || undefined + }; + selections.push(field); + }); + var selectionSet = { + kind: 'SelectionSet', + selections: selections + }; + return selectionSet; + } + + var justTypenameQuery = { + kind: 'Document', + definitions: [{ + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [{ + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__typename' + }, + arguments: [], + directives: [], + selectionSet: null + }] + } + }] + }; + + var ApolloCache = function () { + function ApolloCache() {} + + ApolloCache.prototype.transformDocument = function (document) { + return document; + }; + + ApolloCache.prototype.transformForLink = function (document) { + return document; + }; + + ApolloCache.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.read({ + query: options.query, + variables: options.variables, + optimistic: optimistic + }); + }; + + ApolloCache.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.read({ + query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName), + variables: options.variables, + rootId: options.id, + optimistic: optimistic + }); + }; + + ApolloCache.prototype.writeQuery = function (options) { + this.write({ + dataId: 'ROOT_QUERY', + result: options.data, + query: options.query, + variables: options.variables + }); + }; + + ApolloCache.prototype.writeFragment = function (options) { + this.write({ + dataId: options.id, + result: options.data, + variables: options.variables, + query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName) + }); + }; + + ApolloCache.prototype.writeData = function (_a) { + var id = _a.id, + data = _a.data; + + if (typeof id !== 'undefined') { + var typenameResult = null; + + try { + typenameResult = this.read({ + rootId: id, + optimistic: false, + query: justTypenameQuery + }); + } catch (e) {} + + var __typename = typenameResult && typenameResult.__typename || '__ClientData'; + + var dataToWrite = Object.assign({ + __typename: __typename + }, data); + this.writeFragment({ + id: id, + fragment: fragmentFromPojo(dataToWrite, __typename), + data: dataToWrite + }); + } else { + this.writeQuery({ + query: queryFromPojo(data), + data: data + }); + } + }; + + return ApolloCache; + }(); + + _exports.ApolloCache = ApolloCache; + var Cache; + _exports.Cache = Cache; + + (function (Cache) {})(Cache || (_exports.Cache = Cache = {})); + +}); diff --git a/node_modules/apollo-cache/lib/bundle.umd.js.map b/node_modules/apollo-cache/lib/bundle.umd.js.map new file mode 100644 index 000000000..ce6fdb0ee --- /dev/null +++ b/node_modules/apollo-cache/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/utils.ts","../src/cache.ts","../src/types/Cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;WAQgB,a,CAAc,G,EAAQ;AACpC,QAAM,EAAE,GAA4B;AAClC,MAAA,IAAI,EAAE,qBAD4B;AAEl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,GAAA,EAAA,CAAtB,E","sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.d.ts b/node_modules/apollo-cache/lib/cache.d.ts new file mode 100644 index 000000000..b2a2fd035 --- /dev/null +++ b/node_modules/apollo-cache/lib/cache.d.ts @@ -0,0 +1,24 @@ +import { DocumentNode } from 'graphql'; +import { DataProxy, Cache } from './types'; +export declare type Transaction = (c: ApolloCache) => void; +export declare abstract class ApolloCache implements DataProxy { + abstract read(query: Cache.ReadOptions): T | null; + abstract write(write: Cache.WriteOptions): void; + abstract diff(query: Cache.DiffOptions): Cache.DiffResult; + abstract watch(watch: Cache.WatchOptions): () => void; + abstract evict(query: Cache.EvictOptions): Cache.EvictionResult; + abstract reset(): Promise; + abstract restore(serializedState: TSerialized): ApolloCache; + abstract extract(optimistic?: boolean): TSerialized; + abstract removeOptimistic(id: string): void; + abstract performTransaction(transaction: Transaction): void; + abstract recordOptimisticTransaction(transaction: Transaction, id: string): void; + transformDocument(document: DocumentNode): DocumentNode; + transformForLink(document: DocumentNode): DocumentNode; + readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; + writeQuery(options: Cache.WriteQueryOptions): void; + writeFragment(options: Cache.WriteFragmentOptions): void; + writeData({ id, data, }: Cache.WriteDataOptions): void; +} +//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.d.ts.map b/node_modules/apollo-cache/lib/cache.d.ts.map new file mode 100644 index 000000000..45ce12537 --- /dev/null +++ b/node_modules/apollo-cache/lib/cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;A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C,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EACpC,UAAU,GAAE,OAAe,GAC1B,SAAS,GAAG,IAAI;IAQZ,YAAY,CAAC,YAAY,EAAE,UAAU,GAAG,GAAG,EAChD,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EACvC,UAAU,GAAE,OAAe,GAC1B,YAAY,GAAG,IAAI;IASf,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EAC7C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,IAAI;IASA,aAAa,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EAChD,OAAO,EAAE,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,GACrD,IAAI;IASA,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,EAC5B,EAAE,EACF,IAAI,GACL,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI;CAiCxC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.js b/node_modules/apollo-cache/lib/cache.js new file mode 100644 index 000000000..aec0779ba --- /dev/null +++ b/node_modules/apollo-cache/lib/cache.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var apollo_utilities_1 = require("apollo-utilities"); +var utils_1 = require("./utils"); +var ApolloCache = (function () { + function ApolloCache() { + } + ApolloCache.prototype.transformDocument = function (document) { + return document; + }; + ApolloCache.prototype.transformForLink = function (document) { + return document; + }; + ApolloCache.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.read({ + query: options.query, + variables: options.variables, + optimistic: optimistic, + }); + }; + ApolloCache.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.read({ + query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), + variables: options.variables, + rootId: options.id, + optimistic: optimistic, + }); + }; + ApolloCache.prototype.writeQuery = function (options) { + this.write({ + dataId: 'ROOT_QUERY', + result: options.data, + query: options.query, + variables: options.variables, + }); + }; + ApolloCache.prototype.writeFragment = function (options) { + this.write({ + dataId: options.id, + result: options.data, + variables: options.variables, + query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), + }); + }; + ApolloCache.prototype.writeData = function (_a) { + var id = _a.id, data = _a.data; + if (typeof id !== 'undefined') { + var typenameResult = null; + try { + typenameResult = this.read({ + rootId: id, + optimistic: false, + query: utils_1.justTypenameQuery, + }); + } + catch (e) { + } + var __typename = (typenameResult && typenameResult.__typename) || '__ClientData'; + var dataToWrite = Object.assign({ __typename: __typename }, data); + this.writeFragment({ + id: id, + fragment: utils_1.fragmentFromPojo(dataToWrite, __typename), + data: dataToWrite, + }); + } + else { + this.writeQuery({ query: utils_1.queryFromPojo(data), data: data }); + } + }; + return ApolloCache; +}()); +exports.ApolloCache = ApolloCache; +//# sourceMappingURL=cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.js.map b/node_modules/apollo-cache/lib/cache.js.map new file mode 100644 index 000000000..348c78f51 --- /dev/null +++ b/node_modules/apollo-cache/lib/cache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;AACA,qDAA4D;AAG5D,iCAA6E;AAI7E;IAAA;IA6IA,CAAC;IA/FQ,uCAAiB,GAAxB,UAAyB,QAAsB;QAC7C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,sCAAgB,GAAvB,UAAwB,QAAsB;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAQM,+BAAS,GAAhB,UACE,OAAoC,EACpC,UAA2B;QAA3B,2BAAA,EAAA,kBAA2B;QAE3B,OAAO,IAAI,CAAC,IAAI,CAAC;YACf,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,OA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AAC,cAAc,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,cAAc,CAAC;YAGlE,IAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,YAAA,EAAE,EAAE,IAAI,CAAC,CAAC;YAExD,IAAI,CAAC,aAAa,CAAC;gBACjB,EAAE,IAAA;gBACF,QAAQ,EAAE,wBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC;gBACnD,IAAI,EAAE,WAAW;aAClB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,qBAAa,CAAC,IAAI,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;SACvD;IACH,CAAC;IACH,kBAAC;AAAD,CAAC,AA7ID,IA6IC;AA7IqB,kCAAW"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.d.ts b/node_modules/apollo-cache/lib/index.d.ts new file mode 100644 index 000000000..5b294ac6a --- /dev/null +++ b/node_modules/apollo-cache/lib/index.d.ts @@ -0,0 +1,3 @@ +export * from './cache'; +export * from './types'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.d.ts.map b/node_modules/apollo-cache/lib/index.d.ts.map new file mode 100644 index 000000000..bc2454572 --- /dev/null +++ b/node_modules/apollo-cache/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.js b/node_modules/apollo-cache/lib/index.js new file mode 100644 index 000000000..decd22aa7 --- /dev/null +++ b/node_modules/apollo-cache/lib/index.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./cache"), exports); +tslib_1.__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.js.map b/node_modules/apollo-cache/lib/index.js.map new file mode 100644 index 000000000..a385466c7 --- /dev/null +++ b/node_modules/apollo-cache/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,kDAAwB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts b/node_modules/apollo-cache/lib/types/Cache.d.ts new file mode 100644 index 000000000..5a9e6497d --- /dev/null +++ b/node_modules/apollo-cache/lib/types/Cache.d.ts @@ -0,0 +1,31 @@ +import { DataProxy } from './DataProxy'; +export declare namespace Cache { + type WatchCallback = (newData: any) => void; + interface EvictionResult { + success: Boolean; + } + interface ReadOptions extends DataProxy.Query { + rootId?: string; + previousResult?: any; + optimistic: boolean; + } + interface WriteOptions extends DataProxy.Query { + dataId: string; + result: TResult; + } + interface DiffOptions extends ReadOptions { + returnPartialData?: boolean; + } + interface WatchOptions extends ReadOptions { + callback: WatchCallback; + } + interface EvictOptions extends DataProxy.Query { + rootId?: string; + } + export import DiffResult = DataProxy.DiffResult; + export import WriteQueryOptions = DataProxy.WriteQueryOptions; + export import WriteFragmentOptions = DataProxy.WriteFragmentOptions; + export import WriteDataOptions = DataProxy.WriteDataOptions; + export import Fragment = DataProxy.Fragment; +} +//# sourceMappingURL=Cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts.map b/node_modules/apollo-cache/lib/types/Cache.d.ts.map new file mode 100644 index 000000000..aa4f617f8 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/Cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../src/types/Cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,yBAAiB,KAAK,CAAC;IACrB,KAAY,aAAa,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACnD,UAAiB,cAAc;QAC7B,OAAO,EAAE,OAAO,CAAC;KAClB;IAED,UAAiB,WAAW,CAAC,UAAU,GAAG,GAAG,CAC3C,SAAQ,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,GAAG,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;KACrB;IAED,UAAiB,YAAY,CAAC,OAAO,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,CAC3D,SAAQ,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QACnC,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,OAAO,CAAC;KACjB;IAED,UAAiB,WAAY,SAAQ,WAAW;QAC9C,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B;IAED,UAAiB,YAAa,SAAQ,WAAW;QAC/C,QAAQ,EAAE,aAAa,CAAC;KACzB;IAED,UAAiB,YAAY,CAAC,UAAU,GAAG,GAAG,CAC5C,SAAQ,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAED,MAAM,QAAQ,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;IAChD,MAAM,QAAQ,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC;IAC9D,MAAM,QAAQ,oBAAoB,GAAG,SAAS,CAAC,oBAAoB,CAAC;IACpE,MAAM,QAAQ,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAC;IAC5D,MAAM,QAAQ,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;CAC7C"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.js b/node_modules/apollo-cache/lib/types/Cache.js new file mode 100644 index 000000000..a2cebe56c --- /dev/null +++ b/node_modules/apollo-cache/lib/types/Cache.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Cache; +(function (Cache) { +})(Cache = exports.Cache || (exports.Cache = {})); +//# sourceMappingURL=Cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.js.map b/node_modules/apollo-cache/lib/types/Cache.js.map new file mode 100644 index 000000000..f92c62a7e --- /dev/null +++ b/node_modules/apollo-cache/lib/types/Cache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../src/types/Cache.ts"],"names":[],"mappings":";;AAEA,IAAiB,KAAK,CAqCrB;AArCD,WAAiB,KAAK;AAqCtB,CAAC,EArCgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAqCrB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts b/node_modules/apollo-cache/lib/types/DataProxy.d.ts new file mode 100644 index 000000000..2c27091f4 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/DataProxy.d.ts @@ -0,0 +1,35 @@ +import { DocumentNode } from 'graphql'; +export declare namespace DataProxy { + interface Query { + query: DocumentNode; + variables?: TVariables; + } + interface Fragment { + id: string; + fragment: DocumentNode; + fragmentName?: string; + variables?: TVariables; + } + interface WriteQueryOptions extends Query { + data: TData; + } + interface WriteFragmentOptions extends Fragment { + data: TData; + } + interface WriteDataOptions { + data: TData; + id?: string; + } + type DiffResult = { + result?: T; + complete?: boolean; + }; +} +export interface DataProxy { + readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; + writeQuery(options: DataProxy.WriteQueryOptions): void; + writeFragment(options: DataProxy.WriteFragmentOptions): void; + writeData(options: DataProxy.WriteDataOptions): void; +} +//# sourceMappingURL=DataProxy.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map b/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map new file mode 100644 index 000000000..81d0ffc08 --- /dev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AAC,UAAU,CAAC,EACvC,UAAU,CAAC,EAAE,OAAO,GACnB,YAAY,GAAG,IAAI,CAAC;IAKvB,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EACtC,OAAO,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,GACtD,IAAI,CAAC;IAOR,aAAa,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EACzC,OAAO,EAAE,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,GACzD,IAAI,CAAC;IAQR,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAC1E"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.js b/node_modules/apollo-cache/lib/types/DataProxy.js new file mode 100644 index 000000000..e64cb3d26 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/DataProxy.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=DataProxy.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.js.map b/node_modules/apollo-cache/lib/types/DataProxy.js.map new file mode 100644 index 000000000..697567575 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/DataProxy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DataProxy.js","sourceRoot":"","sources":["../../src/types/DataProxy.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.d.ts b/node_modules/apollo-cache/lib/types/index.d.ts new file mode 100644 index 000000000..4b63d0486 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/index.d.ts @@ -0,0 +1,3 @@ +export * from './DataProxy'; +export * from './Cache'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.d.ts.map b/node_modules/apollo-cache/lib/types/index.d.ts.map new file mode 100644 index 000000000..856e64bc6 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.js b/node_modules/apollo-cache/lib/types/index.js new file mode 100644 index 000000000..83309fe1f --- /dev/null +++ b/node_modules/apollo-cache/lib/types/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./Cache"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.js.map b/node_modules/apollo-cache/lib/types/index.js.map new file mode 100644 index 000000000..3b77f7b17 --- /dev/null +++ b/node_modules/apollo-cache/lib/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AACA,kDAAwB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.d.ts b/node_modules/apollo-cache/lib/utils.d.ts new file mode 100644 index 000000000..28514c9f3 --- /dev/null +++ b/node_modules/apollo-cache/lib/utils.d.ts @@ -0,0 +1,5 @@ +import { DocumentNode } from 'graphql'; +export declare function queryFromPojo(obj: any): DocumentNode; +export declare function fragmentFromPojo(obj: any, typename?: string): DocumentNode; +export declare const justTypenameQuery: DocumentNode; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.d.ts.map b/node_modules/apollo-cache/lib/utils.d.ts.map new file mode 100644 index 000000000..f673d7a32 --- /dev/null +++ b/node_modules/apollo-cache/lib/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKb,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAiBpD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAuB1E;AA6CD,eAAO,MAAM,iBAAiB,EAAE,YA2B/B,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.js b/node_modules/apollo-cache/lib/utils.js new file mode 100644 index 000000000..289e5182e --- /dev/null +++ b/node_modules/apollo-cache/lib/utils.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function queryFromPojo(obj) { + var op = { + kind: 'OperationDefinition', + operation: 'query', + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + var out = { + kind: 'Document', + definitions: [op], + }; + return out; +} +exports.queryFromPojo = queryFromPojo; +function fragmentFromPojo(obj, typename) { + var frag = { + kind: 'FragmentDefinition', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: typename || '__FakeType', + }, + }, + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + var out = { + kind: 'Document', + definitions: [frag], + }; + return out; +} +exports.fragmentFromPojo = fragmentFromPojo; +function selectionSetFromObj(obj) { + if (typeof obj === 'number' || + typeof obj === 'boolean' || + typeof obj === 'string' || + typeof obj === 'undefined' || + obj === null) { + return null; + } + if (Array.isArray(obj)) { + return selectionSetFromObj(obj[0]); + } + var selections = []; + Object.keys(obj).forEach(function (key) { + var nestedSelSet = selectionSetFromObj(obj[key]); + var field = { + kind: 'Field', + name: { + kind: 'Name', + value: key, + }, + selectionSet: nestedSelSet || undefined, + }; + selections.push(field); + }); + var selectionSet = { + kind: 'SelectionSet', + selections: selections, + }; + return selectionSet; +} +exports.justTypenameQuery = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__typename', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + ], + }, + }, + ], +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.js.map b/node_modules/apollo-cache/lib/utils.js.map new file mode 100644 index 000000000..465f50218 --- /dev/null +++ b/node_modules/apollo-cache/lib/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAQA,SAAgB,aAAa,CAAC,GAAQ;IACpC,IAAM,EAAE,GAA4B;QAClC,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,CAAC,EAAE,CAAC;KAClB,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAjBD,sCAiBC;AAED,SAAgB,gBAAgB,CAAC,GAAQ,EAAE,QAAiB;IAC1D,IAAM,IAAI,GAA2B;QACnC,IAAI,EAAE,oBAAoB;QAC1B,aAAa,EAAE;YACb,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,QAAQ,IAAI,YAAY;aAChC;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,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BACpB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,IAAI;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,YAAY;yBACpB;wBACD,SAAS,EAAE,EAAE;wBACb,UAAU,EAAE,EAAE;wBACd,YAAY,EAAE,IAAI;qBACnB;iBACF;aACF;SACF;KACF;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/package.json b/node_modules/apollo-cache/package.json new file mode 100644 index 000000000..e0d809b4a --- /dev/null +++ b/node_modules/apollo-cache/package.json @@ -0,0 +1,43 @@ +{ + "name": "apollo-cache", + "version": "1.3.2", + "description": "Core abstract of Caching layer for Apollo Client", + "author": "James Baxley ", + "contributors": [ + "James Baxley ", + "Jonas Helfer ", + "Sashko Stubailo ", + "James Burgess " + ], + "license": "MIT", + "main": "./lib/bundle.cjs.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-client.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-client/issues" + }, + "homepage": "https://github.com/apollographql/apollo-client#readme", + "scripts": { + "prepare": "npm run lint && npm run build", + "coverage": "jest --coverage", + "test": "tsc -p tsconfig.json --noEmit && jest", + "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts && tslint -c \"../../config/tslint.json\" -p tsconfig.json tests/*.ts", + "prebuild": "npm run clean", + "build": "tsc -b .", + "postbuild": "npm run bundle", + "bundle": "../../node_modules/rollup/bin/rollup -c rollup.config.js", + "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", + "clean": "rm -rf coverage/* lib/*", + "prepublishOnly": "npm run clean && npm run build" + }, + "dependencies": { + "apollo-utilities": "^1.3.2", + "tslib": "^1.9.3" + }, + "gitHead": "656fd9fbcf82df5cd6b9512e4c9b90b808e300ad" +} diff --git a/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap b/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap new file mode 100644 index 000000000..2a167ec7a --- /dev/null +++ b/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[ + `writing data with no query converts a JavaScript object to a query correctly arrays 1` +] = ` +"query GeneratedClientQuery { + number + bool + nested { + bool2 + undef + nullField + str + } +} +" +`; + +exports[ + `writing data with no query converts a JavaScript object to a query correctly basic 1` +] = ` +"query GeneratedClientQuery { + number + bool + bool2 + undef + nullField + str +} +" +`; + +exports[ + `writing data with no query converts a JavaScript object to a query correctly fragments 1` +] = ` +"fragment GeneratedClientQuery on __FakeType { + number + bool + nested { + bool2 + undef + nullField + str + } +} +" +`; + +exports[ + `writing data with no query converts a JavaScript object to a query correctly nested 1` +] = ` +"query GeneratedClientQuery { + number + bool + nested { + bool2 + undef + nullField + str + } +} +" +`; diff --git a/node_modules/apollo-cache/src/__tests__/cache.ts b/node_modules/apollo-cache/src/__tests__/cache.ts new file mode 100644 index 000000000..6f10d7c57 --- /dev/null +++ b/node_modules/apollo-cache/src/__tests__/cache.ts @@ -0,0 +1,149 @@ +import gql from 'graphql-tag'; + +import { ApolloCache as Cache } from '../cache'; + +class TestCache extends Cache {} + +describe('abstract cache', () => { + describe('transformDocument', () => { + it('returns the document', () => { + const test = new TestCache(); + expect(test.transformDocument('a')).toBe('a'); + }); + }); + + describe('transformForLink', () => { + it('returns the document', () => { + const test = new TestCache(); + expect(test.transformForLink('a')).toBe('a'); + }); + }); + + describe('readQuery', () => { + it('runs the read method', () => { + const test = new TestCache(); + test.read = jest.fn(); + + test.readQuery({}); + expect(test.read).toBeCalled(); + }); + + it('defaults optimistic to false', () => { + const test = new TestCache(); + test.read = ({ optimistic }) => optimistic; + + expect(test.readQuery({})).toBe(false); + expect(test.readQuery({}, true)).toBe(true); + }); + }); + + describe('readFragment', () => { + it('runs the read method', () => { + const test = new TestCache(); + test.read = jest.fn(); + const fragment = { + id: 'frag', + fragment: gql` + fragment a on b { + name + } + `, + }; + + test.readFragment(fragment); + expect(test.read).toBeCalled(); + }); + + it('defaults optimistic to false', () => { + const test = new TestCache(); + test.read = ({ optimistic }) => optimistic; + const fragment = { + id: 'frag', + fragment: gql` + fragment a on b { + name + } + `, + }; + + expect(test.readFragment(fragment)).toBe(false); + expect(test.readFragment(fragment, true)).toBe(true); + }); + }); + + describe('writeQuery', () => { + it('runs the write method', () => { + const test = new TestCache(); + test.write = jest.fn(); + + test.writeQuery({}); + expect(test.write).toBeCalled(); + }); + }); + + describe('writeFragment', () => { + it('runs the write method', () => { + const test = new TestCache(); + test.write = jest.fn(); + const fragment = { + id: 'frag', + fragment: gql` + fragment a on b { + name + } + `, + }; + + test.writeFragment(fragment); + expect(test.write).toBeCalled(); + }); + }); + + describe('writeData', () => { + it('either writes a fragment or a query', () => { + const test = new TestCache(); + test.read = jest.fn(); + test.writeFragment = jest.fn(); + test.writeQuery = jest.fn(); + + test.writeData({}); + expect(test.writeQuery).toBeCalled(); + + test.writeData({ id: 1 }); + expect(test.read).toBeCalled(); + expect(test.writeFragment).toBeCalled(); + + // Edge case for falsey id + test.writeData({ id: 0 }); + expect(test.read).toHaveBeenCalledTimes(2); + expect(test.writeFragment).toHaveBeenCalledTimes(2); + }); + + it('suppresses read errors', () => { + const test = new TestCache(); + test.read = () => { + throw new Error(); + }; + test.writeFragment = jest.fn(); + + expect(() => test.writeData({ id: 1 })).not.toThrow(); + expect(test.writeFragment).toBeCalled(); + }); + + it('reads __typename from typenameResult or defaults to __ClientData', () => { + const test = new TestCache(); + test.read = () => ({ __typename: 'a' }); + let res; + test.writeFragment = obj => + (res = obj.fragment.definitions[0].typeCondition.name.value); + + test.writeData({ id: 1 }); + expect(res).toBe('a'); + + test.read = () => ({}); + + test.writeData({ id: 1 }); + expect(res).toBe('__ClientData'); + }); + }); +}); diff --git a/node_modules/apollo-cache/src/__tests__/utils.ts b/node_modules/apollo-cache/src/__tests__/utils.ts new file mode 100644 index 000000000..953e0e124 --- /dev/null +++ b/node_modules/apollo-cache/src/__tests__/utils.ts @@ -0,0 +1,76 @@ +import { print } from 'graphql/language/printer'; +import { queryFromPojo, fragmentFromPojo } from '../utils'; + +describe('writing data with no query', () => { + describe('converts a JavaScript object to a query correctly', () => { + it('basic', () => { + expect( + print( + queryFromPojo({ + number: 5, + bool: true, + bool2: false, + undef: undefined, + nullField: null, + str: 'string', + }), + ), + ).toMatchSnapshot(); + }); + + it('nested', () => { + expect( + print( + queryFromPojo({ + number: 5, + bool: true, + nested: { + bool2: false, + undef: undefined, + nullField: null, + str: 'string', + }, + }), + ), + ).toMatchSnapshot(); + }); + + it('arrays', () => { + expect( + print( + queryFromPojo({ + number: [5], + bool: [[true]], + nested: [ + { + bool2: false, + undef: undefined, + nullField: null, + str: 'string', + }, + ], + }), + ), + ).toMatchSnapshot(); + }); + + it('fragments', () => { + expect( + print( + fragmentFromPojo({ + number: [5], + bool: [[true]], + nested: [ + { + bool2: false, + undef: undefined, + nullField: null, + str: 'string', + }, + ], + }), + ), + ).toMatchSnapshot(); + }); + }); +}); diff --git a/node_modules/apollo-cache/src/cache.ts b/node_modules/apollo-cache/src/cache.ts new file mode 100644 index 000000000..ab45b1a23 --- /dev/null +++ b/node_modules/apollo-cache/src/cache.ts @@ -0,0 +1,150 @@ +import { DocumentNode } from 'graphql'; +import { getFragmentQueryDocument } from 'apollo-utilities'; + +import { DataProxy, Cache } from './types'; +import { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils'; + +export type Transaction = (c: ApolloCache) => void; + +export abstract class ApolloCache implements DataProxy { + // required to implement + // core API + public abstract read( + query: Cache.ReadOptions, + ): T | null; + public abstract write( + write: Cache.WriteOptions, + ): void; + public abstract diff(query: Cache.DiffOptions): Cache.DiffResult; + public abstract watch(watch: Cache.WatchOptions): () => void; + public abstract evict( + query: Cache.EvictOptions, + ): Cache.EvictionResult; + public abstract reset(): Promise; + + // intializer / offline / ssr API + /** + * Replaces existing state in the cache (if any) with the values expressed by + * `serializedState`. + * + * Called when hydrating a cache (server side rendering, or offline storage), + * and also (potentially) during hot reloads. + */ + public abstract restore( + serializedState: TSerialized, + ): ApolloCache; + + /** + * Exposes the cache's complete state, in a serializable format for later restoration. + */ + public abstract extract(optimistic?: boolean): TSerialized; + + // optimistic API + public abstract removeOptimistic(id: string): void; + + // transactional API + public abstract performTransaction( + transaction: Transaction, + ): void; + public abstract recordOptimisticTransaction( + transaction: Transaction, + id: string, + ): void; + + // optional API + public transformDocument(document: DocumentNode): DocumentNode { + return document; + } + // experimental + public transformForLink(document: DocumentNode): DocumentNode { + return document; + } + + // DataProxy API + /** + * + * @param options + * @param optimistic + */ + public readQuery( + options: DataProxy.Query, + optimistic: boolean = false, + ): QueryType | null { + return this.read({ + query: options.query, + variables: options.variables, + optimistic, + }); + } + + public readFragment( + options: DataProxy.Fragment, + optimistic: boolean = false, + ): FragmentType | null { + return this.read({ + query: getFragmentQueryDocument(options.fragment, options.fragmentName), + variables: options.variables, + rootId: options.id, + optimistic, + }); + } + + public writeQuery( + options: Cache.WriteQueryOptions, + ): void { + this.write({ + dataId: 'ROOT_QUERY', + result: options.data, + query: options.query, + variables: options.variables, + }); + } + + public writeFragment( + options: Cache.WriteFragmentOptions, + ): void { + this.write({ + dataId: options.id, + result: options.data, + variables: options.variables, + query: getFragmentQueryDocument(options.fragment, options.fragmentName), + }); + } + + public writeData({ + id, + data, + }: Cache.WriteDataOptions): void { + if (typeof id !== 'undefined') { + let typenameResult = null; + // Since we can't use fragments without having a typename in the store, + // we need to make sure we have one. + // To avoid overwriting an existing typename, we need to read it out first + // and generate a fake one if none exists. + try { + typenameResult = this.read({ + rootId: id, + optimistic: false, + query: justTypenameQuery, + }); + } catch (e) { + // Do nothing, since an error just means no typename exists + } + + // tslint:disable-next-line + const __typename = + (typenameResult && typenameResult.__typename) || '__ClientData'; + + // Add a type here to satisfy the inmemory cache + const dataToWrite = Object.assign({ __typename }, data); + + this.writeFragment({ + id, + fragment: fragmentFromPojo(dataToWrite, __typename), + data: dataToWrite, + }); + } else { + this.writeQuery({ query: queryFromPojo(data), data }); + } + } +} diff --git a/node_modules/apollo-cache/src/index.ts b/node_modules/apollo-cache/src/index.ts new file mode 100644 index 000000000..18273b71d --- /dev/null +++ b/node_modules/apollo-cache/src/index.ts @@ -0,0 +1,2 @@ +export * from './cache'; +export * from './types'; diff --git a/node_modules/apollo-cache/src/types/Cache.ts b/node_modules/apollo-cache/src/types/Cache.ts new file mode 100644 index 000000000..da6ef0bdd --- /dev/null +++ b/node_modules/apollo-cache/src/types/Cache.ts @@ -0,0 +1,40 @@ +import { DataProxy } from './DataProxy'; + +export namespace Cache { + export type WatchCallback = (newData: any) => void; + export interface EvictionResult { + success: Boolean; + } + + export interface ReadOptions + extends DataProxy.Query { + rootId?: string; + previousResult?: any; + optimistic: boolean; + } + + export interface WriteOptions + extends DataProxy.Query { + dataId: string; + result: TResult; + } + + export interface DiffOptions extends ReadOptions { + returnPartialData?: boolean; + } + + export interface WatchOptions extends ReadOptions { + callback: WatchCallback; + } + + export interface EvictOptions + extends DataProxy.Query { + rootId?: string; + } + + export import DiffResult = DataProxy.DiffResult; + export import WriteQueryOptions = DataProxy.WriteQueryOptions; + export import WriteFragmentOptions = DataProxy.WriteFragmentOptions; + export import WriteDataOptions = DataProxy.WriteDataOptions; + export import Fragment = DataProxy.Fragment; +} diff --git a/node_modules/apollo-cache/src/types/DataProxy.ts b/node_modules/apollo-cache/src/types/DataProxy.ts new file mode 100644 index 000000000..8b85709a7 --- /dev/null +++ b/node_modules/apollo-cache/src/types/DataProxy.ts @@ -0,0 +1,127 @@ +import { DocumentNode } from 'graphql'; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved + +export namespace DataProxy { + export interface Query { + /** + * The GraphQL query shape to be used constructed using the `gql` template + * string tag from `graphql-tag`. The query will be used to determine the + * shape of the data to be read. + */ + query: DocumentNode; + + /** + * Any variables that the GraphQL query may depend on. + */ + variables?: TVariables; + } + + export interface Fragment { + /** + * The root id to be used. This id should take the same form as the + * value returned by your `dataIdFromObject` function. If a value with your + * id does not exist in the store, `null` will be returned. + */ + id: string; + + /** + * A GraphQL document created using the `gql` template string tag from + * `graphql-tag` with one or more fragments which will be used to determine + * the shape of data to read. If you provide more than one fragment in this + * document then you must also specify `fragmentName` to select a single. + */ + fragment: DocumentNode; + + /** + * The name of the fragment in your GraphQL document to be used. If you do + * not provide a `fragmentName` and there is only one fragment in your + * `fragment` document then that fragment will be used. + */ + fragmentName?: string; + + /** + * Any variables that your GraphQL fragments depend on. + */ + variables?: TVariables; + } + + export interface WriteQueryOptions + extends Query { + /** + * The data you will be writing to the store. + */ + data: TData; + } + + export interface WriteFragmentOptions + extends Fragment { + /** + * The data you will be writing to the store. + */ + data: TData; + } + + export interface WriteDataOptions { + /** + * The data you will be writing to the store. + * It also takes an optional id property. + * The id is used to write a fragment to an existing object in the store. + */ + data: TData; + id?: string; + } + + export type DiffResult = { + result?: T; + complete?: boolean; + }; +} + +/** + * A proxy to the normalized data living in our store. This interface allows a + * user to read and write denormalized data which feels natural to the user + * whilst in the background this data is being converted into the normalized + * store format. + */ +export interface DataProxy { + /** + * Reads a GraphQL query from the root query id. + */ + readQuery( + options: DataProxy.Query, + optimistic?: boolean, + ): QueryType | null; + + /** + * Reads a GraphQL fragment from any arbitrary id. If there is more than + * one fragment in the provided document then a `fragmentName` must be + * provided to select the correct fragment. + */ + readFragment( + options: DataProxy.Fragment, + optimistic?: boolean, + ): FragmentType | null; + + /** + * Writes a GraphQL query to the root query id. + */ + writeQuery( + options: DataProxy.WriteQueryOptions, + ): void; + + /** + * Writes a GraphQL fragment to any arbitrary id. If there is more than + * one fragment in the provided document then a `fragmentName` must be + * provided to select the correct fragment. + */ + writeFragment( + options: DataProxy.WriteFragmentOptions, + ): void; + + /** + * Sugar for writeQuery & writeFragment. + * Writes data to the store without passing in a query. + * If you supply an id, the data will be written as a fragment to an existing object. + * Otherwise, the data is written to the root of the store. + */ + writeData(options: DataProxy.WriteDataOptions): void; +} diff --git a/node_modules/apollo-cache/src/types/index.ts b/node_modules/apollo-cache/src/types/index.ts new file mode 100644 index 000000000..c44054d67 --- /dev/null +++ b/node_modules/apollo-cache/src/types/index.ts @@ -0,0 +1,2 @@ +export * from './DataProxy'; +export * from './Cache'; diff --git a/node_modules/apollo-cache/src/utils.ts b/node_modules/apollo-cache/src/utils.ts new file mode 100644 index 000000000..7d88d0b93 --- /dev/null +++ b/node_modules/apollo-cache/src/utils.ts @@ -0,0 +1,123 @@ +import { + DocumentNode, + OperationDefinitionNode, + SelectionSetNode, + FieldNode, + FragmentDefinitionNode, +} from 'graphql'; + +export function queryFromPojo(obj: any): DocumentNode { + const op: OperationDefinitionNode = { + kind: 'OperationDefinition', + operation: 'query', + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + + const out: DocumentNode = { + kind: 'Document', + definitions: [op], + }; + + return out; +} + +export function fragmentFromPojo(obj: any, typename?: string): DocumentNode { + const frag: FragmentDefinitionNode = { + kind: 'FragmentDefinition', + typeCondition: { + kind: 'NamedType', + name: { + kind: 'Name', + value: typename || '__FakeType', + }, + }, + name: { + kind: 'Name', + value: 'GeneratedClientQuery', + }, + selectionSet: selectionSetFromObj(obj), + }; + + const out: DocumentNode = { + kind: 'Document', + definitions: [frag], + }; + + return out; +} + +function selectionSetFromObj(obj: any): SelectionSetNode { + if ( + typeof obj === 'number' || + typeof obj === 'boolean' || + typeof obj === 'string' || + typeof obj === 'undefined' || + obj === null + ) { + // No selection set here + return null; + } + + if (Array.isArray(obj)) { + // GraphQL queries don't include arrays + return selectionSetFromObj(obj[0]); + } + + // Now we know it's an object + const selections: FieldNode[] = []; + + Object.keys(obj).forEach(key => { + const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]); + + const field: FieldNode = { + kind: 'Field', + name: { + kind: 'Name', + value: key, + }, + selectionSet: nestedSelSet || undefined, + }; + + selections.push(field); + }); + + const selectionSet: SelectionSetNode = { + kind: 'SelectionSet', + selections, + }; + + return selectionSet; +} + +export const justTypenameQuery: DocumentNode = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: null, + name: { + kind: 'Name', + value: '__typename', + }, + arguments: [], + directives: [], + selectionSet: null, + }, + ], + }, + }, + ], +}; diff --git a/node_modules/apollo-client/ApolloClient.d.ts b/node_modules/apollo-client/ApolloClient.d.ts new file mode 100644 index 000000000..3e7d0a037 --- /dev/null +++ b/node_modules/apollo-client/ApolloClient.d.ts @@ -0,0 +1,71 @@ +import { ApolloLink, FetchResult, GraphQLRequest } from 'apollo-link'; +import { ExecutionResult, DocumentNode } from 'graphql'; +import { ApolloCache, DataProxy } from 'apollo-cache'; +import { QueryManager } from './core/QueryManager'; +import { ApolloQueryResult, OperationVariables, Resolvers } from './core/types'; +import { ObservableQuery } from './core/ObservableQuery'; +import { FragmentMatcher } from './core/LocalState'; +import { Observable } from './util/Observable'; +import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } from './core/watchQueryOptions'; +import { DataStore } from './data/store'; +export interface DefaultOptions { + watchQuery?: Partial; + query?: Partial; + mutate?: Partial; +} +export declare type ApolloClientOptions = { + link?: ApolloLink; + cache: ApolloCache; + ssrForceFetchDelay?: number; + ssrMode?: boolean; + connectToDevTools?: boolean; + queryDeduplication?: boolean; + defaultOptions?: DefaultOptions; + assumeImmutableResults?: boolean; + resolvers?: Resolvers | Resolvers[]; + typeDefs?: string | string[] | DocumentNode | DocumentNode[]; + fragmentMatcher?: FragmentMatcher; + name?: string; + version?: string; +}; +export default class ApolloClient implements DataProxy { + link: ApolloLink; + store: DataStore; + cache: ApolloCache; + readonly queryManager: QueryManager; + disableNetworkFetches: boolean; + version: string; + queryDeduplication: boolean; + defaultOptions: DefaultOptions; + readonly typeDefs: ApolloClientOptions['typeDefs']; + private devToolsHookCb; + private resetStoreCallbacks; + private clearStoreCallbacks; + private localState; + constructor(options: ApolloClientOptions); + stop(): void; + watchQuery(options: WatchQueryOptions): ObservableQuery; + query(options: QueryOptions): Promise>; + mutate(options: MutationOptions): Promise>; + subscribe(options: SubscriptionOptions): Observable>; + readQuery(options: DataProxy.Query, optimistic?: boolean): T | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): T | null; + writeQuery(options: DataProxy.WriteQueryOptions): void; + writeFragment(options: DataProxy.WriteFragmentOptions): void; + writeData(options: DataProxy.WriteDataOptions): void; + __actionHookForDevTools(cb: () => any): void; + __requestRaw(payload: GraphQLRequest): Observable; + initQueryManager(): QueryManager; + resetStore(): Promise[] | null>; + clearStore(): Promise; + onResetStore(cb: () => Promise): () => void; + onClearStore(cb: () => Promise): () => void; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + extract(optimistic?: boolean): TCacheShape; + restore(serializedState: TCacheShape): ApolloCache; + addResolvers(resolvers: Resolvers | Resolvers[]): void; + setResolvers(resolvers: Resolvers | Resolvers[]): void; + getResolvers(): Resolvers; + setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher): void; +} +//# sourceMappingURL=ApolloClient.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.d.ts.map b/node_modules/apollo-client/ApolloClient.d.ts.map new file mode 100644 index 000000000..37f5b9eb6 --- /dev/null +++ b/node_modules/apollo-client/ApolloClient.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloClient.d.ts","sourceRoot":"","sources":["src/ApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAItD,OAAO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wB,CAC7B,cAAc,CAAC,EAAE,OAAO,GACvB,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAO7B,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW;IAW1C,OAAO,CAAC,eAAe,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAO/D,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE;IAO/C,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE;IAO/C,YAAY;IAOZ,4BAA4B,CAAC,eAAe,EAAE,eAAe;CAGrE"} \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.js b/node_modules/apollo-client/ApolloClient.js new file mode 100644 index 000000000..acb791fdd --- /dev/null +++ b/node_modules/apollo-client/ApolloClient.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +var ts_invariant_1 = require("ts-invariant"); +var QueryManager_1 = require("./core/QueryManager"); +var LocalState_1 = require("./core/LocalState"); +var store_1 = require("./data/store"); +var version_1 = require("./version"); +var hasSuggestedDevtools = false; +var ApolloClient = (function () { + function ApolloClient(options) { + var _this = this; + this.defaultOptions = {}; + this.resetStoreCallbacks = []; + this.clearStoreCallbacks = []; + var cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, connectToDevTools = options.connectToDevTools, _c = options.queryDeduplication, queryDeduplication = _c === void 0 ? true : _c, defaultOptions = options.defaultOptions, _d = options.assumeImmutableResults, assumeImmutableResults = _d === void 0 ? false : _d, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version; + var link = options.link; + if (!link && resolvers) { + link = apollo_link_1.ApolloLink.empty(); + } + if (!link || !cache) { + throw new ts_invariant_1.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); + } + this.link = link; + this.cache = cache; + this.store = new store_1.DataStore(cache); + this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; + this.queryDeduplication = queryDeduplication; + this.defaultOptions = defaultOptions || {}; + this.typeDefs = typeDefs; + if (ssrForceFetchDelay) { + setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay); + } + this.watchQuery = this.watchQuery.bind(this); + this.query = this.query.bind(this); + this.mutate = this.mutate.bind(this); + this.resetStore = this.resetStore.bind(this); + this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); + var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && + typeof window !== 'undefined' && + !window.__APOLLO_CLIENT__; + if (typeof connectToDevTools === 'undefined' + ? defaultConnectToDevTools + : connectToDevTools && typeof window !== 'undefined') { + window.__APOLLO_CLIENT__ = this; + } + if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { + hasSuggestedDevtools = true; + if (typeof window !== 'undefined' && + window.document && + window.top === window.self) { + if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + if (window.navigator && + window.navigator.userAgent && + window.navigator.userAgent.indexOf('Chrome') > -1) { + console.debug('Download the Apollo DevTools ' + + 'for a better development experience: ' + + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); + } + } + } + } + this.version = version_1.version; + this.localState = new LocalState_1.LocalState({ + cache: cache, + client: this, + resolvers: resolvers, + fragmentMatcher: fragmentMatcher, + }); + this.queryManager = new QueryManager_1.QueryManager({ + link: this.link, + store: this.store, + queryDeduplication: queryDeduplication, + ssrMode: ssrMode, + clientAwareness: { + name: clientAwarenessName, + version: clientAwarenessVersion, + }, + localState: this.localState, + assumeImmutableResults: assumeImmutableResults, + onBroadcast: function () { + if (_this.devToolsHookCb) { + _this.devToolsHookCb({ + action: {}, + state: { + queries: _this.queryManager.queryStore.getStore(), + mutations: _this.queryManager.mutationStore.getStore(), + }, + dataWithOptimisticResults: _this.cache.extract(true), + }); + } + }, + }); + } + ApolloClient.prototype.stop = function () { + this.queryManager.stop(); + }; + ApolloClient.prototype.watchQuery = function (options) { + if (this.defaultOptions.watchQuery) { + options = tslib_1.__assign({}, this.defaultOptions.watchQuery, options); + } + if (this.disableNetworkFetches && + (options.fetchPolicy === 'network-only' || + options.fetchPolicy === 'cache-and-network')) { + options = tslib_1.__assign({}, options, { fetchPolicy: 'cache-first' }); + } + return this.queryManager.watchQuery(options); + }; + ApolloClient.prototype.query = function (options) { + if (this.defaultOptions.query) { + options = tslib_1.__assign({}, this.defaultOptions.query, options); + } + ts_invariant_1.invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + + 'client.query can only return a single result. Please use client.watchQuery ' + + 'to receive multiple results from the cache and the network, or consider ' + + 'using a different fetchPolicy, such as cache-first or network-only.'); + if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { + options = tslib_1.__assign({}, options, { fetchPolicy: 'cache-first' }); + } + return this.queryManager.query(options); + }; + ApolloClient.prototype.mutate = function (options) { + if (this.defaultOptions.mutate) { + options = tslib_1.__assign({}, this.defaultOptions.mutate, options); + } + return this.queryManager.mutate(options); + }; + ApolloClient.prototype.subscribe = function (options) { + return this.queryManager.startGraphQLSubscription(options); + }; + ApolloClient.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.cache.readQuery(options, optimistic); + }; + ApolloClient.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.cache.readFragment(options, optimistic); + }; + ApolloClient.prototype.writeQuery = function (options) { + var result = this.cache.writeQuery(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.writeFragment = function (options) { + var result = this.cache.writeFragment(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.writeData = function (options) { + var result = this.cache.writeData(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.__actionHookForDevTools = function (cb) { + this.devToolsHookCb = cb; + }; + ApolloClient.prototype.__requestRaw = function (payload) { + return apollo_link_1.execute(this.link, payload); + }; + ApolloClient.prototype.initQueryManager = function () { + ts_invariant_1.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + + 'and it will be removed from ApolloClient in version 3.0.'); + return this.queryManager; + }; + ApolloClient.prototype.resetStore = function () { + var _this = this; + return Promise.resolve() + .then(function () { return _this.queryManager.clearStore(); }) + .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); }) + .then(function () { return _this.reFetchObservableQueries(); }); + }; + ApolloClient.prototype.clearStore = function () { + var _this = this; + return Promise.resolve() + .then(function () { return _this.queryManager.clearStore(); }) + .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); }); + }; + ApolloClient.prototype.onResetStore = function (cb) { + var _this = this; + this.resetStoreCallbacks.push(cb); + return function () { + _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; }); + }; + }; + ApolloClient.prototype.onClearStore = function (cb) { + var _this = this; + this.clearStoreCallbacks.push(cb); + return function () { + _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; }); + }; + }; + ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { + return this.queryManager.reFetchObservableQueries(includeStandby); + }; + ApolloClient.prototype.extract = function (optimistic) { + return this.cache.extract(optimistic); + }; + ApolloClient.prototype.restore = function (serializedState) { + return this.cache.restore(serializedState); + }; + ApolloClient.prototype.addResolvers = function (resolvers) { + this.localState.addResolvers(resolvers); + }; + ApolloClient.prototype.setResolvers = function (resolvers) { + this.localState.setResolvers(resolvers); + }; + ApolloClient.prototype.getResolvers = function () { + return this.localState.getResolvers(); + }; + ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { + this.localState.setFragmentMatcher(fragmentMatcher); + }; + return ApolloClient; +}()); +exports.default = ApolloClient; +//# sourceMappingURL=ApolloClient.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.js.map b/node_modules/apollo-client/ApolloClient.js.map new file mode 100644 index 000000000..b44b128bf --- /dev/null +++ b/node_modules/apollo-client/ApolloClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloClient.js","sourceRoot":"","sources":["../src/ApolloClient.ts"],"names":[],"mappings":";;;AAAA,2CAKqB;AAIrB,6CAAyD;AAEzD,oDAAmD;AAOnD,gDAAgE;AAWhE,sCAAyC;AAEzC,qCAAoC;AAQpC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAwBjC;IAkDE,sBAAY,OAAyC;QAArD,iBAqIC;QA/KM,mBAAc,GAAmB,EAAE,CAAC;QAInC,wBAAmB,GAA8B,EAAE,CAAC;QACpD,wBAAmB,GAA8B,EAAE,CAAC;QAuCxD,IAAA,qBAAK,EACL,oBAAe,EAAf,oCAAe,EACf,+BAAsB,EAAtB,2CAAsB,EACtB,6CAAiB,EACjB,+BAAyB,EAAzB,8CAAyB,EACzB,uCAAc,EACd,mCAA8B,EAA9B,mDAA8B,EAC9B,6BAAS,EACT,2BAAQ,EACR,yCAAe,EACf,kCAAyB,EACzB,wCAA+B,CACrB;QAEN,IAAA,mBAAI,CAAa;QAIvB,IAAI,CAAC,IAAI,IAAI,SAAS,EAAE;YACtB,IAAI,GAAG,wBAAU,CAAC,KAAK,EAAE,CAAC;SAC3B;QAED,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;YACnB,MAAM,IAAI,6BAAc,CACtB,+GAA+G;gBAC/G,kHAAkH;gBAClH,iHAAiH,CAClH,CAAC;SACH;QAGD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG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AAe,CAAC,CAAC;IACtD,CAAC;IACH,mBAAC;AAAD,CAAC,AA3gBD,IA2gBC"} \ No newline at end of file diff --git a/node_modules/apollo-client/LICENSE b/node_modules/apollo-client/LICENSE new file mode 100644 index 000000000..278ee9d8c --- /dev/null +++ b/node_modules/apollo-client/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/apollo-client/README.md b/node_modules/apollo-client/README.md new file mode 100644 index 000000000..97720451c --- /dev/null +++ b/node_modules/apollo-client/README.md @@ -0,0 +1,127 @@ +# [Apollo Client](https://www.apollographql.com/client/) [![npm version](https://badge.fury.io/js/apollo-client.svg)](https://badge.fury.io/js/apollo-client) [![Open Source Helpers](https://www.codetriage.com/apollographql/apollo-client/badges/users.svg)](https://www.codetriage.com/apollographql/apollo-client) + +Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL. To get the most value out of `apollo-client`, you should use it with one of its view layer integrations. + +To get started with the React integration, go to our [**React Apollo documentation website**](https://www.apollographql.com/docs/react/). + +Apollo Client also has view layer integrations for [all the popular frontend frameworks](#learn-how-to-use-apollo-client-with-your-favorite-framework). For the best experience, make sure to use the view integration layer for your frontend framework of choice. + +Apollo Client can be used in any JavaScript frontend where you want to use data from a GraphQL server. It's: + +1. **Incrementally adoptable**, so that you can drop it into an existing JavaScript app and start using GraphQL for just part of your UI. +2. **Universally compatible**, so that Apollo works with any build setup, any GraphQL server, and any GraphQL schema. +3. **Simple to get started with**, so you can start loading data right away and learn about advanced features later. +4. **Inspectable and understandable**, so that you can have great developer tools to understand exactly what is happening in your app. +5. **Built for interactive apps**, so your users can make changes and see them reflected in the UI immediately. +6. **Small and flexible**, so you don't get stuff you don't need. The core is under 25kb compressed. +7. **Community driven**, because Apollo is driven by the community and serves a variety of use cases. Everything is planned and developed in the open. + +Get started on the [home page](http://apollographql.com/client), which has great examples for a variety of frameworks. + +## Installation + +```bash +# installing the preset package +npm install apollo-boost graphql-tag graphql --save +# installing each piece independently +npm install apollo-client apollo-cache-inmemory apollo-link-http graphql-tag graphql --save +``` + +To use this client in a web browser or mobile app, you'll need a build system capable of loading NPM packages on the client. Some common choices include Browserify, Webpack, and Meteor 1.3+. + +Install the [Apollo Client Developer tools for Chrome](https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm) for a great GraphQL developer experience! + +## Usage + +You get started by constructing an instance of the core class [`ApolloClient`][]. If you load `ApolloClient` from the [`apollo-boost`][] package, it will be configured with a few reasonable defaults such as our standard in-memory cache and a link to a GraphQL API at `/graphql`. + +```js +import ApolloClient from 'apollo-boost'; + +const client = new ApolloClient(); +``` + + +To point `ApolloClient` at a different URL, add your GraphQL API's URL to the `uri` config property: + +```js +import ApolloClient from 'apollo-boost'; + +const client = new ApolloClient({ + uri: 'https://graphql.example.com' +}); +``` + +Most of the time you'll hook up your client to a frontend integration. But if you'd like to directly execute a query with your client, you may now call the `client.query` method like this: + +```js +import gql from 'graphql-tag'; + +client.query({ + query: gql` + query TodoApp { + todos { + id + text + completed + } + } + `, +}) + .then(data => console.log(data)) + .catch(error => console.error(error)); +``` + +Now your client will be primed with some data in its cache. You can continue to make queries, or you can get your `client` instance to perform all sorts of advanced tasks on your GraphQL data. Such as [reactively watching queries with `watchQuery`][], [changing data on your server with `mutate`][], or [reading a fragment from your local cache with `readFragment`][]. + +To learn more about all of the features available to you through the `apollo-client` package, be sure to read through the [**`apollo-client` API reference**](https://www.apollographql.com/docs/react/api/apollo-client.html). + +[`ApolloClient`]: https://www.apollographql.com/docs/react/api/apollo-client.html +[`apollo-boost`]: https://www.apollographql.com/docs/react/essentials/get-started.html#apollo-boost +[reactively watching queries with `watchQuery`]: https://www.apollographql.com/docs/react/api/apollo-client.html#ApolloClient.watchQuery +[changing data on your server with `mutate`]: https://www.apollographql.com/docs/react/essentials/mutations.html +[reading a fragment from your local cache with `readFragment`]: https://www.apollographql.com/docs/react/advanced/caching.html#direct + +## Learn how to use Apollo Client with your favorite framework + +- [React](http://apollographql.com/docs/react/) +- [Angular](http://apollographql.com/docs/angular/) +- [Vue](https://github.com/Akryum/vue-apollo) +- [Ember](https://github.com/bgentry/ember-apollo-client) +- [Web Components](https://github.com/apollo-elements/apollo-elements) +- [Meteor](http://apollographql.com/docs/react/recipes/meteor.html) +- [Blaze](http://github.com/Swydo/blaze-apollo) +- [Vanilla JS](https://www.apollographql.com/docs/react/api/apollo-client.html) +- [Next.js](https://github.com/zeit/next.js/tree/master/examples/with-apollo) + +--- + +## Contributing + +[![CircleCI](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client) +[![codecov](https://codecov.io/gh/apollographql/apollo-client/branch/master/graph/badge.svg)](https://codecov.io/gh/apollographql/apollo-client) + +[Read the Apollo Contributor Guidelines.](CONTRIBUTING.md) + +Running tests locally: + +``` +npm install +npm test +``` + +This project uses TypeScript for static typing and TSLint for linting. You can get both of these built into your editor with no configuration by opening this project in [Visual Studio Code](https://code.visualstudio.com/), an open source IDE which is available for free on all platforms. + +#### Important discussions + +If you're getting booted up as a contributor, here are some discussions you should take a look at: + +1. [Static typing and why we went with TypeScript](https://github.com/apollostack/apollo-client/issues/6) also covered in [the Medium post](https://medium.com/apollo-stack/javascript-code-quality-with-free-tools-9a6d80e29f2d#.k32z401au) +1. [Idea for pagination handling](https://github.com/apollostack/apollo-client/issues/26) +1. [Discussion about interaction with Redux and domain vs. client state](https://github.com/apollostack/apollo-client/issues/98) +1. [Long conversation about different client options, before this repo existed](https://github.com/apollostack/apollo/issues/1) + +## Maintainers + +- [@benjamn](https://github.com/benjamn) (Apollo) +- [@hwillson](https://github.com/hwillson) (Apollo) diff --git a/node_modules/apollo-client/bundle.cjs.js b/node_modules/apollo-client/bundle.cjs.js new file mode 100644 index 000000000..586d02aed --- /dev/null +++ b/node_modules/apollo-client/bundle.cjs.js @@ -0,0 +1,2722 @@ +exports.__esModule = true; +exports.isApolloError = isApolloError; +exports.ObservableQuery = exports.NetworkStatus = exports.FetchType = exports.ApolloError = exports.ApolloClient = exports.default = void 0; + +var _tslib = require("tslib"); + +var _apolloUtilities = require("apollo-utilities"); + +var _apolloLink = require("apollo-link"); + +var _symbolObservable = _interopRequireDefault(require("symbol-observable")); + +var _tsInvariant = require("ts-invariant"); + +var _visitor = require("graphql/language/visitor"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NetworkStatus; +exports.NetworkStatus = NetworkStatus; + +(function (NetworkStatus) { + NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; + NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; + NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; + NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; + NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; + NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; + NetworkStatus[NetworkStatus["error"] = 8] = "error"; +})(NetworkStatus || (exports.NetworkStatus = NetworkStatus = {})); + +function isNetworkRequestInFlight(networkStatus) { + return networkStatus < 7; +} + +var Observable = function (_super) { + (0, _tslib.__extends)(Observable, _super); + + function Observable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + Observable.prototype[_symbolObservable.default] = function () { + return this; + }; + + Observable.prototype['@@observable'] = function () { + return this; + }; + + return Observable; +}(_apolloLink.Observable); + +function isNonEmptyArray(value) { + return Array.isArray(value) && value.length > 0; +} + +function isApolloError(err) { + return err.hasOwnProperty('graphQLErrors'); +} + +var generateErrorMessage = function (err) { + var message = ''; + + if (isNonEmptyArray(err.graphQLErrors)) { + err.graphQLErrors.forEach(function (graphQLError) { + var errorMessage = graphQLError ? graphQLError.message : 'Error message not found.'; + message += "GraphQL error: " + errorMessage + "\n"; + }); + } + + if (err.networkError) { + message += 'Network error: ' + err.networkError.message + '\n'; + } + + message = message.replace(/\n$/, ''); + return message; +}; + +var ApolloError = function (_super) { + (0, _tslib.__extends)(ApolloError, _super); + + function ApolloError(_a) { + var graphQLErrors = _a.graphQLErrors, + networkError = _a.networkError, + errorMessage = _a.errorMessage, + extraInfo = _a.extraInfo; + + var _this = _super.call(this, errorMessage) || this; + + _this.graphQLErrors = graphQLErrors || []; + _this.networkError = networkError || null; + + if (!errorMessage) { + _this.message = generateErrorMessage(_this); + } else { + _this.message = errorMessage; + } + + _this.extraInfo = extraInfo; + _this.__proto__ = ApolloError.prototype; + return _this; + } + + return ApolloError; +}(Error); + +exports.ApolloError = ApolloError; +var FetchType; +exports.FetchType = FetchType; + +(function (FetchType) { + FetchType[FetchType["normal"] = 1] = "normal"; + FetchType[FetchType["refetch"] = 2] = "refetch"; + FetchType[FetchType["poll"] = 3] = "poll"; +})(FetchType || (exports.FetchType = FetchType = {})); + +var hasError = function (storeValue, policy) { + if (policy === void 0) { + policy = 'none'; + } + + return storeValue && (storeValue.networkError || policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors)); +}; + +var ObservableQuery = function (_super) { + (0, _tslib.__extends)(ObservableQuery, _super); + + function ObservableQuery(_a) { + var queryManager = _a.queryManager, + options = _a.options, + _b = _a.shouldSubscribe, + shouldSubscribe = _b === void 0 ? true : _b; + + var _this = _super.call(this, function (observer) { + return _this.onSubscribe(observer); + }) || this; + + _this.observers = new Set(); + _this.subscriptions = new Set(); + _this.isTornDown = false; + _this.options = options; + _this.variables = options.variables || {}; + _this.queryId = queryManager.generateQueryId(); + _this.shouldSubscribe = shouldSubscribe; + var opDef = (0, _apolloUtilities.getOperationDefinition)(options.query); + _this.queryName = opDef && opDef.name && opDef.name.value; + _this.queryManager = queryManager; + return _this; + } + + ObservableQuery.prototype.result = function () { + var _this = this; + + return new Promise(function (resolve, reject) { + var observer = { + next: function (result) { + resolve(result); + + _this.observers.delete(observer); + + if (!_this.observers.size) { + _this.queryManager.removeQuery(_this.queryId); + } + + setTimeout(function () { + subscription.unsubscribe(); + }, 0); + }, + error: reject + }; + + var subscription = _this.subscribe(observer); + }); + }; + + ObservableQuery.prototype.currentResult = function () { + var result = this.getCurrentResult(); + + if (result.data === undefined) { + result.data = {}; + } + + return result; + }; + + ObservableQuery.prototype.getCurrentResult = function () { + if (this.isTornDown) { + var lastResult = this.lastResult; + return { + data: !this.lastError && lastResult && lastResult.data || void 0, + error: this.lastError, + loading: false, + networkStatus: NetworkStatus.error + }; + } + + var _a = this.queryManager.getCurrentQueryResult(this), + data = _a.data, + partial = _a.partial; + + var queryStoreValue = this.queryManager.queryStore.get(this.queryId); + var result; + var fetchPolicy = this.options.fetchPolicy; + var isNetworkFetchPolicy = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + + if (queryStoreValue) { + var networkStatus = queryStoreValue.networkStatus; + + if (hasError(queryStoreValue, this.options.errorPolicy)) { + return { + data: void 0, + loading: false, + networkStatus: networkStatus, + error: new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError + }) + }; + } + + if (queryStoreValue.variables) { + this.options.variables = (0, _tslib.__assign)({}, this.options.variables, queryStoreValue.variables); + this.variables = this.options.variables; + } + + result = { + data: data, + loading: isNetworkRequestInFlight(networkStatus), + networkStatus: networkStatus + }; + + if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { + result.errors = queryStoreValue.graphQLErrors; + } + } else { + var loading = isNetworkFetchPolicy || partial && fetchPolicy !== 'cache-only'; + result = { + data: data, + loading: loading, + networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready + }; + } + + if (!partial) { + this.updateLastResult((0, _tslib.__assign)({}, result, { + stale: false + })); + } + + return (0, _tslib.__assign)({}, result, { + partial: partial + }); + }; + + ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { + var snapshot = this.lastResultSnapshot; + return !(snapshot && newResult && snapshot.networkStatus === newResult.networkStatus && snapshot.stale === newResult.stale && (0, _apolloUtilities.isEqual)(snapshot.data, newResult.data)); + }; + + ObservableQuery.prototype.getLastResult = function () { + return this.lastResult; + }; + + ObservableQuery.prototype.getLastError = function () { + return this.lastError; + }; + + ObservableQuery.prototype.resetLastResults = function () { + delete this.lastResult; + delete this.lastResultSnapshot; + delete this.lastError; + this.isTornDown = false; + }; + + ObservableQuery.prototype.resetQueryStoreErrors = function () { + var queryStore = this.queryManager.queryStore.get(this.queryId); + + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + }; + + ObservableQuery.prototype.refetch = function (variables) { + var fetchPolicy = this.options.fetchPolicy; + + if (fetchPolicy === 'cache-only') { + return Promise.reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); + } + + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'cache-and-network') { + fetchPolicy = 'network-only'; + } + + if (!(0, _apolloUtilities.isEqual)(this.variables, variables)) { + this.variables = (0, _tslib.__assign)({}, this.variables, variables); + } + + if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { + this.options.variables = (0, _tslib.__assign)({}, this.options.variables, this.variables); + } + + return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)({}, this.options, { + fetchPolicy: fetchPolicy + }), FetchType.refetch); + }; + + ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { + var _this = this; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 4) : (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); + var combinedOptions = (0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)({}, this.options, fetchMoreOptions, { + variables: (0, _tslib.__assign)({}, this.variables, fetchMoreOptions.variables) + }), { + fetchPolicy: 'network-only' + }); + var qid = this.queryManager.generateQueryId(); + return this.queryManager.fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId).then(function (fetchMoreResult) { + _this.updateQuery(function (previousResult) { + return fetchMoreOptions.updateQuery(previousResult, { + fetchMoreResult: fetchMoreResult.data, + variables: combinedOptions.variables + }); + }); + + _this.queryManager.stopQuery(qid); + + return fetchMoreResult; + }, function (error) { + _this.queryManager.stopQuery(qid); + + throw error; + }); + }; + + ObservableQuery.prototype.subscribeToMore = function (options) { + var _this = this; + + var subscription = this.queryManager.startGraphQLSubscription({ + query: options.document, + variables: options.variables + }).subscribe({ + next: function (subscriptionData) { + var updateQuery = options.updateQuery; + + if (updateQuery) { + _this.updateQuery(function (previous, _a) { + var variables = _a.variables; + return updateQuery(previous, { + subscriptionData: subscriptionData, + variables: variables + }); + }); + } + }, + error: function (err) { + if (options.onError) { + options.onError(err); + return; + } + + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled GraphQL subscription error', err); + } + }); + this.subscriptions.add(subscription); + return function () { + if (_this.subscriptions.delete(subscription)) { + subscription.unsubscribe(); + } + }; + }; + + ObservableQuery.prototype.setOptions = function (opts) { + var oldFetchPolicy = this.options.fetchPolicy; + this.options = (0, _tslib.__assign)({}, this.options, opts); + + if (opts.pollInterval) { + this.startPolling(opts.pollInterval); + } else if (opts.pollInterval === 0) { + this.stopPolling(); + } + + var fetchPolicy = opts.fetchPolicy; + return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || oldFetchPolicy === 'standby' || fetchPolicy === 'network-only'), opts.fetchResults); + }; + + ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { + if (tryFetch === void 0) { + tryFetch = false; + } + + if (fetchResults === void 0) { + fetchResults = true; + } + + this.isTornDown = false; + variables = variables || this.variables; + + if (!tryFetch && (0, _apolloUtilities.isEqual)(variables, this.variables)) { + return this.observers.size && fetchResults ? this.result() : Promise.resolve(); + } + + this.variables = this.options.variables = variables; + + if (!this.observers.size) { + return Promise.resolve(); + } + + return this.queryManager.fetchQuery(this.queryId, this.options); + }; + + ObservableQuery.prototype.updateQuery = function (mapFn) { + var queryManager = this.queryManager; + + var _a = queryManager.getQueryWithPreviousResult(this.queryId), + previousResult = _a.previousResult, + variables = _a.variables, + document = _a.document; + + var newResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return mapFn(previousResult, { + variables: variables + }); + }); + + if (newResult) { + queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); + queryManager.broadcastQueries(); + } + }; + + ObservableQuery.prototype.stopPolling = function () { + this.queryManager.stopPollingQuery(this.queryId); + this.options.pollInterval = undefined; + }; + + ObservableQuery.prototype.startPolling = function (pollInterval) { + assertNotCacheFirstOrOnly(this); + this.options.pollInterval = pollInterval; + this.queryManager.startPollingQuery(this.options, this.queryId); + }; + + ObservableQuery.prototype.updateLastResult = function (newResult) { + var previousResult = this.lastResult; + this.lastResult = newResult; + this.lastResultSnapshot = this.queryManager.assumeImmutableResults ? newResult : (0, _apolloUtilities.cloneDeep)(newResult); + return previousResult; + }; + + ObservableQuery.prototype.onSubscribe = function (observer) { + var _this = this; + + try { + var subObserver = observer._subscription._observer; + + if (subObserver && !subObserver.error) { + subObserver.error = defaultSubscriptionObserverErrorCallback; + } + } catch (_a) {} + + var first = !this.observers.size; + this.observers.add(observer); + if (observer.next && this.lastResult) observer.next(this.lastResult); + if (observer.error && this.lastError) observer.error(this.lastError); + + if (first) { + this.setUpQuery(); + } + + return function () { + if (_this.observers.delete(observer) && !_this.observers.size) { + _this.tearDownQuery(); + } + }; + }; + + ObservableQuery.prototype.setUpQuery = function () { + var _this = this; + + var _a = this, + queryManager = _a.queryManager, + queryId = _a.queryId; + + if (this.shouldSubscribe) { + queryManager.addObservableQuery(queryId, this); + } + + if (this.options.pollInterval) { + assertNotCacheFirstOrOnly(this); + queryManager.startPollingQuery(this.options, queryId); + } + + var onError = function (error) { + iterateObserversSafely(_this.observers, 'error', _this.lastError = error); + }; + + queryManager.observeQuery(queryId, this.options, { + next: function (result) { + if (_this.lastError || _this.isDifferentFromLastResult(result)) { + var previousResult_1 = _this.updateLastResult(result); + + var _a = _this.options, + query_1 = _a.query, + variables = _a.variables, + fetchPolicy_1 = _a.fetchPolicy; + + if (queryManager.transform(query_1).hasClientExports) { + queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { + var previousVariables = _this.variables; + _this.variables = _this.options.variables = variables; + + if (!result.loading && previousResult_1 && fetchPolicy_1 !== 'cache-only' && queryManager.transform(query_1).serverQuery && !(0, _apolloUtilities.isEqual)(previousVariables, variables)) { + _this.refetch(); + } else { + iterateObserversSafely(_this.observers, 'next', result); + } + }); + } else { + iterateObserversSafely(_this.observers, 'next', result); + } + } + }, + error: onError + }).catch(onError); + }; + + ObservableQuery.prototype.tearDownQuery = function () { + var queryManager = this.queryManager; + this.isTornDown = true; + queryManager.stopPollingQuery(this.queryId); + this.subscriptions.forEach(function (sub) { + return sub.unsubscribe(); + }); + this.subscriptions.clear(); + queryManager.removeObservableQuery(this.queryId); + queryManager.stopQuery(this.queryId); + this.observers.clear(); + }; + + return ObservableQuery; +}(Observable); + +exports.ObservableQuery = ObservableQuery; + +function defaultSubscriptionObserverErrorCallback(error) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled error', error.message, error.stack); +} + +function iterateObserversSafely(observers, method, argument) { + var observersWithMethod = []; + observers.forEach(function (obs) { + return obs[method] && observersWithMethod.push(obs); + }); + observersWithMethod.forEach(function (obs) { + return obs[method](argument); + }); +} + +function assertNotCacheFirstOrOnly(obsQuery) { + var fetchPolicy = obsQuery.options.fetchPolicy; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 5) : (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); +} + +var MutationStore = function () { + function MutationStore() { + this.store = {}; + } + + MutationStore.prototype.getStore = function () { + return this.store; + }; + + MutationStore.prototype.get = function (mutationId) { + return this.store[mutationId]; + }; + + MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { + this.store[mutationId] = { + mutation: mutation, + variables: variables || {}, + loading: true, + error: null + }; + }; + + MutationStore.prototype.markMutationError = function (mutationId, error) { + var mutation = this.store[mutationId]; + + if (mutation) { + mutation.loading = false; + mutation.error = error; + } + }; + + MutationStore.prototype.markMutationResult = function (mutationId) { + var mutation = this.store[mutationId]; + + if (mutation) { + mutation.loading = false; + mutation.error = null; + } + }; + + MutationStore.prototype.reset = function () { + this.store = {}; + }; + + return MutationStore; +}(); + +var QueryStore = function () { + function QueryStore() { + this.store = {}; + } + + QueryStore.prototype.getStore = function () { + return this.store; + }; + + QueryStore.prototype.get = function (queryId) { + return this.store[queryId]; + }; + + QueryStore.prototype.initQuery = function (query) { + var previousQuery = this.store[query.queryId]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 19) : (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); + var isSetVariables = false; + var previousVariables = null; + + if (query.storePreviousVariables && previousQuery && previousQuery.networkStatus !== NetworkStatus.loading) { + if (!(0, _apolloUtilities.isEqual)(previousQuery.variables, query.variables)) { + isSetVariables = true; + previousVariables = previousQuery.variables; + } + } + + var networkStatus; + + if (isSetVariables) { + networkStatus = NetworkStatus.setVariables; + } else if (query.isPoll) { + networkStatus = NetworkStatus.poll; + } else if (query.isRefetch) { + networkStatus = NetworkStatus.refetch; + } else { + networkStatus = NetworkStatus.loading; + } + + var graphQLErrors = []; + + if (previousQuery && previousQuery.graphQLErrors) { + graphQLErrors = previousQuery.graphQLErrors; + } + + this.store[query.queryId] = { + document: query.document, + variables: query.variables, + previousVariables: previousVariables, + networkError: null, + graphQLErrors: graphQLErrors, + networkStatus: networkStatus, + metadata: query.metadata + }; + + if (typeof query.fetchMoreForQueryId === 'string' && this.store[query.fetchMoreForQueryId]) { + this.store[query.fetchMoreForQueryId].networkStatus = NetworkStatus.fetchMore; + } + }; + + QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) return; + this.store[queryId].networkError = null; + this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; + this.store[queryId].previousVariables = null; + this.store[queryId].networkStatus = NetworkStatus.ready; + + if (typeof fetchMoreForQueryId === 'string' && this.store[fetchMoreForQueryId]) { + this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; + } + }; + + QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) return; + this.store[queryId].networkError = error; + this.store[queryId].networkStatus = NetworkStatus.error; + + if (typeof fetchMoreForQueryId === 'string') { + this.markQueryResultClient(fetchMoreForQueryId, true); + } + }; + + QueryStore.prototype.markQueryResultClient = function (queryId, complete) { + var storeValue = this.store && this.store[queryId]; + + if (storeValue) { + storeValue.networkError = null; + storeValue.previousVariables = null; + + if (complete) { + storeValue.networkStatus = NetworkStatus.ready; + } + } + }; + + QueryStore.prototype.stopQuery = function (queryId) { + delete this.store[queryId]; + }; + + QueryStore.prototype.reset = function (observableQueryIds) { + var _this = this; + + Object.keys(this.store).forEach(function (queryId) { + if (observableQueryIds.indexOf(queryId) < 0) { + _this.stopQuery(queryId); + } else { + _this.store[queryId].networkStatus = NetworkStatus.loading; + } + }); + }; + + return QueryStore; +}(); + +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +var LocalState = function () { + function LocalState(_a) { + var cache = _a.cache, + client = _a.client, + resolvers = _a.resolvers, + fragmentMatcher = _a.fragmentMatcher; + this.cache = cache; + + if (client) { + this.client = client; + } + + if (resolvers) { + this.addResolvers(resolvers); + } + + if (fragmentMatcher) { + this.setFragmentMatcher(fragmentMatcher); + } + } + + LocalState.prototype.addResolvers = function (resolvers) { + var _this = this; + + this.resolvers = this.resolvers || {}; + + if (Array.isArray(resolvers)) { + resolvers.forEach(function (resolverGroup) { + _this.resolvers = (0, _apolloUtilities.mergeDeep)(_this.resolvers, resolverGroup); + }); + } else { + this.resolvers = (0, _apolloUtilities.mergeDeep)(this.resolvers, resolvers); + } + }; + + LocalState.prototype.setResolvers = function (resolvers) { + this.resolvers = {}; + this.addResolvers(resolvers); + }; + + LocalState.prototype.getResolvers = function () { + return this.resolvers || {}; + }; + + LocalState.prototype.runResolvers = function (_a) { + var document = _a.document, + remoteResult = _a.remoteResult, + context = _a.context, + variables = _a.variables, + _b = _a.onlyRunForcedResolvers, + onlyRunForcedResolvers = _b === void 0 ? false : _b; + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + return (0, _tslib.__generator)(this, function (_c) { + if (document) { + return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { + return (0, _tslib.__assign)({}, remoteResult, { + data: localResult.result + }); + })]; + } + + return [2, remoteResult]; + }); + }); + }; + + LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { + this.fragmentMatcher = fragmentMatcher; + }; + + LocalState.prototype.getFragmentMatcher = function () { + return this.fragmentMatcher; + }; + + LocalState.prototype.clientQuery = function (document) { + if ((0, _apolloUtilities.hasDirectives)(['client'], document)) { + if (this.resolvers) { + return document; + } + + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + 'were specified. This means ApolloClient local resolver handling ' + 'has been disabled, and @client directives will be passed through ' + 'to your link chain.'); + } + + return null; + }; + + LocalState.prototype.serverQuery = function (document) { + return this.resolvers ? (0, _apolloUtilities.removeClientSetsFromDocument)(document) : document; + }; + + LocalState.prototype.prepareContext = function (context) { + if (context === void 0) { + context = {}; + } + + var cache = this.cache; + var newContext = (0, _tslib.__assign)({}, context, { + cache: cache, + getCacheKey: function (obj) { + if (cache.config) { + return cache.config.dataIdFromObject(obj); + } else { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(false, 17) : (0, _tsInvariant.invariant)(false, 'To use context.getCacheKey, you need to use a cache that has ' + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); + } + } + }); + return newContext; + }; + + LocalState.prototype.addExportedVariables = function (document, variables, context) { + if (variables === void 0) { + variables = {}; + } + + if (context === void 0) { + context = {}; + } + + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + return (0, _tslib.__generator)(this, function (_a) { + if (document) { + return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { + return (0, _tslib.__assign)({}, variables, data.exportedVariables); + })]; + } + + return [2, (0, _tslib.__assign)({}, variables)]; + }); + }); + }; + + LocalState.prototype.shouldForceResolvers = function (document) { + var forceResolvers = false; + (0, _visitor.visit)(document, { + Directive: { + enter: function (node) { + if (node.name.value === 'client' && node.arguments) { + forceResolvers = node.arguments.some(function (arg) { + return arg.name.value === 'always' && arg.value.kind === 'BooleanValue' && arg.value.value === true; + }); + + if (forceResolvers) { + return _visitor.BREAK; + } + } + } + } + }); + return forceResolvers; + }; + + LocalState.prototype.buildRootValueFromCache = function (document, variables) { + return this.cache.diff({ + query: (0, _apolloUtilities.buildQueryFromSelectionSet)(document), + variables: variables, + returnPartialData: true, + optimistic: false + }).result; + }; + + LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { + if (context === void 0) { + context = {}; + } + + if (variables === void 0) { + variables = {}; + } + + if (fragmentMatcher === void 0) { + fragmentMatcher = function () { + return true; + }; + } + + if (onlyRunForcedResolvers === void 0) { + onlyRunForcedResolvers = false; + } + + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; + + return (0, _tslib.__generator)(this, function (_b) { + mainDefinition = (0, _apolloUtilities.getMainDefinition)(document); + fragments = (0, _apolloUtilities.getFragmentDefinitions)(document); + fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); + definitionOperation = mainDefinition.operation; + defaultOperationType = definitionOperation ? capitalizeFirstLetter(definitionOperation) : 'Query'; + _a = this, cache = _a.cache, client = _a.client; + execContext = { + fragmentMap: fragmentMap, + context: (0, _tslib.__assign)({}, context, { + cache: cache, + client: client + }), + variables: variables, + fragmentMatcher: fragmentMatcher, + defaultOperationType: defaultOperationType, + exportedVariables: {}, + onlyRunForcedResolvers: onlyRunForcedResolvers + }; + return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { + return { + result: result, + exportedVariables: execContext.exportedVariables + }; + })]; + }); + }); + }; + + LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var fragmentMap, context, variables, resultsToMerge, execute; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_a) { + fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; + resultsToMerge = [rootValue]; + + execute = function (selection) { + return (0, _tslib.__awaiter)(_this, void 0, void 0, function () { + var fragment, typeCondition; + return (0, _tslib.__generator)(this, function (_a) { + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return [2]; + } + + if ((0, _apolloUtilities.isField)(selection)) { + return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { + var _a; + + if (typeof fieldResult !== 'undefined') { + resultsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); + } + })]; + } + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = fragmentMap[selection.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 18) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value); + } + + if (fragment && fragment.typeCondition) { + typeCondition = fragment.typeCondition.name.value; + + if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { + return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { + resultsToMerge.push(fragmentResult); + })]; + } + } + + return [2]; + }); + }); + }; + + return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { + return (0, _apolloUtilities.mergeDeepArray)(resultsToMerge); + })]; + }); + }); + }; + + LocalState.prototype.resolveField = function (field, rootValue, execContext) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_a) { + variables = execContext.variables; + fieldName = field.name.value; + aliasedFieldName = (0, _apolloUtilities.resultKeyNameFromField)(field); + aliasUsed = fieldName !== aliasedFieldName; + defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; + resultPromise = Promise.resolve(defaultResult); + + if (!execContext.onlyRunForcedResolvers || this.shouldForceResolvers(field)) { + resolverType = rootValue.__typename || execContext.defaultOperationType; + resolverMap = this.resolvers && this.resolvers[resolverType]; + + if (resolverMap) { + resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; + + if (resolve) { + resultPromise = Promise.resolve(resolve(rootValue, (0, _apolloUtilities.argumentsObjectFromField)(field, variables), execContext.context, { + field: field + })); + } + } + } + + return [2, resultPromise.then(function (result) { + if (result === void 0) { + result = defaultResult; + } + + if (field.directives) { + field.directives.forEach(function (directive) { + if (directive.name.value === 'export' && directive.arguments) { + directive.arguments.forEach(function (arg) { + if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { + execContext.exportedVariables[arg.value.value] = result; + } + }); + } + }); + } + + if (!field.selectionSet) { + return result; + } + + if (result == null) { + return result; + } + + if (Array.isArray(result)) { + return _this.resolveSubSelectedArray(field, result, execContext); + } + + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, result, execContext); + } + })]; + }); + }); + }; + + LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { + var _this = this; + + return Promise.all(result.map(function (item) { + if (item === null) { + return null; + } + + if (Array.isArray(item)) { + return _this.resolveSubSelectedArray(field, item, execContext); + } + + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, item, execContext); + } + })); + }; + + return LocalState; +}(); + +function multiplex(inner) { + var observers = new Set(); + var sub = null; + return new Observable(function (observer) { + observers.add(observer); + sub = sub || inner.subscribe({ + next: function (value) { + observers.forEach(function (obs) { + return obs.next && obs.next(value); + }); + }, + error: function (error) { + observers.forEach(function (obs) { + return obs.error && obs.error(error); + }); + }, + complete: function () { + observers.forEach(function (obs) { + return obs.complete && obs.complete(); + }); + } + }); + return function () { + if (observers.delete(observer) && !observers.size && sub) { + sub.unsubscribe(); + sub = null; + } + }; + }); +} + +function asyncMap(observable, mapFn) { + return new Observable(function (observer) { + var next = observer.next, + error = observer.error, + complete = observer.complete; + var activeNextCount = 0; + var completed = false; + var handler = { + next: function (value) { + ++activeNextCount; + new Promise(function (resolve) { + resolve(mapFn(value)); + }).then(function (result) { + --activeNextCount; + next && next.call(observer, result); + completed && handler.complete(); + }, function (e) { + --activeNextCount; + error && error.call(observer, e); + }); + }, + error: function (e) { + error && error.call(observer, e); + }, + complete: function () { + completed = true; + + if (!activeNextCount) { + complete && complete.call(observer); + } + } + }; + var sub = observable.subscribe(handler); + return function () { + return sub.unsubscribe(); + }; + }); +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var QueryManager = function () { + function QueryManager(_a) { + var link = _a.link, + _b = _a.queryDeduplication, + queryDeduplication = _b === void 0 ? false : _b, + store = _a.store, + _c = _a.onBroadcast, + onBroadcast = _c === void 0 ? function () { + return undefined; + } : _c, + _d = _a.ssrMode, + ssrMode = _d === void 0 ? false : _d, + _e = _a.clientAwareness, + clientAwareness = _e === void 0 ? {} : _e, + localState = _a.localState, + assumeImmutableResults = _a.assumeImmutableResults; + this.mutationStore = new MutationStore(); + this.queryStore = new QueryStore(); + this.clientAwareness = {}; + this.idCounter = 1; + this.queries = new Map(); + this.fetchQueryRejectFns = new Map(); + this.transformCache = new (_apolloUtilities.canUseWeakMap ? WeakMap : Map)(); + this.inFlightLinkObservables = new Map(); + this.pollingInfoByQueryId = new Map(); + this.link = link; + this.queryDeduplication = queryDeduplication; + this.dataStore = store; + this.onBroadcast = onBroadcast; + this.clientAwareness = clientAwareness; + this.localState = localState || new LocalState({ + cache: store.getCache() + }); + this.ssrMode = ssrMode; + this.assumeImmutableResults = !!assumeImmutableResults; + } + + QueryManager.prototype.stop = function () { + var _this = this; + + this.queries.forEach(function (_info, queryId) { + _this.stopQueryNoBroadcast(queryId); + }); + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(6) : new _tsInvariant.InvariantError('QueryManager stopped while query was in flight')); + }); + }; + + QueryManager.prototype.mutate = function (_a) { + var mutation = _a.mutation, + variables = _a.variables, + optimisticResponse = _a.optimisticResponse, + updateQueriesByName = _a.updateQueries, + _b = _a.refetchQueries, + refetchQueries = _b === void 0 ? [] : _b, + _c = _a.awaitRefetchQueries, + awaitRefetchQueries = _c === void 0 ? false : _c, + updateWithProxyFn = _a.update, + _d = _a.errorPolicy, + errorPolicy = _d === void 0 ? 'none' : _d, + fetchPolicy = _a.fetchPolicy, + _e = _a.context, + context = _e === void 0 ? {} : _e; + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var mutationId, generateUpdateQueriesInfo, self; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_f) { + switch (_f.label) { + case 0: + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutation, 7) : (0, _tsInvariant.invariant)(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', 8) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "fetchPolicy for mutations currently only supports the 'no-cache' policy"); + mutationId = this.generateQueryId(); + mutation = this.transform(mutation).document; + this.setQuery(mutationId, function () { + return { + document: mutation + }; + }); + variables = this.getVariables(mutation, variables); + if (!this.transform(mutation).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(mutation, variables, context)]; + + case 1: + variables = _f.sent(); + _f.label = 2; + + case 2: + generateUpdateQueriesInfo = function () { + var ret = {}; + + if (updateQueriesByName) { + _this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + + if (observableQuery) { + var queryName = observableQuery.queryName; + + if (queryName && hasOwnProperty.call(updateQueriesByName, queryName)) { + ret[queryId] = { + updater: updateQueriesByName[queryName], + query: _this.queryStore.get(queryId) + }; + } + } + }); + } + + return ret; + }; + + this.mutationStore.initMutation(mutationId, mutation, variables); + this.dataStore.markMutationInit({ + mutationId: mutationId, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + optimisticResponse: optimisticResponse + }); + this.broadcastQueries(); + self = this; + return [2, new Promise(function (resolve, reject) { + var storeResult; + var error; + self.getObservableFromLink(mutation, (0, _tslib.__assign)({}, context, { + optimisticResponse: optimisticResponse + }), variables, false).subscribe({ + next: function (result) { + if ((0, _apolloUtilities.graphQLResultHasError)(result) && errorPolicy === 'none') { + error = new ApolloError({ + graphQLErrors: result.errors + }); + return; + } + + self.mutationStore.markMutationResult(mutationId); + + if (fetchPolicy !== 'no-cache') { + self.dataStore.markMutationResult({ + mutationId: mutationId, + result: result, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn + }); + } + + storeResult = result; + }, + error: function (err) { + self.mutationStore.markMutationError(mutationId, err); + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse + }); + self.broadcastQueries(); + self.setQuery(mutationId, function () { + return { + document: null + }; + }); + reject(new ApolloError({ + networkError: err + })); + }, + complete: function () { + if (error) { + self.mutationStore.markMutationError(mutationId, error); + } + + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse + }); + self.broadcastQueries(); + + if (error) { + reject(error); + return; + } + + if (typeof refetchQueries === 'function') { + refetchQueries = refetchQueries(storeResult); + } + + var refetchQueryPromises = []; + + if (isNonEmptyArray(refetchQueries)) { + refetchQueries.forEach(function (refetchQuery) { + if (typeof refetchQuery === 'string') { + self.queries.forEach(function (_a) { + var observableQuery = _a.observableQuery; + + if (observableQuery && observableQuery.queryName === refetchQuery) { + refetchQueryPromises.push(observableQuery.refetch()); + } + }); + } else { + var queryOptions = { + query: refetchQuery.query, + variables: refetchQuery.variables, + fetchPolicy: 'network-only' + }; + + if (refetchQuery.context) { + queryOptions.context = refetchQuery.context; + } + + refetchQueryPromises.push(self.query(queryOptions)); + } + }); + } + + Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { + self.setQuery(mutationId, function () { + return { + document: null + }; + }); + + if (errorPolicy === 'ignore' && storeResult && (0, _apolloUtilities.graphQLResultHasError)(storeResult)) { + delete storeResult.errors; + } + + resolve(storeResult); + }); + } + }); + })]; + } + }); + }); + }; + + QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; + query = this.transform(options.query).document; + variables = this.getVariables(query, options.variables); + if (!this.transform(query).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(query, variables, context)]; + + case 1: + variables = _e.sent(); + _e.label = 2; + + case 2: + options = (0, _tslib.__assign)({}, options, { + variables: variables + }); + isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + needToFetch = isNetworkOnly; + + if (!isNetworkOnly) { + _d = this.dataStore.getCache().diff({ + query: query, + variables: variables, + returnPartialData: true, + optimistic: false + }), complete = _d.complete, result = _d.result; + needToFetch = !complete || fetchPolicy === 'cache-and-network'; + storeResult = result; + } + + shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; + if ((0, _apolloUtilities.hasDirectives)(['live'], query)) shouldFetch = true; + requestId = this.idCounter++; + cancel = fetchPolicy !== 'no-cache' ? this.updateQueryWatch(queryId, query, options) : undefined; + this.setQuery(queryId, function () { + return { + document: query, + lastRequestId: requestId, + invalidated: true, + cancel: cancel + }; + }); + this.invalidate(fetchMoreForQueryId); + this.queryStore.initQuery({ + queryId: queryId, + document: query, + storePreviousVariables: shouldFetch, + variables: variables, + isPoll: fetchType === FetchType.poll, + isRefetch: fetchType === FetchType.refetch, + metadata: metadata, + fetchMoreForQueryId: fetchMoreForQueryId + }); + this.broadcastQueries(); + + if (shouldFetch) { + networkResult = this.fetchRequest({ + requestId: requestId, + queryId: queryId, + document: query, + options: options, + fetchMoreForQueryId: fetchMoreForQueryId + }).catch(function (error) { + if (isApolloError(error)) { + throw error; + } else { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); + + _this.invalidate(queryId); + + _this.invalidate(fetchMoreForQueryId); + + _this.broadcastQueries(); + } + + throw new ApolloError({ + networkError: error + }); + } + }); + + if (fetchPolicy !== 'cache-and-network') { + return [2, networkResult]; + } + + networkResult.catch(function () {}); + } + + this.queryStore.markQueryResultClient(queryId, !shouldFetch); + this.invalidate(queryId); + this.invalidate(fetchMoreForQueryId); + + if (this.transform(query).hasForcedResolvers) { + return [2, this.localState.runResolvers({ + document: query, + remoteResult: { + data: storeResult + }, + context: context, + variables: variables, + onlyRunForcedResolvers: true + }).then(function (result) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + + _this.broadcastQueries(); + + return result; + })]; + } + + this.broadcastQueries(); + return [2, { + data: storeResult + }]; + } + }); + }); + }; + + QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { + var fetchPolicy = _a.fetchPolicy, + variables = _a.variables, + errorPolicy = _a.errorPolicy; + + if (fetchPolicy === 'no-cache') { + this.setQuery(queryId, function () { + return { + newData: { + result: result.data, + complete: true + } + }; + }); + } else { + this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); + } + }; + + QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { + var _this = this; + + function invoke(method, argument) { + if (observer[method]) { + try { + observer[method](argument); + } catch (e) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(e); + } + } else if (method === 'error') { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(argument); + } + } + + return function (queryStoreValue, newData) { + _this.invalidate(queryId, false); + + if (!queryStoreValue) return; + + var _a = _this.getQuery(queryId), + observableQuery = _a.observableQuery, + document = _a.document; + + var fetchPolicy = observableQuery ? observableQuery.options.fetchPolicy : options.fetchPolicy; + if (fetchPolicy === 'standby') return; + var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); + var lastResult = observableQuery && observableQuery.getLastResult(); + var networkStatusChanged = !!(lastResult && lastResult.networkStatus !== queryStoreValue.networkStatus); + var shouldNotifyIfLoading = options.returnPartialData || !newData && queryStoreValue.previousVariables || networkStatusChanged && options.notifyOnNetworkStatusChange || fetchPolicy === 'cache-only' || fetchPolicy === 'cache-and-network'; + + if (loading && !shouldNotifyIfLoading) { + return; + } + + var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); + var errorPolicy = observableQuery && observableQuery.options.errorPolicy || options.errorPolicy || 'none'; + + if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { + return invoke('error', new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError + })); + } + + try { + var data = void 0; + var isMissing = void 0; + + if (newData) { + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { + _this.setQuery(queryId, function () { + return { + newData: null + }; + }); + } + + data = newData.result; + isMissing = !newData.complete; + } else { + var lastError = observableQuery && observableQuery.getLastError(); + var errorStatusChanged = errorPolicy !== 'none' && (lastError && lastError.graphQLErrors) !== queryStoreValue.graphQLErrors; + + if (lastResult && lastResult.data && !errorStatusChanged) { + data = lastResult.data; + isMissing = false; + } else { + var diffResult = _this.dataStore.getCache().diff({ + query: document, + variables: queryStoreValue.previousVariables || queryStoreValue.variables, + returnPartialData: true, + optimistic: true + }); + + data = diffResult.result; + isMissing = !diffResult.complete; + } + } + + var stale = isMissing && !(options.returnPartialData || fetchPolicy === 'cache-only'); + var resultFromStore = { + data: stale ? lastResult && lastResult.data : data, + loading: loading, + networkStatus: queryStoreValue.networkStatus, + stale: stale + }; + + if (errorPolicy === 'all' && hasGraphQLErrors) { + resultFromStore.errors = queryStoreValue.graphQLErrors; + } + + invoke('next', resultFromStore); + } catch (networkError) { + invoke('error', new ApolloError({ + networkError: networkError + })); + } + }; + }; + + QueryManager.prototype.transform = function (document) { + var transformCache = this.transformCache; + + if (!transformCache.has(document)) { + var cache = this.dataStore.getCache(); + var transformed = cache.transformDocument(document); + var forLink = (0, _apolloUtilities.removeConnectionDirectiveFromDocument)(cache.transformForLink(transformed)); + var clientQuery = this.localState.clientQuery(transformed); + var serverQuery = this.localState.serverQuery(forLink); + var cacheEntry_1 = { + document: transformed, + hasClientExports: (0, _apolloUtilities.hasClientExports)(transformed), + hasForcedResolvers: this.localState.shouldForceResolvers(transformed), + clientQuery: clientQuery, + serverQuery: serverQuery, + defaultVars: (0, _apolloUtilities.getDefaultValues)((0, _apolloUtilities.getOperationDefinition)(transformed)) + }; + + var add = function (doc) { + if (doc && !transformCache.has(doc)) { + transformCache.set(doc, cacheEntry_1); + } + }; + + add(document); + add(transformed); + add(clientQuery); + add(serverQuery); + } + + return transformCache.get(document); + }; + + QueryManager.prototype.getVariables = function (document, variables) { + return (0, _tslib.__assign)({}, this.transform(document).defaultVars, variables); + }; + + QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { + if (shouldSubscribe === void 0) { + shouldSubscribe = true; + } + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 9) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); + options.variables = this.getVariables(options.query, options.variables); + + if (typeof options.notifyOnNetworkStatusChange === 'undefined') { + options.notifyOnNetworkStatusChange = false; + } + + var transformedOptions = (0, _tslib.__assign)({}, options); + return new ObservableQuery({ + queryManager: this, + options: transformedOptions, + shouldSubscribe: shouldSubscribe + }); + }; + + QueryManager.prototype.query = function (options) { + var _this = this; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query, 10) : (0, _tsInvariant.invariant)(options.query, 'query option is required. You must specify your GraphQL document ' + 'in the query option.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query.kind === 'Document', 11) : (0, _tsInvariant.invariant)(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.returnPartialData, 12) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 13) : (0, _tsInvariant.invariant)(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); + return new Promise(function (resolve, reject) { + var watchedQuery = _this.watchQuery(options, false); + + _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); + + watchedQuery.result().then(resolve, reject).then(function () { + return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); + }); + }); + }; + + QueryManager.prototype.generateQueryId = function () { + return String(this.idCounter++); + }; + + QueryManager.prototype.stopQueryInStore = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.broadcastQueries(); + }; + + QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { + this.stopPollingQuery(queryId); + this.queryStore.stopQuery(queryId); + this.invalidate(queryId); + }; + + QueryManager.prototype.addQueryListener = function (queryId, listener) { + this.setQuery(queryId, function (_a) { + var listeners = _a.listeners; + listeners.add(listener); + return { + invalidated: false + }; + }); + }; + + QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { + var _this = this; + + var cancel = this.getQuery(queryId).cancel; + if (cancel) cancel(); + + var previousResult = function () { + var previousResult = null; + + var observableQuery = _this.getQuery(queryId).observableQuery; + + if (observableQuery) { + var lastResult = observableQuery.getLastResult(); + + if (lastResult) { + previousResult = lastResult.data; + } + } + + return previousResult; + }; + + return this.dataStore.getCache().watch({ + query: document, + variables: options.variables, + optimistic: true, + previousResult: previousResult, + callback: function (newData) { + _this.setQuery(queryId, function () { + return { + invalidated: true, + newData: newData + }; + }); + } + }); + }; + + QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { + this.setQuery(queryId, function () { + return { + observableQuery: observableQuery + }; + }); + }; + + QueryManager.prototype.removeObservableQuery = function (queryId) { + var cancel = this.getQuery(queryId).cancel; + this.setQuery(queryId, function () { + return { + observableQuery: null + }; + }); + if (cancel) cancel(); + }; + + QueryManager.prototype.clearStore = function () { + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(14) : new _tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)')); + }); + var resetIds = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) resetIds.push(queryId); + }); + this.queryStore.reset(resetIds); + this.mutationStore.reset(); + return this.dataStore.reset(); + }; + + QueryManager.prototype.resetStore = function () { + var _this = this; + + return this.clearStore().then(function () { + return _this.reFetchObservableQueries(); + }); + }; + + QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { + var _this = this; + + if (includeStandby === void 0) { + includeStandby = false; + } + + var observableQueryPromises = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + + if (observableQuery) { + var fetchPolicy = observableQuery.options.fetchPolicy; + observableQuery.resetLastResults(); + + if (fetchPolicy !== 'cache-only' && (includeStandby || fetchPolicy !== 'standby')) { + observableQueryPromises.push(observableQuery.refetch()); + } + + _this.setQuery(queryId, function () { + return { + newData: null + }; + }); + + _this.invalidate(queryId); + } + }); + this.broadcastQueries(); + return Promise.all(observableQueryPromises); + }; + + QueryManager.prototype.observeQuery = function (queryId, options, observer) { + this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); + return this.fetchQuery(queryId, options); + }; + + QueryManager.prototype.startQuery = function (queryId, options, listener) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("The QueryManager.startQuery method has been deprecated"); + this.addQueryListener(queryId, listener); + this.fetchQuery(queryId, options).catch(function () { + return undefined; + }); + return queryId; + }; + + QueryManager.prototype.startGraphQLSubscription = function (_a) { + var _this = this; + + var query = _a.query, + fetchPolicy = _a.fetchPolicy, + variables = _a.variables; + query = this.transform(query).document; + variables = this.getVariables(query, variables); + + var makeObservable = function (variables) { + return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { + if (!fetchPolicy || fetchPolicy !== 'no-cache') { + _this.dataStore.markSubscriptionResult(result, query, variables); + + _this.broadcastQueries(); + } + + if ((0, _apolloUtilities.graphQLResultHasError)(result)) { + throw new ApolloError({ + graphQLErrors: result.errors + }); + } + + return result; + }); + }; + + if (this.transform(query).hasClientExports) { + var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); + return new Observable(function (observer) { + var sub = null; + observablePromise_1.then(function (observable) { + return sub = observable.subscribe(observer); + }, observer.error); + return function () { + return sub && sub.unsubscribe(); + }; + }); + } + + return makeObservable(variables); + }; + + QueryManager.prototype.stopQuery = function (queryId) { + this.stopQueryNoBroadcast(queryId); + this.broadcastQueries(); + }; + + QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.removeQuery(queryId); + }; + + QueryManager.prototype.removeQuery = function (queryId) { + this.fetchQueryRejectFns.delete("query:" + queryId); + this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); + this.getQuery(queryId).subscriptions.forEach(function (x) { + return x.unsubscribe(); + }); + this.queries.delete(queryId); + }; + + QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { + if (optimistic === void 0) { + optimistic = true; + } + + var _a = observableQuery.options, + variables = _a.variables, + query = _a.query, + fetchPolicy = _a.fetchPolicy, + returnPartialData = _a.returnPartialData; + var lastResult = observableQuery.getLastResult(); + var newData = this.getQuery(observableQuery.queryId).newData; + + if (newData && newData.complete) { + return { + data: newData.result, + partial: false + }; + } + + if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { + return { + data: undefined, + partial: false + }; + } + + var _b = this.dataStore.getCache().diff({ + query: query, + variables: variables, + previousResult: lastResult ? lastResult.data : undefined, + returnPartialData: true, + optimistic: optimistic + }), + result = _b.result, + complete = _b.complete; + + return { + data: complete || returnPartialData ? result : void 0, + partial: !complete + }; + }; + + QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { + var observableQuery; + + if (typeof queryIdOrObservable === 'string') { + var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(foundObserveableQuery, 15) : (0, _tsInvariant.invariant)(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); + observableQuery = foundObserveableQuery; + } else { + observableQuery = queryIdOrObservable; + } + + var _a = observableQuery.options, + variables = _a.variables, + query = _a.query; + return { + previousResult: this.getCurrentQueryResult(observableQuery, false).data, + variables: variables, + document: query + }; + }; + + QueryManager.prototype.broadcastQueries = function () { + var _this = this; + + this.onBroadcast(); + this.queries.forEach(function (info, id) { + if (info.invalidated) { + info.listeners.forEach(function (listener) { + if (listener) { + listener(_this.queryStore.get(id), info.newData); + } + }); + } + }); + }; + + QueryManager.prototype.getLocalState = function () { + return this.localState; + }; + + QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { + var _this = this; + + if (deduplication === void 0) { + deduplication = this.queryDeduplication; + } + + var observable; + var serverQuery = this.transform(query).serverQuery; + + if (serverQuery) { + var _a = this, + inFlightLinkObservables_1 = _a.inFlightLinkObservables, + link = _a.link; + + var operation = { + query: serverQuery, + variables: variables, + operationName: (0, _apolloUtilities.getOperationName)(serverQuery) || void 0, + context: this.prepareContext((0, _tslib.__assign)({}, context, { + forceFetch: !deduplication + })) + }; + context = operation.context; + + if (deduplication) { + var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); + inFlightLinkObservables_1.set(serverQuery, byVariables_1); + var varJson_1 = JSON.stringify(variables); + observable = byVariables_1.get(varJson_1); + + if (!observable) { + byVariables_1.set(varJson_1, observable = multiplex((0, _apolloLink.execute)(link, operation))); + + var cleanup = function () { + byVariables_1.delete(varJson_1); + if (!byVariables_1.size) inFlightLinkObservables_1.delete(serverQuery); + cleanupSub_1.unsubscribe(); + }; + + var cleanupSub_1 = observable.subscribe({ + next: cleanup, + error: cleanup, + complete: cleanup + }); + } + } else { + observable = multiplex((0, _apolloLink.execute)(link, operation)); + } + } else { + observable = Observable.of({ + data: {} + }); + context = this.prepareContext(context); + } + + var clientQuery = this.transform(query).clientQuery; + + if (clientQuery) { + observable = asyncMap(observable, function (result) { + return _this.localState.runResolvers({ + document: clientQuery, + remoteResult: result, + context: context, + variables: variables + }); + }); + } + + return observable; + }; + + QueryManager.prototype.fetchRequest = function (_a) { + var _this = this; + + var requestId = _a.requestId, + queryId = _a.queryId, + document = _a.document, + options = _a.options, + fetchMoreForQueryId = _a.fetchMoreForQueryId; + var variables = options.variables, + _b = options.errorPolicy, + errorPolicy = _b === void 0 ? 'none' : _b, + fetchPolicy = options.fetchPolicy; + var resultFromStore; + var errorsFromStore; + return new Promise(function (resolve, reject) { + var observable = _this.getObservableFromLink(document, options.context, variables); + + var fqrfId = "fetchRequest:" + queryId; + + _this.fetchQueryRejectFns.set(fqrfId, reject); + + var cleanup = function () { + _this.fetchQueryRejectFns.delete(fqrfId); + + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.delete(subscription); + }); + }; + + var subscription = observable.map(function (result) { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + + _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); + + _this.invalidate(queryId); + + _this.invalidate(fetchMoreForQueryId); + + _this.broadcastQueries(); + } + + if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { + return reject(new ApolloError({ + graphQLErrors: result.errors + })); + } + + if (errorPolicy === 'all') { + errorsFromStore = result.errors; + } + + if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { + resultFromStore = result.data; + } else { + var _a = _this.dataStore.getCache().diff({ + variables: variables, + query: document, + optimistic: false, + returnPartialData: true + }), + result_1 = _a.result, + complete = _a.complete; + + if (complete || options.returnPartialData) { + resultFromStore = result_1; + } + } + }).subscribe({ + error: function (error) { + cleanup(); + reject(error); + }, + complete: function () { + cleanup(); + resolve({ + data: resultFromStore, + errors: errorsFromStore, + loading: false, + networkStatus: NetworkStatus.ready, + stale: false + }); + } + }); + + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.add(subscription); + }); + }); + }; + + QueryManager.prototype.getQuery = function (queryId) { + return this.queries.get(queryId) || { + listeners: new Set(), + invalidated: false, + document: null, + newData: null, + lastRequestId: 1, + observableQuery: null, + subscriptions: new Set() + }; + }; + + QueryManager.prototype.setQuery = function (queryId, updater) { + var prev = this.getQuery(queryId); + var newInfo = (0, _tslib.__assign)({}, prev, updater(prev)); + this.queries.set(queryId, newInfo); + }; + + QueryManager.prototype.invalidate = function (queryId, invalidated) { + if (invalidated === void 0) { + invalidated = true; + } + + if (queryId) { + this.setQuery(queryId, function () { + return { + invalidated: invalidated + }; + }); + } + }; + + QueryManager.prototype.prepareContext = function (context) { + if (context === void 0) { + context = {}; + } + + var newContext = this.localState.prepareContext(context); + return (0, _tslib.__assign)({}, newContext, { + clientAwareness: this.clientAwareness + }); + }; + + QueryManager.prototype.checkInFlight = function (queryId) { + var query = this.queryStore.get(queryId); + return query && query.networkStatus !== NetworkStatus.ready && query.networkStatus !== NetworkStatus.error; + }; + + QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { + var _this = this; + + var pollInterval = options.pollInterval; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(pollInterval, 16) : (0, _tsInvariant.invariant)(pollInterval, 'Attempted to start a polling query without a polling interval.'); + + if (!this.ssrMode) { + var info = this.pollingInfoByQueryId.get(queryId); + + if (!info) { + this.pollingInfoByQueryId.set(queryId, info = {}); + } + + info.interval = pollInterval; + info.options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'network-only' + }); + + var maybeFetch_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + + if (info) { + if (_this.checkInFlight(queryId)) { + poll_1(); + } else { + _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); + } + } + }; + + var poll_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + + if (info) { + clearTimeout(info.timeout); + info.timeout = setTimeout(maybeFetch_1, info.interval); + } + }; + + if (listener) { + this.addQueryListener(queryId, listener); + } + + poll_1(); + } + + return queryId; + }; + + QueryManager.prototype.stopPollingQuery = function (queryId) { + this.pollingInfoByQueryId.delete(queryId); + }; + + return QueryManager; +}(); + +var DataStore = function () { + function DataStore(initialCache) { + this.cache = initialCache; + } + + DataStore.prototype.getCache = function () { + return this.cache; + }; + + DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { + if (ignoreErrors === void 0) { + ignoreErrors = false; + } + + var writeWithErrors = !(0, _apolloUtilities.graphQLResultHasError)(result); + + if (ignoreErrors && (0, _apolloUtilities.graphQLResultHasError)(result) && result.data) { + writeWithErrors = true; + } + + if (!fetchMoreForQueryId && writeWithErrors) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_QUERY', + query: document, + variables: variables + }); + } + }; + + DataStore.prototype.markSubscriptionResult = function (result, document, variables) { + if (!(0, _apolloUtilities.graphQLResultHasError)(result)) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_SUBSCRIPTION', + query: document, + variables: variables + }); + } + }; + + DataStore.prototype.markMutationInit = function (mutation) { + var _this = this; + + if (mutation.optimisticResponse) { + var optimistic_1; + + if (typeof mutation.optimisticResponse === 'function') { + optimistic_1 = mutation.optimisticResponse(mutation.variables); + } else { + optimistic_1 = mutation.optimisticResponse; + } + + this.cache.recordOptimisticTransaction(function (c) { + var orig = _this.cache; + _this.cache = c; + + try { + _this.markMutationResult({ + mutationId: mutation.mutationId, + result: { + data: optimistic_1 + }, + document: mutation.document, + variables: mutation.variables, + updateQueries: mutation.updateQueries, + update: mutation.update + }); + } finally { + _this.cache = orig; + } + }, mutation.mutationId); + } + }; + + DataStore.prototype.markMutationResult = function (mutation) { + var _this = this; + + if (!(0, _apolloUtilities.graphQLResultHasError)(mutation.result)) { + var cacheWrites_1 = [{ + result: mutation.result.data, + dataId: 'ROOT_MUTATION', + query: mutation.document, + variables: mutation.variables + }]; + var updateQueries_1 = mutation.updateQueries; + + if (updateQueries_1) { + Object.keys(updateQueries_1).forEach(function (id) { + var _a = updateQueries_1[id], + query = _a.query, + updater = _a.updater; + + var _b = _this.cache.diff({ + query: query.document, + variables: query.variables, + returnPartialData: true, + optimistic: false + }), + currentQueryResult = _b.result, + complete = _b.complete; + + if (complete) { + var nextQueryResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return updater(currentQueryResult, { + mutationResult: mutation.result, + queryName: (0, _apolloUtilities.getOperationName)(query.document) || undefined, + queryVariables: query.variables + }); + }); + + if (nextQueryResult) { + cacheWrites_1.push({ + result: nextQueryResult, + dataId: 'ROOT_QUERY', + query: query.document, + variables: query.variables + }); + } + } + }); + } + + this.cache.performTransaction(function (c) { + cacheWrites_1.forEach(function (write) { + return c.write(write); + }); + var update = mutation.update; + + if (update) { + (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return update(c, mutation.result); + }); + } + }); + } + }; + + DataStore.prototype.markMutationComplete = function (_a) { + var mutationId = _a.mutationId, + optimisticResponse = _a.optimisticResponse; + + if (optimisticResponse) { + this.cache.removeOptimistic(mutationId); + } + }; + + DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { + this.cache.write({ + result: newResult, + dataId: 'ROOT_QUERY', + variables: variables, + query: document + }); + }; + + DataStore.prototype.reset = function () { + return this.cache.reset(); + }; + + return DataStore; +}(); + +var version = "2.6.3"; +var hasSuggestedDevtools = false; + +var ApolloClient = function () { + function ApolloClient(options) { + var _this = this; + + this.defaultOptions = {}; + this.resetStoreCallbacks = []; + this.clearStoreCallbacks = []; + var cache = options.cache, + _a = options.ssrMode, + ssrMode = _a === void 0 ? false : _a, + _b = options.ssrForceFetchDelay, + ssrForceFetchDelay = _b === void 0 ? 0 : _b, + connectToDevTools = options.connectToDevTools, + _c = options.queryDeduplication, + queryDeduplication = _c === void 0 ? true : _c, + defaultOptions = options.defaultOptions, + _d = options.assumeImmutableResults, + assumeImmutableResults = _d === void 0 ? false : _d, + resolvers = options.resolvers, + typeDefs = options.typeDefs, + fragmentMatcher = options.fragmentMatcher, + clientAwarenessName = options.name, + clientAwarenessVersion = options.version; + var link = options.link; + + if (!link && resolvers) { + link = _apolloLink.ApolloLink.empty(); + } + + if (!link || !cache) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); + } + + this.link = link; + this.cache = cache; + this.store = new DataStore(cache); + this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; + this.queryDeduplication = queryDeduplication; + this.defaultOptions = defaultOptions || {}; + this.typeDefs = typeDefs; + + if (ssrForceFetchDelay) { + setTimeout(function () { + return _this.disableNetworkFetches = false; + }, ssrForceFetchDelay); + } + + this.watchQuery = this.watchQuery.bind(this); + this.query = this.query.bind(this); + this.mutate = this.mutate.bind(this); + this.resetStore = this.resetStore.bind(this); + this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); + var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && !window.__APOLLO_CLIENT__; + + if (typeof connectToDevTools === 'undefined' ? defaultConnectToDevTools : connectToDevTools && typeof window !== 'undefined') { + window.__APOLLO_CLIENT__ = this; + } + + if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { + hasSuggestedDevtools = true; + + if (typeof window !== 'undefined' && window.document && window.top === window.self) { + if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + if (window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('Chrome') > -1) { + console.debug('Download the Apollo DevTools ' + 'for a better development experience: ' + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); + } + } + } + } + + this.version = version; + this.localState = new LocalState({ + cache: cache, + client: this, + resolvers: resolvers, + fragmentMatcher: fragmentMatcher + }); + this.queryManager = new QueryManager({ + link: this.link, + store: this.store, + queryDeduplication: queryDeduplication, + ssrMode: ssrMode, + clientAwareness: { + name: clientAwarenessName, + version: clientAwarenessVersion + }, + localState: this.localState, + assumeImmutableResults: assumeImmutableResults, + onBroadcast: function () { + if (_this.devToolsHookCb) { + _this.devToolsHookCb({ + action: {}, + state: { + queries: _this.queryManager.queryStore.getStore(), + mutations: _this.queryManager.mutationStore.getStore() + }, + dataWithOptimisticResults: _this.cache.extract(true) + }); + } + } + }); + } + + ApolloClient.prototype.stop = function () { + this.queryManager.stop(); + }; + + ApolloClient.prototype.watchQuery = function (options) { + if (this.defaultOptions.watchQuery) { + options = (0, _tslib.__assign)({}, this.defaultOptions.watchQuery, options); + } + + if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { + options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'cache-first' + }); + } + + return this.queryManager.watchQuery(options); + }; + + ApolloClient.prototype.query = function (options) { + if (this.defaultOptions.query) { + options = (0, _tslib.__assign)({}, this.defaultOptions.query, options); + } + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 2) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + 'client.query can only return a single result. Please use client.watchQuery ' + 'to receive multiple results from the cache and the network, or consider ' + 'using a different fetchPolicy, such as cache-first or network-only.'); + + if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { + options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'cache-first' + }); + } + + return this.queryManager.query(options); + }; + + ApolloClient.prototype.mutate = function (options) { + if (this.defaultOptions.mutate) { + options = (0, _tslib.__assign)({}, this.defaultOptions.mutate, options); + } + + return this.queryManager.mutate(options); + }; + + ApolloClient.prototype.subscribe = function (options) { + return this.queryManager.startGraphQLSubscription(options); + }; + + ApolloClient.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.cache.readQuery(options, optimistic); + }; + + ApolloClient.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.cache.readFragment(options, optimistic); + }; + + ApolloClient.prototype.writeQuery = function (options) { + var result = this.cache.writeQuery(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.writeFragment = function (options) { + var result = this.cache.writeFragment(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.writeData = function (options) { + var result = this.cache.writeData(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.__actionHookForDevTools = function (cb) { + this.devToolsHookCb = cb; + }; + + ApolloClient.prototype.__requestRaw = function (payload) { + return (0, _apolloLink.execute)(this.link, payload); + }; + + ApolloClient.prototype.initQueryManager = function () { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + 'and it will be removed from ApolloClient in version 3.0.'); + return this.queryManager; + }; + + ApolloClient.prototype.resetStore = function () { + var _this = this; + + return Promise.resolve().then(function () { + return _this.queryManager.clearStore(); + }).then(function () { + return Promise.all(_this.resetStoreCallbacks.map(function (fn) { + return fn(); + })); + }).then(function () { + return _this.reFetchObservableQueries(); + }); + }; + + ApolloClient.prototype.clearStore = function () { + var _this = this; + + return Promise.resolve().then(function () { + return _this.queryManager.clearStore(); + }).then(function () { + return Promise.all(_this.clearStoreCallbacks.map(function (fn) { + return fn(); + })); + }); + }; + + ApolloClient.prototype.onResetStore = function (cb) { + var _this = this; + + this.resetStoreCallbacks.push(cb); + return function () { + _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { + return c !== cb; + }); + }; + }; + + ApolloClient.prototype.onClearStore = function (cb) { + var _this = this; + + this.clearStoreCallbacks.push(cb); + return function () { + _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { + return c !== cb; + }); + }; + }; + + ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { + return this.queryManager.reFetchObservableQueries(includeStandby); + }; + + ApolloClient.prototype.extract = function (optimistic) { + return this.cache.extract(optimistic); + }; + + ApolloClient.prototype.restore = function (serializedState) { + return this.cache.restore(serializedState); + }; + + ApolloClient.prototype.addResolvers = function (resolvers) { + this.localState.addResolvers(resolvers); + }; + + ApolloClient.prototype.setResolvers = function (resolvers) { + this.localState.setResolvers(resolvers); + }; + + ApolloClient.prototype.getResolvers = function () { + return this.localState.getResolvers(); + }; + + ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { + this.localState.setFragmentMatcher(fragmentMatcher); + }; + + return ApolloClient; +}(); + +exports.ApolloClient = ApolloClient; +var _default = ApolloClient; + +exports.default = _default; diff --git a/node_modules/apollo-client/bundle.cjs.js.map b/node_modules/apollo-client/bundle.cjs.js.map new file mode 100644 index 000000000..ca9a928ea --- /dev/null +++ b/node_modules/apollo-client/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"names":["LinkObservable","tslib_1.__assign"],"mappings":";;;;;;;;;;;;;;;;;;;;IAGY,a;;;AAAZ,CAAA,UAAY,aAAZ,EAAyB;AAMvB,EAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA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jC,WAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,UAAnB,CAAP;AACD,GAFM;;AAWA,EAAA,YAAA,CAAA,SAAA,CAAA,OAAA,GAAP,UAAe,eAAf,EAA2C;AACzC,WAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,eAAnB,CAAP;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,SAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,SAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,YAAA;AACE,WAAO,KAAK,UAAL,CAAgB,YAAhB,EAAP;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,4BAAA,GAAP,UAAoC,eAApC,EAAoE;AAClE,SAAK,UAAL,CAAgB,kBAAhB,CAAmC,eAAnC;AACD,GAFM;;AAGT,SAAA,YAAA;AAAC,CA3gBD,EAAA","sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [field: string]: (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: any,\n ) => any;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n ExecutionResult,\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n fieldName: string,\n rootValue: any,\n args: any,\n context: any,\n info: {\n field: FieldNode;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: ExecutionResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"fetchPolicy for mutations currently only supports the 'no-cache' policy\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: ExecutionResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result as FetchResult;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult as ExecutionResult);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: ExecutionResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: ExecutionResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.3\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-client/bundle.cjs.min.js b/node_modules/apollo-client/bundle.cjs.min.js new file mode 100644 index 000000000..3eb1416d9 --- /dev/null +++ b/node_modules/apollo-client/bundle.cjs.min.js @@ -0,0 +1 @@ +exports.__esModule=!0,exports.isApolloError=h,exports.ObservableQuery=exports.NetworkStatus=exports.FetchType=exports.ApolloError=exports.ApolloClient=exports.default=void 0;var e,t,r=require("tslib"),o=require("apollo-utilities"),n=require("apollo-link"),i=(e=require("symbol-observable"))&&e.__esModule?e:{default:e},s=require("ts-invariant"),a=require("graphql/language/visitor");function u(e){return e<7}exports.NetworkStatus=t,function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(t||(exports.NetworkStatus=t={}));var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype[i.default]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(n.Observable);function l(e){return Array.isArray(e)&&e.length>0}function h(e){return e.hasOwnProperty("graphQLErrors")}var p,y=function(e){var t="";return l(e.graphQLErrors)&&e.graphQLErrors.forEach(function(e){var r=e?e.message:"Error message not found.";t+="GraphQL error: "+r+"\n"}),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},f=function(e){function t(r){var o=r.graphQLErrors,n=r.networkError,i=r.errorMessage,s=r.extraInfo,a=e.call(this,i)||this;return a.graphQLErrors=o||[],a.networkError=n||null,a.message=i||y(a),a.extraInfo=s,a.__proto__=t.prototype,a}return(0,r.__extends)(t,e),t}(Error);exports.ApolloError=f,exports.FetchType=p,function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(p||(exports.FetchType=p={}));var v=function(e){function n(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,s=void 0===i||i,a=e.call(this,function(e){return a.onSubscribe(e)})||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=s;var u=(0,o.getOperationDefinition)(n.query);return a.queryName=u&&u.name&&u.name.value,a.queryManager=r,a}return(0,r.__extends)(n,e),n.prototype.result=function(){var e=this;return new Promise(function(t,r){var o={next:function(r){t(r),e.observers.delete(o),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){n.unsubscribe()},0)},error:r},n=e.subscribe(o)})},n.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},n.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:t.error}}var o,n,i,s=this.queryManager.getCurrentQueryResult(this),a=s.data,c=s.partial,h=this.queryManager.queryStore.get(this.queryId),p=this.options.fetchPolicy,y="network-only"===p||"no-cache"===p;if(h){var v=h.networkStatus;if(n=h,void 0===(i=this.options.errorPolicy)&&(i="none"),n&&(n.networkError||"none"===i&&l(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:v,error:new f({graphQLErrors:h.graphQLErrors,networkError:h.networkError})};h.variables&&(this.options.variables=(0,r.__assign)({},this.options.variables,h.variables),this.variables=this.options.variables),o={data:a,loading:u(v),networkStatus:v},h.graphQLErrors&&"all"===this.options.errorPolicy&&(o.errors=h.graphQLErrors)}else{var d=y||c&&"cache-only"!==p;o={data:a,loading:d,networkStatus:d?t.loading:t.ready}}return c||this.updateLastResult((0,r.__assign)({},o,{stale:!1})),(0,r.__assign)({},o,{partial:c})},n.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&(0,o.isEqual)(t.data,e.data))},n.prototype.getLastResult=function(){return this.lastResult},n.prototype.getLastError=function(){return this.lastError},n.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},n.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},n.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new s.InvariantError(3)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),(0,o.isEqual)(this.variables,e)||(this.variables=(0,r.__assign)({},this.variables,e)),(0,o.isEqual)(this.options.variables,this.variables)||(this.options.variables=(0,r.__assign)({},this.options.variables,this.variables)),this.queryManager.fetchQuery(this.queryId,(0,r.__assign)({},this.options,{fetchPolicy:t}),p.refetch))},n.prototype.fetchMore=function(e){var t=this;(0,s.invariant)(e.updateQuery,4);var o=(0,r.__assign)({},e.query?e:(0,r.__assign)({},this.options,e,{variables:(0,r.__assign)({},this.variables,e.variables)}),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,o,p.normal,this.queryId).then(function(r){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:r.data,variables:o.variables})}),t.queryManager.stopQuery(n),r},function(e){throw t.queryManager.stopQuery(n),e})},n.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var o=e.updateQuery;o&&t.updateQuery(function(e,t){var n=t.variables;return o(e,{subscriptionData:r,variables:n})})},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},n.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=(0,r.__assign)({},this.options,e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var o=e.fetchPolicy;return this.setVariables(this.options.variables,t!==o&&("cache-only"===t||"standby"===t||"network-only"===o),e.fetchResults)},n.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&(0,o.isEqual)(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},n.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,s=r.document,a=(0,o.tryFunctionOrLogError)(function(){return e(n,{variables:i})});a&&(t.dataStore.markUpdateQueryResult(s,i,a),t.broadcastQueries())},n.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},n.prototype.startPolling=function(e){m(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},n.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,o.cloneDeep)(e),t},n.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=d)}catch(e){}var o=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),o&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},n.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(m(this),t.startPollingQuery(this.options,r));var n=function(t){b(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,s=i.query,a=i.variables,u=i.fetchPolicy;t.transform(s).hasClientExports?t.getLocalState().addExportedVariables(s,a).then(function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==u&&t.transform(s).serverQuery&&!(0,o.isEqual)(a,i)?e.refetch():b(e.observers,"next",r)}):b(e.observers,"next",r)}},error:n}).catch(n)},n.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},n}(c);function d(e){}function b(e,t,r){var o=[];e.forEach(function(e){return e[t]&&o.push(e)}),o.forEach(function(e){return e[t](r)})}function m(e){var t=e.options.fetchPolicy;(0,s.invariant)("cache-first"!==t&&"cache-only"!==t,5)}exports.ObservableQuery=v;var g=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Q=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var r=this.store[e.queryId];(0,s.invariant)(!r||r.document===e.document||(0,o.isEqual)(r.document,e.document),19);var n,i=!1,a=null;e.storePreviousVariables&&r&&r.networkStatus!==t.loading&&((0,o.isEqual)(r.variables,e.variables)||(i=!0,a=r.variables)),n=i?t.setVariables:e.isPoll?t.poll:e.isRefetch?t.refetch:t.loading;var u=[];r&&r.graphQLErrors&&(u=r.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:a,networkError:null,graphQLErrors:u,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=t.fetchMore)},e.prototype.markQueryResult=function(e,r,o){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=l(r.errors)?r.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=t.ready,"string"==typeof o&&this.store[o]&&(this.store[o].networkStatus=t.ready))},e.prototype.markQueryError=function(e,r,o){this.store&&this.store[e]&&(this.store[e].networkError=r,this.store[e].networkStatus=t.error,"string"==typeof o&&this.markQueryResultClient(o,!0))},e.prototype.markQueryResultClient=function(e,r){var o=this.store&&this.store[e];o&&(o.networkError=null,o.previousVariables=null,r&&(o.networkStatus=t.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var r=this;Object.keys(this.store).forEach(function(o){e.indexOf(o)<0?r.stopQuery(o):r.store[o].networkStatus=t.loading})},e}();var w=function(){function e(e){var t=e.cache,r=e.client,o=e.resolvers,n=e.fragmentMatcher;this.cache=t,r&&(this.client=r),o&&this.addResolvers(o),n&&this.setFragmentMatcher(n)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=(0,o.mergeDeep)(t.resolvers,e)}):this.resolvers=(0,o.mergeDeep)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,o=e.remoteResult,n=e.context,i=e.variables,s=e.onlyRunForcedResolvers,a=void 0!==s&&s;return(0,r.__awaiter)(this,void 0,void 0,function(){return(0,r.__generator)(this,function(e){return t?[2,this.resolveDocument(t,o.data,n,i,this.fragmentMatcher,a).then(function(e){return(0,r.__assign)({},o,{data:e.result})})]:[2,o]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,o.hasDirectives)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?(0,o.removeClientSetsFromDocument)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return(0,r.__assign)({},e,{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);(0,s.invariant)(!1,17)}})},e.prototype.addExportedVariables=function(e,t,o){return void 0===t&&(t={}),void 0===o&&(o={}),(0,r.__awaiter)(this,void 0,void 0,function(){return(0,r.__generator)(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(o),t).then(function(e){return(0,r.__assign)({},t,e.exportedVariables)})]:[2,(0,r.__assign)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,a.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return a.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,o.buildQueryFromSelectionSet)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,i,s,a){return void 0===n&&(n={}),void 0===i&&(i={}),void 0===s&&(s=function(){return!0}),void 0===a&&(a=!1),(0,r.__awaiter)(this,void 0,void 0,function(){var u,c,l,h,p,y,f,v,d;return(0,r.__generator)(this,function(b){var m;return u=(0,o.getMainDefinition)(e),c=(0,o.getFragmentDefinitions)(e),l=(0,o.createFragmentMap)(c),h=u.operation,p=h?(m=h).charAt(0).toUpperCase()+m.slice(1):"Query",f=(y=this).cache,v=y.client,d={fragmentMap:l,context:(0,r.__assign)({},n,{cache:f,client:v}),variables:i,fragmentMatcher:s,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(u.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,function(){var i,a,u,c,l,h=this;return(0,r.__generator)(this,function(p){return i=n.fragmentMap,a=n.context,u=n.variables,c=[t],l=function(e){return(0,r.__awaiter)(h,void 0,void 0,function(){var l,h;return(0,r.__generator)(this,function(r){return(0,o.shouldInclude)(e,u)?(0,o.isField)(e)?[2,this.resolveField(e,t,n).then(function(t){var r;void 0!==t&&c.push(((r={})[(0,o.resultKeyNameFromField)(e)]=t,r))})]:((0,o.isInlineFragment)(e)?l=e:(l=i[e.name.value],(0,s.invariant)(l,18)),l&&l.typeCondition&&(h=l.typeCondition.name.value,n.fragmentMatcher(t,h,a))?[2,this.resolveSelectionSet(l.selectionSet,t,n).then(function(e){c.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return(0,o.mergeDeepArray)(c)})]})})},e.prototype.resolveField=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,function(){var i,s,a,u,c,l,h,p,y,f=this;return(0,r.__generator)(this,function(r){return i=n.variables,s=e.name.value,a=(0,o.resultKeyNameFromField)(e),u=s!==a,c=t[a]||t[s],l=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(h=t.__typename||n.defaultOperationType,(p=this.resolvers&&this.resolvers[h])&&(y=p[u?s:a])&&(l=Promise.resolve(y(t,(0,o.argumentsObjectFromField)(e,i),n.context,{field:e})))),[2,l.then(function(t){return void 0===t&&(t=c),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,n):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,n):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var o=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?o.resolveSubSelectedArray(e,t,r):e.selectionSet?o.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function S(e){var t=new Set,r=null;return new c(function(o){return t.add(o),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(o)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var q=Object.prototype.hasOwnProperty,R=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,s=e.onBroadcast,a=void 0===s?function(){}:s,u=e.ssrMode,c=void 0!==u&&u,l=e.clientAwareness,h=void 0===l?{}:l,p=e.localState,y=e.assumeImmutableResults;this.mutationStore=new g,this.queryStore=new Q,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(o.canUseWeakMap?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=h,this.localState=p||new w({cache:i.getCache()}),this.ssrMode=c,this.assumeImmutableResults=!!y}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new s.InvariantError(6))})},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,i=e.optimisticResponse,a=e.updateQueries,u=e.refetchQueries,c=void 0===u?[]:u,h=e.awaitRefetchQueries,p=void 0!==h&&h,y=e.update,v=e.errorPolicy,d=void 0===v?"none":v,b=e.fetchPolicy,m=e.context,g=void 0===m?{}:m;return(0,r.__awaiter)(this,void 0,void 0,function(){var e,u,h,v=this;return(0,r.__generator)(this,function(m){switch(m.label){case 0:return(0,s.invariant)(t,7),(0,s.invariant)(!b||"no-cache"===b,8),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,g)]:[3,2];case 1:n=m.sent(),m.label=2;case 2:return u=function(){var e={};return a&&v.queries.forEach(function(t,r){var o=t.observableQuery;if(o){var n=o.queryName;n&&q.call(a,n)&&(e[r]={updater:a[n],query:v.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:u(),update:y,optimisticResponse:i}),this.broadcastQueries(),h=this,[2,new Promise(function(s,a){var v,m;h.getObservableFromLink(t,(0,r.__assign)({},g,{optimisticResponse:i}),n,!1).subscribe({next:function(r){(0,o.graphQLResultHasError)(r)&&"none"===d?m=new f({graphQLErrors:r.errors}):(h.mutationStore.markMutationResult(e),"no-cache"!==b&&h.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:u(),update:y}),v=r)},error:function(t){h.mutationStore.markMutationError(e,t),h.dataStore.markMutationComplete({mutationId:e,optimisticResponse:i}),h.broadcastQueries(),h.setQuery(e,function(){return{document:null}}),a(new f({networkError:t}))},complete:function(){if(m&&h.mutationStore.markMutationError(e,m),h.dataStore.markMutationComplete({mutationId:e,optimisticResponse:i}),h.broadcastQueries(),m)a(m);else{"function"==typeof c&&(c=c(v));var t=[];l(c)&&c.forEach(function(e){if("string"==typeof e)h.queries.forEach(function(r){var o=r.observableQuery;o&&o.queryName===e&&t.push(o.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(h.query(r))}}),Promise.all(p?t:[]).then(function(){h.setQuery(e,function(){return{document:null}}),"ignore"===d&&v&&(0,o.graphQLResultHasError)(v)&&delete v.errors,s(v)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,n,i){return(0,r.__awaiter)(this,void 0,void 0,function(){var s,a,u,c,l,y,v,d,b,m,g,Q,w,S,q,R,k,E,_=this;return(0,r.__generator)(this,function(I){switch(I.label){case 0:return s=t.metadata,a=void 0===s?null:s,u=t.fetchPolicy,c=void 0===u?"cache-first":u,l=t.context,y=void 0===l?{}:l,v=this.transform(t.query).document,d=this.getVariables(v,t.variables),this.transform(v).hasClientExports?[4,this.localState.addExportedVariables(v,d,y)]:[3,2];case 1:d=I.sent(),I.label=2;case 2:if(t=(0,r.__assign)({},t,{variables:d}),g=m="network-only"===c||"no-cache"===c,m||(Q=this.dataStore.getCache().diff({query:v,variables:d,returnPartialData:!0,optimistic:!1}),w=Q.complete,S=Q.result,g=!w||"cache-and-network"===c,b=S),q=g&&"cache-only"!==c&&"standby"!==c,(0,o.hasDirectives)(["live"],v)&&(q=!0),R=this.idCounter++,k="no-cache"!==c?this.updateQueryWatch(e,v,t):void 0,this.setQuery(e,function(){return{document:v,lastRequestId:R,invalidated:!0,cancel:k}}),this.invalidate(i),this.queryStore.initQuery({queryId:e,document:v,storePreviousVariables:q,variables:d,isPoll:n===p.poll,isRefetch:n===p.refetch,metadata:a,fetchMoreForQueryId:i}),this.broadcastQueries(),q){if(E=this.fetchRequest({requestId:R,queryId:e,document:v,options:t,fetchMoreForQueryId:i}).catch(function(t){throw h(t)?t:(R>=_.getQuery(e).lastRequestId&&(_.queryStore.markQueryError(e,t,i),_.invalidate(e),_.invalidate(i),_.broadcastQueries()),new f({networkError:t}))}),"cache-and-network"!==c)return[2,E];E.catch(function(){})}return this.queryStore.markQueryResultClient(e,!q),this.invalidate(e),this.invalidate(i),this.transform(v).hasForcedResolvers?[2,this.localState.runResolvers({document:v,remoteResult:{data:b},context:y,variables:d,onlyRunForcedResolvers:!0}).then(function(r){return _.markQueryResult(e,r,t,i),_.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:b}])}})})},e.prototype.markQueryResult=function(e,t,r,o){var n=r.fetchPolicy,i=r.variables,s=r.errorPolicy;"no-cache"===n?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,i,o,"ignore"===s||"all"===s)},e.prototype.queryListenerForObserver=function(e,t,r){var o=this;function n(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,i){if(o.invalidate(e,!1),r){var s=o.getQuery(e),a=s.observableQuery,c=s.document,h=a?a.options.fetchPolicy:t.fetchPolicy;if("standby"!==h){var p=u(r.networkStatus),y=a&&a.getLastResult(),v=!(!y||y.networkStatus===r.networkStatus),d=t.returnPartialData||!i&&r.previousVariables||v&&t.notifyOnNetworkStatusChange||"cache-only"===h||"cache-and-network"===h;if(!p||d){var b=l(r.graphQLErrors),m=a&&a.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&b||r.networkError)return n("error",new f({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var g=void 0,Q=void 0;if(i)"no-cache"!==h&&"network-only"!==h&&o.setQuery(e,function(){return{newData:null}}),g=i.result,Q=!i.complete;else{var w=a&&a.getLastError(),S="none"!==m&&(w&&w.graphQLErrors)!==r.graphQLErrors;if(y&&y.data&&!S)g=y.data,Q=!1;else{var q=o.dataStore.getCache().diff({query:c,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});g=q.result,Q=!q.complete}}var R=Q&&!(t.returnPartialData||"cache-only"===h),k={data:R?y&&y.data:g,loading:p,networkStatus:r.networkStatus,stale:R};"all"===m&&b&&(k.errors=r.graphQLErrors),n("next",k)}catch(e){n("error",new f({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.dataStore.getCache(),n=r.transformDocument(e),i=(0,o.removeConnectionDirectiveFromDocument)(r.transformForLink(n)),s=this.localState.clientQuery(n),a=this.localState.serverQuery(i),u={document:n,hasClientExports:(0,o.hasClientExports)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:s,serverQuery:a,defaultVars:(0,o.getDefaultValues)((0,o.getOperationDefinition)(n))},c=function(e){e&&!t.has(e)&&t.set(e,u)};c(e),c(n),c(s),c(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,r.__assign)({},this.transform(e).defaultVars,t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),(0,s.invariant)("standby"!==e.fetchPolicy,9),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var o=(0,r.__assign)({},e);return new v({queryManager:this,options:o,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return(0,s.invariant)(e.query,10),(0,s.invariant)("Document"===e.query.kind,11),(0,s.invariant)(!e.returnPartialData,12),(0,s.invariant)(!e.pollInterval,13),new Promise(function(r,o){var n=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+n.queryId,o),n.result().then(r,o).then(function(){return t.fetchQueryRejectFns.delete("query:"+n.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var o=this,n=this.getQuery(e).cancel;n&&n();return this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=o.getQuery(e).observableQuery;if(r){var n=r.getLastResult();n&&(t=n.data)}return t},callback:function(t){o.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new s.InvariantError(14))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(o,n){var i=o.observableQuery;if(i){var s=i.options.fetchPolicy;i.resetLastResults(),"cache-only"===s||!e&&"standby"===s||r.push(i.refetch()),t.setQuery(n,function(){return{newData:null}}),t.invalidate(n)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var s=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),(0,o.graphQLResultHasError)(i))throw new f({graphQLErrors:i.errors});return i})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(s);return new c(function(e){var t=null;return a.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return s(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,o=r.variables,n=r.query,i=r.fetchPolicy,s=r.returnPartialData,a=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===i||"network-only"===i)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:n,variables:o,previousResult:a?a.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||s?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;(0,s.invariant)(r,15),t=r}else t=e;var o=t.options,n=o.variables,i=o.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:n,document:i}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(o){o&&o(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,i,s){var a,u=this;void 0===s&&(s=this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,y={query:l,variables:i,operationName:(0,o.getOperationName)(l)||void 0,context:this.prepareContext((0,r.__assign)({},t,{forceFetch:!s}))};if(t=y.context,s){var f=h.get(l)||new Map;h.set(l,f);var v=JSON.stringify(i);if(!(a=f.get(v))){f.set(v,a=S((0,n.execute)(p,y)));var d=function(){f.delete(v),f.size||h.delete(l),b.unsubscribe()},b=a.subscribe({next:d,error:d,complete:d})}}else a=S((0,n.execute)(p,y))}else a=c.of({data:{}}),t=this.prepareContext(t);var m=this.transform(e).clientQuery;return m&&(a=function(e,t){return new c(function(r){var o=r.next,n=r.error,i=r.complete,s=0,a=!1,u={next:function(e){++s,new Promise(function(r){r(t(e))}).then(function(e){--s,o&&o.call(r,e),a&&u.complete()},function(e){--s,n&&n.call(r,e)})},error:function(e){n&&n.call(r,e)},complete:function(){a=!0,s||i&&i.call(r)}},c=e.subscribe(u);return function(){return c.unsubscribe()}})}(a,function(e){return u.localState.runResolvers({document:m,remoteResult:e,context:t,variables:i})})),a},e.prototype.fetchRequest=function(e){var r,o,n=this,i=e.requestId,s=e.queryId,a=e.document,u=e.options,c=e.fetchMoreForQueryId,h=u.variables,p=u.errorPolicy,y=void 0===p?"none":p,v=u.fetchPolicy;return new Promise(function(e,p){var d=n.getObservableFromLink(a,u.context,h),b="fetchRequest:"+s;n.fetchQueryRejectFns.set(b,p);var m=function(){n.fetchQueryRejectFns.delete(b),n.setQuery(s,function(e){e.subscriptions.delete(g)})},g=d.map(function(e){if(i>=n.getQuery(s).lastRequestId&&(n.markQueryResult(s,e,u,c),n.queryStore.markQueryResult(s,e,c),n.invalidate(s),n.invalidate(c),n.broadcastQueries()),"none"===y&&l(e.errors))return p(new f({graphQLErrors:e.errors}));if("all"===y&&(o=e.errors),c||"no-cache"===v)r=e.data;else{var t=n.dataStore.getCache().diff({variables:h,query:a,optimistic:!1,returnPartialData:!0}),d=t.result;(t.complete||u.returnPartialData)&&(r=d)}}).subscribe({error:function(e){m(),p(e)},complete:function(){m(),e({data:r,errors:o,loading:!1,networkStatus:t.ready,stale:!1})}});n.setQuery(s,function(e){e.subscriptions.add(g)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var o=this.getQuery(e),n=(0,r.__assign)({},o,t(o));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,r.__assign)({},t,{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var r=this.queryStore.get(e);return r&&r.networkStatus!==t.ready&&r.networkStatus!==t.error},e.prototype.startPollingQuery=function(e,t,o){var n=this,i=e.pollInterval;if((0,s.invariant)(i,16),!this.ssrMode){var a=this.pollingInfoByQueryId.get(t);a||this.pollingInfoByQueryId.set(t,a={}),a.interval=i,a.options=(0,r.__assign)({},e,{fetchPolicy:"network-only"});var u=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?c():n.fetchQuery(t,e.options,p.poll).then(c,c))},c=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(u,e.interval))};o&&this.addQueryListener(t,o),c()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),k=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var s=!(0,o.graphQLResultHasError)(e);i&&(0,o.graphQLResultHasError)(e)&&e.data&&(s=!0),!n&&s&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){(0,o.graphQLResultHasError)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(o){var n=r.cache;r.cache=o;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=n}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!(0,o.graphQLResultHasError)(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(i){var s=n[i],a=s.query,u=s.updater,c=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),l=c.result;if(c.complete){var h=(0,o.tryFunctionOrLogError)(function(){return u(l,{mutationResult:e.result,queryName:(0,o.getOperationName)(a.document)||void 0,queryVariables:a.variables})});h&&r.push({result:h,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&(0,o.tryFunctionOrLogError)(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),E="2.6.3",_=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,o=e.ssrMode,i=void 0!==o&&o,a=e.ssrForceFetchDelay,u=void 0===a?0:a,c=e.connectToDevTools,l=e.queryDeduplication,h=void 0===l||l,p=e.defaultOptions,y=e.assumeImmutableResults,f=void 0!==y&&y,v=e.resolvers,d=e.typeDefs,b=e.fragmentMatcher,m=e.name,g=e.version,Q=e.link;if(!Q&&v&&(Q=n.ApolloLink.empty()),!Q||!r)throw new s.InvariantError(1);this.link=Q,this.cache=r,this.store=new k(r),this.disableNetworkFetches=i||u>0,this.queryDeduplication=h,this.defaultOptions=p||{},this.typeDefs=d,u&&setTimeout(function(){return t.disableNetworkFetches=!1},u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);void 0!==c&&(c&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version=E,this.localState=new w({cache:r,client:this,resolvers:v,fragmentMatcher:b}),this.queryManager=new R({link:this.link,store:this.store,queryDeduplication:h,ssrMode:i,clientAwareness:{name:m,version:g},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,r.__assign)({},this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,r.__assign)({},e,{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,r.__assign)({},this.defaultOptions.query,e)),(0,s.invariant)("cache-and-network"!==e.fetchPolicy,2),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,r.__assign)({},e,{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,r.__assign)({},this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,n.execute)(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}();exports.ApolloClient=_;var I=_;exports.default=I; diff --git a/node_modules/apollo-client/bundle.esm.js b/node_modules/apollo-client/bundle.esm.js new file mode 100644 index 000000000..a08e45951 --- /dev/null +++ b/node_modules/apollo-client/bundle.esm.js @@ -0,0 +1,2107 @@ +import { __extends, __assign, __awaiter, __generator } from 'tslib'; +import { getOperationDefinition, isEqual, tryFunctionOrLogError, cloneDeep, mergeDeep, hasDirectives, removeClientSetsFromDocument, buildQueryFromSelectionSet, getMainDefinition, getFragmentDefinitions, createFragmentMap, mergeDeepArray, resultKeyNameFromField, argumentsObjectFromField, shouldInclude, isField, isInlineFragment, canUseWeakMap, graphQLResultHasError, removeConnectionDirectiveFromDocument, hasClientExports, getDefaultValues, getOperationName } from 'apollo-utilities'; +import { Observable as Observable$1, execute, ApolloLink } from 'apollo-link'; +import $$observable from 'symbol-observable'; +import { InvariantError, invariant } from 'ts-invariant'; +import { visit, BREAK } from 'graphql/language/visitor'; + +var NetworkStatus; +(function (NetworkStatus) { + NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; + NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; + NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; + NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; + NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; + NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; + NetworkStatus[NetworkStatus["error"] = 8] = "error"; +})(NetworkStatus || (NetworkStatus = {})); +function isNetworkRequestInFlight(networkStatus) { + return networkStatus < 7; +} + +var Observable = (function (_super) { + __extends(Observable, _super); + function Observable() { + return _super !== null && _super.apply(this, arguments) || this; + } + Observable.prototype[$$observable] = function () { + return this; + }; + Observable.prototype['@@observable'] = function () { + return this; + }; + return Observable; +}(Observable$1)); + +function isNonEmptyArray(value) { + return Array.isArray(value) && value.length > 0; +} + +function isApolloError(err) { + return err.hasOwnProperty('graphQLErrors'); +} +var generateErrorMessage = function (err) { + var message = ''; + if (isNonEmptyArray(err.graphQLErrors)) { + err.graphQLErrors.forEach(function (graphQLError) { + var errorMessage = graphQLError + ? graphQLError.message + : 'Error message not found.'; + message += "GraphQL error: " + errorMessage + "\n"; + }); + } + if (err.networkError) { + message += 'Network error: ' + err.networkError.message + '\n'; + } + message = message.replace(/\n$/, ''); + return message; +}; +var ApolloError = (function (_super) { + __extends(ApolloError, _super); + function ApolloError(_a) { + var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo; + var _this = _super.call(this, errorMessage) || this; + _this.graphQLErrors = graphQLErrors || []; + _this.networkError = networkError || null; + if (!errorMessage) { + _this.message = generateErrorMessage(_this); + } + else { + _this.message = errorMessage; + } + _this.extraInfo = extraInfo; + _this.__proto__ = ApolloError.prototype; + return _this; + } + return ApolloError; +}(Error)); + +var FetchType; +(function (FetchType) { + FetchType[FetchType["normal"] = 1] = "normal"; + FetchType[FetchType["refetch"] = 2] = "refetch"; + FetchType[FetchType["poll"] = 3] = "poll"; +})(FetchType || (FetchType = {})); + +var hasError = function (storeValue, policy) { + if (policy === void 0) { policy = 'none'; } + return storeValue && (storeValue.networkError || + (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))); +}; +var ObservableQuery = (function (_super) { + __extends(ObservableQuery, _super); + function ObservableQuery(_a) { + var queryManager = _a.queryManager, options = _a.options, _b = _a.shouldSubscribe, shouldSubscribe = _b === void 0 ? true : _b; + var _this = _super.call(this, function (observer) { + return _this.onSubscribe(observer); + }) || this; + _this.observers = new Set(); + _this.subscriptions = new Set(); + _this.isTornDown = false; + _this.options = options; + _this.variables = options.variables || {}; + _this.queryId = queryManager.generateQueryId(); + _this.shouldSubscribe = shouldSubscribe; + var opDef = getOperationDefinition(options.query); + _this.queryName = opDef && opDef.name && opDef.name.value; + _this.queryManager = queryManager; + return _this; + } + ObservableQuery.prototype.result = function () { + var _this = this; + return new Promise(function (resolve, reject) { + var observer = { + next: function (result) { + resolve(result); + _this.observers.delete(observer); + if (!_this.observers.size) { + _this.queryManager.removeQuery(_this.queryId); + } + setTimeout(function () { + subscription.unsubscribe(); + }, 0); + }, + error: reject, + }; + var subscription = _this.subscribe(observer); + }); + }; + ObservableQuery.prototype.currentResult = function () { + var result = this.getCurrentResult(); + if (result.data === undefined) { + result.data = {}; + } + return result; + }; + ObservableQuery.prototype.getCurrentResult = function () { + if (this.isTornDown) { + var lastResult = this.lastResult; + return { + data: !this.lastError && lastResult && lastResult.data || void 0, + error: this.lastError, + loading: false, + networkStatus: NetworkStatus.error, + }; + } + var _a = this.queryManager.getCurrentQueryResult(this), data = _a.data, partial = _a.partial; + var queryStoreValue = this.queryManager.queryStore.get(this.queryId); + var result; + var fetchPolicy = this.options.fetchPolicy; + var isNetworkFetchPolicy = fetchPolicy === 'network-only' || + fetchPolicy === 'no-cache'; + if (queryStoreValue) { + var networkStatus = queryStoreValue.networkStatus; + if (hasError(queryStoreValue, this.options.errorPolicy)) { + return { + data: void 0, + loading: false, + networkStatus: networkStatus, + error: new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError, + }), + }; + } + if (queryStoreValue.variables) { + this.options.variables = __assign({}, this.options.variables, queryStoreValue.variables); + this.variables = this.options.variables; + } + result = { + data: data, + loading: isNetworkRequestInFlight(networkStatus), + networkStatus: networkStatus, + }; + if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { + result.errors = queryStoreValue.graphQLErrors; + } + } + else { + var loading = isNetworkFetchPolicy || + (partial && fetchPolicy !== 'cache-only'); + result = { + data: data, + loading: loading, + networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready, + }; + } + if (!partial) { + this.updateLastResult(__assign({}, result, { stale: false })); + } + return __assign({}, result, { partial: partial }); + }; + ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { + var snapshot = this.lastResultSnapshot; + return !(snapshot && + newResult && + snapshot.networkStatus === newResult.networkStatus && + snapshot.stale === newResult.stale && + isEqual(snapshot.data, newResult.data)); + }; + ObservableQuery.prototype.getLastResult = function () { + return this.lastResult; + }; + ObservableQuery.prototype.getLastError = function () { + return this.lastError; + }; + ObservableQuery.prototype.resetLastResults = function () { + delete this.lastResult; + delete this.lastResultSnapshot; + delete this.lastError; + this.isTornDown = false; + }; + ObservableQuery.prototype.resetQueryStoreErrors = function () { + var queryStore = this.queryManager.queryStore.get(this.queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + }; + ObservableQuery.prototype.refetch = function (variables) { + var fetchPolicy = this.options.fetchPolicy; + if (fetchPolicy === 'cache-only') { + return Promise.reject(process.env.NODE_ENV === "production" ? new InvariantError(3) : new InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); + } + if (fetchPolicy !== 'no-cache' && + fetchPolicy !== 'cache-and-network') { + fetchPolicy = 'network-only'; + } + if (!isEqual(this.variables, variables)) { + this.variables = __assign({}, this.variables, variables); + } + if (!isEqual(this.options.variables, this.variables)) { + this.options.variables = __assign({}, this.options.variables, this.variables); + } + return this.queryManager.fetchQuery(this.queryId, __assign({}, this.options, { fetchPolicy: fetchPolicy }), FetchType.refetch); + }; + ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { + var _this = this; + process.env.NODE_ENV === "production" ? invariant(fetchMoreOptions.updateQuery, 4) : invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); + var combinedOptions = __assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign({}, this.options, fetchMoreOptions, { variables: __assign({}, this.variables, fetchMoreOptions.variables) })), { fetchPolicy: 'network-only' }); + var qid = this.queryManager.generateQueryId(); + return this.queryManager + .fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId) + .then(function (fetchMoreResult) { + _this.updateQuery(function (previousResult) { + return fetchMoreOptions.updateQuery(previousResult, { + fetchMoreResult: fetchMoreResult.data, + variables: combinedOptions.variables, + }); + }); + _this.queryManager.stopQuery(qid); + return fetchMoreResult; + }, function (error) { + _this.queryManager.stopQuery(qid); + throw error; + }); + }; + ObservableQuery.prototype.subscribeToMore = function (options) { + var _this = this; + var subscription = this.queryManager + .startGraphQLSubscription({ + query: options.document, + variables: options.variables, + }) + .subscribe({ + next: function (subscriptionData) { + var updateQuery = options.updateQuery; + if (updateQuery) { + _this.updateQuery(function (previous, _a) { + var variables = _a.variables; + return updateQuery(previous, { + subscriptionData: subscriptionData, + variables: variables, + }); + }); + } + }, + error: function (err) { + if (options.onError) { + options.onError(err); + return; + } + process.env.NODE_ENV === "production" || invariant.error('Unhandled GraphQL subscription error', err); + }, + }); + this.subscriptions.add(subscription); + return function () { + if (_this.subscriptions.delete(subscription)) { + subscription.unsubscribe(); + } + }; + }; + ObservableQuery.prototype.setOptions = function (opts) { + var oldFetchPolicy = this.options.fetchPolicy; + this.options = __assign({}, this.options, opts); + if (opts.pollInterval) { + this.startPolling(opts.pollInterval); + } + else if (opts.pollInterval === 0) { + this.stopPolling(); + } + var fetchPolicy = opts.fetchPolicy; + return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || + oldFetchPolicy === 'standby' || + fetchPolicy === 'network-only'), opts.fetchResults); + }; + ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { + if (tryFetch === void 0) { tryFetch = false; } + if (fetchResults === void 0) { fetchResults = true; } + this.isTornDown = false; + variables = variables || this.variables; + if (!tryFetch && isEqual(variables, this.variables)) { + return this.observers.size && fetchResults + ? this.result() + : Promise.resolve(); + } + this.variables = this.options.variables = variables; + if (!this.observers.size) { + return Promise.resolve(); + } + return this.queryManager.fetchQuery(this.queryId, this.options); + }; + ObservableQuery.prototype.updateQuery = function (mapFn) { + var queryManager = this.queryManager; + var _a = queryManager.getQueryWithPreviousResult(this.queryId), previousResult = _a.previousResult, variables = _a.variables, document = _a.document; + var newResult = tryFunctionOrLogError(function () { + return mapFn(previousResult, { variables: variables }); + }); + if (newResult) { + queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); + queryManager.broadcastQueries(); + } + }; + ObservableQuery.prototype.stopPolling = function () { + this.queryManager.stopPollingQuery(this.queryId); + this.options.pollInterval = undefined; + }; + ObservableQuery.prototype.startPolling = function (pollInterval) { + assertNotCacheFirstOrOnly(this); + this.options.pollInterval = pollInterval; + this.queryManager.startPollingQuery(this.options, this.queryId); + }; + ObservableQuery.prototype.updateLastResult = function (newResult) { + var previousResult = this.lastResult; + this.lastResult = newResult; + this.lastResultSnapshot = this.queryManager.assumeImmutableResults + ? newResult + : cloneDeep(newResult); + return previousResult; + }; + ObservableQuery.prototype.onSubscribe = function (observer) { + var _this = this; + try { + var subObserver = observer._subscription._observer; + if (subObserver && !subObserver.error) { + subObserver.error = defaultSubscriptionObserverErrorCallback; + } + } + catch (_a) { } + var first = !this.observers.size; + this.observers.add(observer); + if (observer.next && this.lastResult) + observer.next(this.lastResult); + if (observer.error && this.lastError) + observer.error(this.lastError); + if (first) { + this.setUpQuery(); + } + return function () { + if (_this.observers.delete(observer) && !_this.observers.size) { + _this.tearDownQuery(); + } + }; + }; + ObservableQuery.prototype.setUpQuery = function () { + var _this = this; + var _a = this, queryManager = _a.queryManager, queryId = _a.queryId; + if (this.shouldSubscribe) { + queryManager.addObservableQuery(queryId, this); + } + if (this.options.pollInterval) { + assertNotCacheFirstOrOnly(this); + queryManager.startPollingQuery(this.options, queryId); + } + var onError = function (error) { + iterateObserversSafely(_this.observers, 'error', _this.lastError = error); + }; + queryManager.observeQuery(queryId, this.options, { + next: function (result) { + if (_this.lastError || _this.isDifferentFromLastResult(result)) { + var previousResult_1 = _this.updateLastResult(result); + var _a = _this.options, query_1 = _a.query, variables = _a.variables, fetchPolicy_1 = _a.fetchPolicy; + if (queryManager.transform(query_1).hasClientExports) { + queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { + var previousVariables = _this.variables; + _this.variables = _this.options.variables = variables; + if (!result.loading && + previousResult_1 && + fetchPolicy_1 !== 'cache-only' && + queryManager.transform(query_1).serverQuery && + !isEqual(previousVariables, variables)) { + _this.refetch(); + } + else { + iterateObserversSafely(_this.observers, 'next', result); + } + }); + } + else { + iterateObserversSafely(_this.observers, 'next', result); + } + } + }, + error: onError, + }).catch(onError); + }; + ObservableQuery.prototype.tearDownQuery = function () { + var queryManager = this.queryManager; + this.isTornDown = true; + queryManager.stopPollingQuery(this.queryId); + this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); }); + this.subscriptions.clear(); + queryManager.removeObservableQuery(this.queryId); + queryManager.stopQuery(this.queryId); + this.observers.clear(); + }; + return ObservableQuery; +}(Observable)); +function defaultSubscriptionObserverErrorCallback(error) { + process.env.NODE_ENV === "production" || invariant.error('Unhandled error', error.message, error.stack); +} +function iterateObserversSafely(observers, method, argument) { + var observersWithMethod = []; + observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); }); + observersWithMethod.forEach(function (obs) { return obs[method](argument); }); +} +function assertNotCacheFirstOrOnly(obsQuery) { + var fetchPolicy = obsQuery.options.fetchPolicy; + process.env.NODE_ENV === "production" ? invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 5) : invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); +} + +var MutationStore = (function () { + function MutationStore() { + this.store = {}; + } + MutationStore.prototype.getStore = function () { + return this.store; + }; + MutationStore.prototype.get = function (mutationId) { + return this.store[mutationId]; + }; + MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { + this.store[mutationId] = { + mutation: mutation, + variables: variables || {}, + loading: true, + error: null, + }; + }; + MutationStore.prototype.markMutationError = function (mutationId, error) { + var mutation = this.store[mutationId]; + if (mutation) { + mutation.loading = false; + mutation.error = error; + } + }; + MutationStore.prototype.markMutationResult = function (mutationId) { + var mutation = this.store[mutationId]; + if (mutation) { + mutation.loading = false; + mutation.error = null; + } + }; + MutationStore.prototype.reset = function () { + this.store = {}; + }; + return MutationStore; +}()); + +var QueryStore = (function () { + function QueryStore() { + this.store = {}; + } + QueryStore.prototype.getStore = function () { + return this.store; + }; + QueryStore.prototype.get = function (queryId) { + return this.store[queryId]; + }; + QueryStore.prototype.initQuery = function (query) { + var previousQuery = this.store[query.queryId]; + process.env.NODE_ENV === "production" ? invariant(!previousQuery || + previousQuery.document === query.document || + isEqual(previousQuery.document, query.document), 19) : invariant(!previousQuery || + previousQuery.document === query.document || + isEqual(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); + var isSetVariables = false; + var previousVariables = null; + if (query.storePreviousVariables && + previousQuery && + previousQuery.networkStatus !== NetworkStatus.loading) { + if (!isEqual(previousQuery.variables, query.variables)) { + isSetVariables = true; + previousVariables = previousQuery.variables; + } + } + var networkStatus; + if (isSetVariables) { + networkStatus = NetworkStatus.setVariables; + } + else if (query.isPoll) { + networkStatus = NetworkStatus.poll; + } + else if (query.isRefetch) { + networkStatus = NetworkStatus.refetch; + } + else { + networkStatus = NetworkStatus.loading; + } + var graphQLErrors = []; + if (previousQuery && previousQuery.graphQLErrors) { + graphQLErrors = previousQuery.graphQLErrors; + } + this.store[query.queryId] = { + document: query.document, + variables: query.variables, + previousVariables: previousVariables, + networkError: null, + graphQLErrors: graphQLErrors, + networkStatus: networkStatus, + metadata: query.metadata, + }; + if (typeof query.fetchMoreForQueryId === 'string' && + this.store[query.fetchMoreForQueryId]) { + this.store[query.fetchMoreForQueryId].networkStatus = + NetworkStatus.fetchMore; + } + }; + QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) + return; + this.store[queryId].networkError = null; + this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; + this.store[queryId].previousVariables = null; + this.store[queryId].networkStatus = NetworkStatus.ready; + if (typeof fetchMoreForQueryId === 'string' && + this.store[fetchMoreForQueryId]) { + this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; + } + }; + QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) + return; + this.store[queryId].networkError = error; + this.store[queryId].networkStatus = NetworkStatus.error; + if (typeof fetchMoreForQueryId === 'string') { + this.markQueryResultClient(fetchMoreForQueryId, true); + } + }; + QueryStore.prototype.markQueryResultClient = function (queryId, complete) { + var storeValue = this.store && this.store[queryId]; + if (storeValue) { + storeValue.networkError = null; + storeValue.previousVariables = null; + if (complete) { + storeValue.networkStatus = NetworkStatus.ready; + } + } + }; + QueryStore.prototype.stopQuery = function (queryId) { + delete this.store[queryId]; + }; + QueryStore.prototype.reset = function (observableQueryIds) { + var _this = this; + Object.keys(this.store).forEach(function (queryId) { + if (observableQueryIds.indexOf(queryId) < 0) { + _this.stopQuery(queryId); + } + else { + _this.store[queryId].networkStatus = NetworkStatus.loading; + } + }); + }; + return QueryStore; +}()); + +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +var LocalState = (function () { + function LocalState(_a) { + var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher; + this.cache = cache; + if (client) { + this.client = client; + } + if (resolvers) { + this.addResolvers(resolvers); + } + if (fragmentMatcher) { + this.setFragmentMatcher(fragmentMatcher); + } + } + LocalState.prototype.addResolvers = function (resolvers) { + var _this = this; + this.resolvers = this.resolvers || {}; + if (Array.isArray(resolvers)) { + resolvers.forEach(function (resolverGroup) { + _this.resolvers = mergeDeep(_this.resolvers, resolverGroup); + }); + } + else { + this.resolvers = mergeDeep(this.resolvers, resolvers); + } + }; + LocalState.prototype.setResolvers = function (resolvers) { + this.resolvers = {}; + this.addResolvers(resolvers); + }; + LocalState.prototype.getResolvers = function () { + return this.resolvers || {}; + }; + LocalState.prototype.runResolvers = function (_a) { + var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_c) { + if (document) { + return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign({}, remoteResult, { data: localResult.result })); })]; + } + return [2, remoteResult]; + }); + }); + }; + LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { + this.fragmentMatcher = fragmentMatcher; + }; + LocalState.prototype.getFragmentMatcher = function () { + return this.fragmentMatcher; + }; + LocalState.prototype.clientQuery = function (document) { + if (hasDirectives(['client'], document)) { + if (this.resolvers) { + return document; + } + process.env.NODE_ENV === "production" || invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + + 'were specified. This means ApolloClient local resolver handling ' + + 'has been disabled, and @client directives will be passed through ' + + 'to your link chain.'); + } + return null; + }; + LocalState.prototype.serverQuery = function (document) { + return this.resolvers ? removeClientSetsFromDocument(document) : document; + }; + LocalState.prototype.prepareContext = function (context) { + if (context === void 0) { context = {}; } + var cache = this.cache; + var newContext = __assign({}, context, { cache: cache, getCacheKey: function (obj) { + if (cache.config) { + return cache.config.dataIdFromObject(obj); + } + else { + process.env.NODE_ENV === "production" ? invariant(false, 17) : invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); + } + } }); + return newContext; + }; + LocalState.prototype.addExportedVariables = function (document, variables, context) { + if (variables === void 0) { variables = {}; } + if (context === void 0) { context = {}; } + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (document) { + return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign({}, variables, data.exportedVariables)); })]; + } + return [2, __assign({}, variables)]; + }); + }); + }; + LocalState.prototype.shouldForceResolvers = function (document) { + var forceResolvers = false; + visit(document, { + Directive: { + enter: function (node) { + if (node.name.value === 'client' && node.arguments) { + forceResolvers = node.arguments.some(function (arg) { + return arg.name.value === 'always' && + arg.value.kind === 'BooleanValue' && + arg.value.value === true; + }); + if (forceResolvers) { + return BREAK; + } + } + }, + }, + }); + return forceResolvers; + }; + LocalState.prototype.buildRootValueFromCache = function (document, variables) { + return this.cache.diff({ + query: buildQueryFromSelectionSet(document), + variables: variables, + returnPartialData: true, + optimistic: false, + }).result; + }; + LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { + if (context === void 0) { context = {}; } + if (variables === void 0) { variables = {}; } + if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; } + if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; } + return __awaiter(this, void 0, void 0, function () { + var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; + return __generator(this, function (_b) { + mainDefinition = getMainDefinition(document); + fragments = getFragmentDefinitions(document); + fragmentMap = createFragmentMap(fragments); + definitionOperation = mainDefinition + .operation; + defaultOperationType = definitionOperation + ? capitalizeFirstLetter(definitionOperation) + : 'Query'; + _a = this, cache = _a.cache, client = _a.client; + execContext = { + fragmentMap: fragmentMap, + context: __assign({}, context, { cache: cache, + client: client }), + variables: variables, + fragmentMatcher: fragmentMatcher, + defaultOperationType: defaultOperationType, + exportedVariables: {}, + onlyRunForcedResolvers: onlyRunForcedResolvers, + }; + return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({ + result: result, + exportedVariables: execContext.exportedVariables, + }); })]; + }); + }); + }; + LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { + return __awaiter(this, void 0, void 0, function () { + var fragmentMap, context, variables, resultsToMerge, execute; + var _this = this; + return __generator(this, function (_a) { + fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; + resultsToMerge = [rootValue]; + execute = function (selection) { return __awaiter(_this, void 0, void 0, function () { + var fragment, typeCondition; + return __generator(this, function (_a) { + if (!shouldInclude(selection, variables)) { + return [2]; + } + if (isField(selection)) { + return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { + var _a; + if (typeof fieldResult !== 'undefined') { + resultsToMerge.push((_a = {}, + _a[resultKeyNameFromField(selection)] = fieldResult, + _a)); + } + })]; + } + if (isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = fragmentMap[selection.name.value]; + process.env.NODE_ENV === "production" ? invariant(fragment, 18) : invariant(fragment, "No fragment named " + selection.name.value); + } + if (fragment && fragment.typeCondition) { + typeCondition = fragment.typeCondition.name.value; + if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { + return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { + resultsToMerge.push(fragmentResult); + })]; + } + } + return [2]; + }); + }); }; + return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { + return mergeDeepArray(resultsToMerge); + })]; + }); + }); + }; + LocalState.prototype.resolveField = function (field, rootValue, execContext) { + return __awaiter(this, void 0, void 0, function () { + var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; + var _this = this; + return __generator(this, function (_a) { + variables = execContext.variables; + fieldName = field.name.value; + aliasedFieldName = resultKeyNameFromField(field); + aliasUsed = fieldName !== aliasedFieldName; + defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; + resultPromise = Promise.resolve(defaultResult); + if (!execContext.onlyRunForcedResolvers || + this.shouldForceResolvers(field)) { + resolverType = rootValue.__typename || execContext.defaultOperationType; + resolverMap = this.resolvers && this.resolvers[resolverType]; + if (resolverMap) { + resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; + if (resolve) { + resultPromise = Promise.resolve(resolve(rootValue, argumentsObjectFromField(field, variables), execContext.context, { field: field })); + } + } + } + return [2, resultPromise.then(function (result) { + if (result === void 0) { result = defaultResult; } + if (field.directives) { + field.directives.forEach(function (directive) { + if (directive.name.value === 'export' && directive.arguments) { + directive.arguments.forEach(function (arg) { + if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { + execContext.exportedVariables[arg.value.value] = result; + } + }); + } + }); + } + if (!field.selectionSet) { + return result; + } + if (result == null) { + return result; + } + if (Array.isArray(result)) { + return _this.resolveSubSelectedArray(field, result, execContext); + } + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, result, execContext); + } + })]; + }); + }); + }; + LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { + var _this = this; + return Promise.all(result.map(function (item) { + if (item === null) { + return null; + } + if (Array.isArray(item)) { + return _this.resolveSubSelectedArray(field, item, execContext); + } + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, item, execContext); + } + })); + }; + return LocalState; +}()); + +function multiplex(inner) { + var observers = new Set(); + var sub = null; + return new Observable(function (observer) { + observers.add(observer); + sub = sub || inner.subscribe({ + next: function (value) { + observers.forEach(function (obs) { return obs.next && obs.next(value); }); + }, + error: function (error) { + observers.forEach(function (obs) { return obs.error && obs.error(error); }); + }, + complete: function () { + observers.forEach(function (obs) { return obs.complete && obs.complete(); }); + }, + }); + return function () { + if (observers.delete(observer) && !observers.size && sub) { + sub.unsubscribe(); + sub = null; + } + }; + }); +} +function asyncMap(observable, mapFn) { + return new Observable(function (observer) { + var next = observer.next, error = observer.error, complete = observer.complete; + var activeNextCount = 0; + var completed = false; + var handler = { + next: function (value) { + ++activeNextCount; + new Promise(function (resolve) { + resolve(mapFn(value)); + }).then(function (result) { + --activeNextCount; + next && next.call(observer, result); + completed && handler.complete(); + }, function (e) { + --activeNextCount; + error && error.call(observer, e); + }); + }, + error: function (e) { + error && error.call(observer, e); + }, + complete: function () { + completed = true; + if (!activeNextCount) { + complete && complete.call(observer); + } + }, + }; + var sub = observable.subscribe(handler); + return function () { return sub.unsubscribe(); }; + }); +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +var QueryManager = (function () { + function QueryManager(_a) { + var link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, store = _a.store, _c = _a.onBroadcast, onBroadcast = _c === void 0 ? function () { return undefined; } : _c, _d = _a.ssrMode, ssrMode = _d === void 0 ? false : _d, _e = _a.clientAwareness, clientAwareness = _e === void 0 ? {} : _e, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults; + this.mutationStore = new MutationStore(); + this.queryStore = new QueryStore(); + this.clientAwareness = {}; + this.idCounter = 1; + this.queries = new Map(); + this.fetchQueryRejectFns = new Map(); + this.transformCache = new (canUseWeakMap ? WeakMap : Map)(); + this.inFlightLinkObservables = new Map(); + this.pollingInfoByQueryId = new Map(); + this.link = link; + this.queryDeduplication = queryDeduplication; + this.dataStore = store; + this.onBroadcast = onBroadcast; + this.clientAwareness = clientAwareness; + this.localState = localState || new LocalState({ cache: store.getCache() }); + this.ssrMode = ssrMode; + this.assumeImmutableResults = !!assumeImmutableResults; + } + QueryManager.prototype.stop = function () { + var _this = this; + this.queries.forEach(function (_info, queryId) { + _this.stopQueryNoBroadcast(queryId); + }); + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new InvariantError(6) : new InvariantError('QueryManager stopped while query was in flight')); + }); + }; + QueryManager.prototype.mutate = function (_a) { + var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueriesByName = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e; + return __awaiter(this, void 0, void 0, function () { + var mutationId, generateUpdateQueriesInfo, self; + var _this = this; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: + process.env.NODE_ENV === "production" ? invariant(mutation, 7) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); + process.env.NODE_ENV === "production" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 8) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', "fetchPolicy for mutations currently only supports the 'no-cache' policy"); + mutationId = this.generateQueryId(); + mutation = this.transform(mutation).document; + this.setQuery(mutationId, function () { return ({ document: mutation }); }); + variables = this.getVariables(mutation, variables); + if (!this.transform(mutation).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(mutation, variables, context)]; + case 1: + variables = _f.sent(); + _f.label = 2; + case 2: + generateUpdateQueriesInfo = function () { + var ret = {}; + if (updateQueriesByName) { + _this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) { + var queryName = observableQuery.queryName; + if (queryName && + hasOwnProperty.call(updateQueriesByName, queryName)) { + ret[queryId] = { + updater: updateQueriesByName[queryName], + query: _this.queryStore.get(queryId), + }; + } + } + }); + } + return ret; + }; + this.mutationStore.initMutation(mutationId, mutation, variables); + this.dataStore.markMutationInit({ + mutationId: mutationId, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + optimisticResponse: optimisticResponse, + }); + this.broadcastQueries(); + self = this; + return [2, new Promise(function (resolve, reject) { + var storeResult; + var error; + self.getObservableFromLink(mutation, __assign({}, context, { optimisticResponse: optimisticResponse }), variables, false).subscribe({ + next: function (result) { + if (graphQLResultHasError(result) && errorPolicy === 'none') { + error = new ApolloError({ + graphQLErrors: result.errors, + }); + return; + } + self.mutationStore.markMutationResult(mutationId); + if (fetchPolicy !== 'no-cache') { + self.dataStore.markMutationResult({ + mutationId: mutationId, + result: result, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + }); + } + storeResult = result; + }, + error: function (err) { + self.mutationStore.markMutationError(mutationId, err); + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse, + }); + self.broadcastQueries(); + self.setQuery(mutationId, function () { return ({ document: null }); }); + reject(new ApolloError({ + networkError: err, + })); + }, + complete: function () { + if (error) { + self.mutationStore.markMutationError(mutationId, error); + } + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse, + }); + self.broadcastQueries(); + if (error) { + reject(error); + return; + } + if (typeof refetchQueries === 'function') { + refetchQueries = refetchQueries(storeResult); + } + var refetchQueryPromises = []; + if (isNonEmptyArray(refetchQueries)) { + refetchQueries.forEach(function (refetchQuery) { + if (typeof refetchQuery === 'string') { + self.queries.forEach(function (_a) { + var observableQuery = _a.observableQuery; + if (observableQuery && + observableQuery.queryName === refetchQuery) { + refetchQueryPromises.push(observableQuery.refetch()); + } + }); + } + else { + var queryOptions = { + query: refetchQuery.query, + variables: refetchQuery.variables, + fetchPolicy: 'network-only', + }; + if (refetchQuery.context) { + queryOptions.context = refetchQuery.context; + } + refetchQueryPromises.push(self.query(queryOptions)); + } + }); + } + Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { + self.setQuery(mutationId, function () { return ({ document: null }); }); + if (errorPolicy === 'ignore' && + storeResult && + graphQLResultHasError(storeResult)) { + delete storeResult.errors; + } + resolve(storeResult); + }); + }, + }); + })]; + } + }); + }); + }; + QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { + return __awaiter(this, void 0, void 0, function () { + var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; + var _this = this; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; + query = this.transform(options.query).document; + variables = this.getVariables(query, options.variables); + if (!this.transform(query).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(query, variables, context)]; + case 1: + variables = _e.sent(); + _e.label = 2; + case 2: + options = __assign({}, options, { variables: variables }); + isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + needToFetch = isNetworkOnly; + if (!isNetworkOnly) { + _d = this.dataStore.getCache().diff({ + query: query, + variables: variables, + returnPartialData: true, + optimistic: false, + }), complete = _d.complete, result = _d.result; + needToFetch = !complete || fetchPolicy === 'cache-and-network'; + storeResult = result; + } + shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; + if (hasDirectives(['live'], query)) + shouldFetch = true; + requestId = this.idCounter++; + cancel = fetchPolicy !== 'no-cache' + ? this.updateQueryWatch(queryId, query, options) + : undefined; + this.setQuery(queryId, function () { return ({ + document: query, + lastRequestId: requestId, + invalidated: true, + cancel: cancel, + }); }); + this.invalidate(fetchMoreForQueryId); + this.queryStore.initQuery({ + queryId: queryId, + document: query, + storePreviousVariables: shouldFetch, + variables: variables, + isPoll: fetchType === FetchType.poll, + isRefetch: fetchType === FetchType.refetch, + metadata: metadata, + fetchMoreForQueryId: fetchMoreForQueryId, + }); + this.broadcastQueries(); + if (shouldFetch) { + networkResult = this.fetchRequest({ + requestId: requestId, + queryId: queryId, + document: query, + options: options, + fetchMoreForQueryId: fetchMoreForQueryId, + }).catch(function (error) { + if (isApolloError(error)) { + throw error; + } + else { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); + _this.invalidate(queryId); + _this.invalidate(fetchMoreForQueryId); + _this.broadcastQueries(); + } + throw new ApolloError({ networkError: error }); + } + }); + if (fetchPolicy !== 'cache-and-network') { + return [2, networkResult]; + } + networkResult.catch(function () { }); + } + this.queryStore.markQueryResultClient(queryId, !shouldFetch); + this.invalidate(queryId); + this.invalidate(fetchMoreForQueryId); + if (this.transform(query).hasForcedResolvers) { + return [2, this.localState.runResolvers({ + document: query, + remoteResult: { data: storeResult }, + context: context, + variables: variables, + onlyRunForcedResolvers: true, + }).then(function (result) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + _this.broadcastQueries(); + return result; + })]; + } + this.broadcastQueries(); + return [2, { data: storeResult }]; + } + }); + }); + }; + QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { + var fetchPolicy = _a.fetchPolicy, variables = _a.variables, errorPolicy = _a.errorPolicy; + if (fetchPolicy === 'no-cache') { + this.setQuery(queryId, function () { return ({ + newData: { result: result.data, complete: true }, + }); }); + } + else { + this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); + } + }; + QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { + var _this = this; + function invoke(method, argument) { + if (observer[method]) { + try { + observer[method](argument); + } + catch (e) { + process.env.NODE_ENV === "production" || invariant.error(e); + } + } + else if (method === 'error') { + process.env.NODE_ENV === "production" || invariant.error(argument); + } + } + return function (queryStoreValue, newData) { + _this.invalidate(queryId, false); + if (!queryStoreValue) + return; + var _a = _this.getQuery(queryId), observableQuery = _a.observableQuery, document = _a.document; + var fetchPolicy = observableQuery + ? observableQuery.options.fetchPolicy + : options.fetchPolicy; + if (fetchPolicy === 'standby') + return; + var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); + var lastResult = observableQuery && observableQuery.getLastResult(); + var networkStatusChanged = !!(lastResult && + lastResult.networkStatus !== queryStoreValue.networkStatus); + var shouldNotifyIfLoading = options.returnPartialData || + (!newData && queryStoreValue.previousVariables) || + (networkStatusChanged && options.notifyOnNetworkStatusChange) || + fetchPolicy === 'cache-only' || + fetchPolicy === 'cache-and-network'; + if (loading && !shouldNotifyIfLoading) { + return; + } + var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); + var errorPolicy = observableQuery + && observableQuery.options.errorPolicy + || options.errorPolicy + || 'none'; + if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { + return invoke('error', new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError, + })); + } + try { + var data = void 0; + var isMissing = void 0; + if (newData) { + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { + _this.setQuery(queryId, function () { return ({ newData: null }); }); + } + data = newData.result; + isMissing = !newData.complete; + } + else { + var lastError = observableQuery && observableQuery.getLastError(); + var errorStatusChanged = errorPolicy !== 'none' && + (lastError && lastError.graphQLErrors) !== + queryStoreValue.graphQLErrors; + if (lastResult && lastResult.data && !errorStatusChanged) { + data = lastResult.data; + isMissing = false; + } + else { + var diffResult = _this.dataStore.getCache().diff({ + query: document, + variables: queryStoreValue.previousVariables || + queryStoreValue.variables, + returnPartialData: true, + optimistic: true, + }); + data = diffResult.result; + isMissing = !diffResult.complete; + } + } + var stale = isMissing && !(options.returnPartialData || + fetchPolicy === 'cache-only'); + var resultFromStore = { + data: stale ? lastResult && lastResult.data : data, + loading: loading, + networkStatus: queryStoreValue.networkStatus, + stale: stale, + }; + if (errorPolicy === 'all' && hasGraphQLErrors) { + resultFromStore.errors = queryStoreValue.graphQLErrors; + } + invoke('next', resultFromStore); + } + catch (networkError) { + invoke('error', new ApolloError({ networkError: networkError })); + } + }; + }; + QueryManager.prototype.transform = function (document) { + var transformCache = this.transformCache; + if (!transformCache.has(document)) { + var cache = this.dataStore.getCache(); + var transformed = cache.transformDocument(document); + var forLink = removeConnectionDirectiveFromDocument(cache.transformForLink(transformed)); + var clientQuery = this.localState.clientQuery(transformed); + var serverQuery = this.localState.serverQuery(forLink); + var cacheEntry_1 = { + document: transformed, + hasClientExports: hasClientExports(transformed), + hasForcedResolvers: this.localState.shouldForceResolvers(transformed), + clientQuery: clientQuery, + serverQuery: serverQuery, + defaultVars: getDefaultValues(getOperationDefinition(transformed)), + }; + var add = function (doc) { + if (doc && !transformCache.has(doc)) { + transformCache.set(doc, cacheEntry_1); + } + }; + add(document); + add(transformed); + add(clientQuery); + add(serverQuery); + } + return transformCache.get(document); + }; + QueryManager.prototype.getVariables = function (document, variables) { + return __assign({}, this.transform(document).defaultVars, variables); + }; + QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { + if (shouldSubscribe === void 0) { shouldSubscribe = true; } + process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 9) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); + options.variables = this.getVariables(options.query, options.variables); + if (typeof options.notifyOnNetworkStatusChange === 'undefined') { + options.notifyOnNetworkStatusChange = false; + } + var transformedOptions = __assign({}, options); + return new ObservableQuery({ + queryManager: this, + options: transformedOptions, + shouldSubscribe: shouldSubscribe, + }); + }; + QueryManager.prototype.query = function (options) { + var _this = this; + process.env.NODE_ENV === "production" ? invariant(options.query, 10) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' + + 'in the query option.'); + process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 11) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); + process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 12) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); + process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 13) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); + return new Promise(function (resolve, reject) { + var watchedQuery = _this.watchQuery(options, false); + _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); + watchedQuery + .result() + .then(resolve, reject) + .then(function () { + return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); + }); + }); + }; + QueryManager.prototype.generateQueryId = function () { + return String(this.idCounter++); + }; + QueryManager.prototype.stopQueryInStore = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.broadcastQueries(); + }; + QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { + this.stopPollingQuery(queryId); + this.queryStore.stopQuery(queryId); + this.invalidate(queryId); + }; + QueryManager.prototype.addQueryListener = function (queryId, listener) { + this.setQuery(queryId, function (_a) { + var listeners = _a.listeners; + listeners.add(listener); + return { invalidated: false }; + }); + }; + QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { + var _this = this; + var cancel = this.getQuery(queryId).cancel; + if (cancel) + cancel(); + var previousResult = function () { + var previousResult = null; + var observableQuery = _this.getQuery(queryId).observableQuery; + if (observableQuery) { + var lastResult = observableQuery.getLastResult(); + if (lastResult) { + previousResult = lastResult.data; + } + } + return previousResult; + }; + return this.dataStore.getCache().watch({ + query: document, + variables: options.variables, + optimistic: true, + previousResult: previousResult, + callback: function (newData) { + _this.setQuery(queryId, function () { return ({ invalidated: true, newData: newData }); }); + }, + }); + }; + QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { + this.setQuery(queryId, function () { return ({ observableQuery: observableQuery }); }); + }; + QueryManager.prototype.removeObservableQuery = function (queryId) { + var cancel = this.getQuery(queryId).cancel; + this.setQuery(queryId, function () { return ({ observableQuery: null }); }); + if (cancel) + cancel(); + }; + QueryManager.prototype.clearStore = function () { + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new InvariantError(14) : new InvariantError('Store reset while query was in flight (not completed in link chain)')); + }); + var resetIds = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) + resetIds.push(queryId); + }); + this.queryStore.reset(resetIds); + this.mutationStore.reset(); + return this.dataStore.reset(); + }; + QueryManager.prototype.resetStore = function () { + var _this = this; + return this.clearStore().then(function () { + return _this.reFetchObservableQueries(); + }); + }; + QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { + var _this = this; + if (includeStandby === void 0) { includeStandby = false; } + var observableQueryPromises = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) { + var fetchPolicy = observableQuery.options.fetchPolicy; + observableQuery.resetLastResults(); + if (fetchPolicy !== 'cache-only' && + (includeStandby || fetchPolicy !== 'standby')) { + observableQueryPromises.push(observableQuery.refetch()); + } + _this.setQuery(queryId, function () { return ({ newData: null }); }); + _this.invalidate(queryId); + } + }); + this.broadcastQueries(); + return Promise.all(observableQueryPromises); + }; + QueryManager.prototype.observeQuery = function (queryId, options, observer) { + this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); + return this.fetchQuery(queryId, options); + }; + QueryManager.prototype.startQuery = function (queryId, options, listener) { + process.env.NODE_ENV === "production" || invariant.warn("The QueryManager.startQuery method has been deprecated"); + this.addQueryListener(queryId, listener); + this.fetchQuery(queryId, options) + .catch(function () { return undefined; }); + return queryId; + }; + QueryManager.prototype.startGraphQLSubscription = function (_a) { + var _this = this; + var query = _a.query, fetchPolicy = _a.fetchPolicy, variables = _a.variables; + query = this.transform(query).document; + variables = this.getVariables(query, variables); + var makeObservable = function (variables) { + return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { + if (!fetchPolicy || fetchPolicy !== 'no-cache') { + _this.dataStore.markSubscriptionResult(result, query, variables); + _this.broadcastQueries(); + } + if (graphQLResultHasError(result)) { + throw new ApolloError({ + graphQLErrors: result.errors, + }); + } + return result; + }); + }; + if (this.transform(query).hasClientExports) { + var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); + return new Observable(function (observer) { + var sub = null; + observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error); + return function () { return sub && sub.unsubscribe(); }; + }); + } + return makeObservable(variables); + }; + QueryManager.prototype.stopQuery = function (queryId) { + this.stopQueryNoBroadcast(queryId); + this.broadcastQueries(); + }; + QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.removeQuery(queryId); + }; + QueryManager.prototype.removeQuery = function (queryId) { + this.fetchQueryRejectFns.delete("query:" + queryId); + this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); + this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); }); + this.queries.delete(queryId); + }; + QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { + if (optimistic === void 0) { optimistic = true; } + var _a = observableQuery.options, variables = _a.variables, query = _a.query, fetchPolicy = _a.fetchPolicy, returnPartialData = _a.returnPartialData; + var lastResult = observableQuery.getLastResult(); + var newData = this.getQuery(observableQuery.queryId).newData; + if (newData && newData.complete) { + return { data: newData.result, partial: false }; + } + if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { + return { data: undefined, partial: false }; + } + var _b = this.dataStore.getCache().diff({ + query: query, + variables: variables, + previousResult: lastResult ? lastResult.data : undefined, + returnPartialData: true, + optimistic: optimistic, + }), result = _b.result, complete = _b.complete; + return { + data: (complete || returnPartialData) ? result : void 0, + partial: !complete, + }; + }; + QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { + var observableQuery; + if (typeof queryIdOrObservable === 'string') { + var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; + process.env.NODE_ENV === "production" ? invariant(foundObserveableQuery, 15) : invariant(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); + observableQuery = foundObserveableQuery; + } + else { + observableQuery = queryIdOrObservable; + } + var _a = observableQuery.options, variables = _a.variables, query = _a.query; + return { + previousResult: this.getCurrentQueryResult(observableQuery, false).data, + variables: variables, + document: query, + }; + }; + QueryManager.prototype.broadcastQueries = function () { + var _this = this; + this.onBroadcast(); + this.queries.forEach(function (info, id) { + if (info.invalidated) { + info.listeners.forEach(function (listener) { + if (listener) { + listener(_this.queryStore.get(id), info.newData); + } + }); + } + }); + }; + QueryManager.prototype.getLocalState = function () { + return this.localState; + }; + QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { + var _this = this; + if (deduplication === void 0) { deduplication = this.queryDeduplication; } + var observable; + var serverQuery = this.transform(query).serverQuery; + if (serverQuery) { + var _a = this, inFlightLinkObservables_1 = _a.inFlightLinkObservables, link = _a.link; + var operation = { + query: serverQuery, + variables: variables, + operationName: getOperationName(serverQuery) || void 0, + context: this.prepareContext(__assign({}, context, { forceFetch: !deduplication })), + }; + context = operation.context; + if (deduplication) { + var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); + inFlightLinkObservables_1.set(serverQuery, byVariables_1); + var varJson_1 = JSON.stringify(variables); + observable = byVariables_1.get(varJson_1); + if (!observable) { + byVariables_1.set(varJson_1, observable = multiplex(execute(link, operation))); + var cleanup = function () { + byVariables_1.delete(varJson_1); + if (!byVariables_1.size) + inFlightLinkObservables_1.delete(serverQuery); + cleanupSub_1.unsubscribe(); + }; + var cleanupSub_1 = observable.subscribe({ + next: cleanup, + error: cleanup, + complete: cleanup, + }); + } + } + else { + observable = multiplex(execute(link, operation)); + } + } + else { + observable = Observable.of({ data: {} }); + context = this.prepareContext(context); + } + var clientQuery = this.transform(query).clientQuery; + if (clientQuery) { + observable = asyncMap(observable, function (result) { + return _this.localState.runResolvers({ + document: clientQuery, + remoteResult: result, + context: context, + variables: variables, + }); + }); + } + return observable; + }; + QueryManager.prototype.fetchRequest = function (_a) { + var _this = this; + var requestId = _a.requestId, queryId = _a.queryId, document = _a.document, options = _a.options, fetchMoreForQueryId = _a.fetchMoreForQueryId; + var variables = options.variables, _b = options.errorPolicy, errorPolicy = _b === void 0 ? 'none' : _b, fetchPolicy = options.fetchPolicy; + var resultFromStore; + var errorsFromStore; + return new Promise(function (resolve, reject) { + var observable = _this.getObservableFromLink(document, options.context, variables); + var fqrfId = "fetchRequest:" + queryId; + _this.fetchQueryRejectFns.set(fqrfId, reject); + var cleanup = function () { + _this.fetchQueryRejectFns.delete(fqrfId); + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.delete(subscription); + }); + }; + var subscription = observable.map(function (result) { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); + _this.invalidate(queryId); + _this.invalidate(fetchMoreForQueryId); + _this.broadcastQueries(); + } + if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { + return reject(new ApolloError({ + graphQLErrors: result.errors, + })); + } + if (errorPolicy === 'all') { + errorsFromStore = result.errors; + } + if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { + resultFromStore = result.data; + } + else { + var _a = _this.dataStore.getCache().diff({ + variables: variables, + query: document, + optimistic: false, + returnPartialData: true, + }), result_1 = _a.result, complete = _a.complete; + if (complete || options.returnPartialData) { + resultFromStore = result_1; + } + } + }).subscribe({ + error: function (error) { + cleanup(); + reject(error); + }, + complete: function () { + cleanup(); + resolve({ + data: resultFromStore, + errors: errorsFromStore, + loading: false, + networkStatus: NetworkStatus.ready, + stale: false, + }); + }, + }); + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.add(subscription); + }); + }); + }; + QueryManager.prototype.getQuery = function (queryId) { + return (this.queries.get(queryId) || { + listeners: new Set(), + invalidated: false, + document: null, + newData: null, + lastRequestId: 1, + observableQuery: null, + subscriptions: new Set(), + }); + }; + QueryManager.prototype.setQuery = function (queryId, updater) { + var prev = this.getQuery(queryId); + var newInfo = __assign({}, prev, updater(prev)); + this.queries.set(queryId, newInfo); + }; + QueryManager.prototype.invalidate = function (queryId, invalidated) { + if (invalidated === void 0) { invalidated = true; } + if (queryId) { + this.setQuery(queryId, function () { return ({ invalidated: invalidated }); }); + } + }; + QueryManager.prototype.prepareContext = function (context) { + if (context === void 0) { context = {}; } + var newContext = this.localState.prepareContext(context); + return __assign({}, newContext, { clientAwareness: this.clientAwareness }); + }; + QueryManager.prototype.checkInFlight = function (queryId) { + var query = this.queryStore.get(queryId); + return (query && + query.networkStatus !== NetworkStatus.ready && + query.networkStatus !== NetworkStatus.error); + }; + QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { + var _this = this; + var pollInterval = options.pollInterval; + process.env.NODE_ENV === "production" ? invariant(pollInterval, 16) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); + if (!this.ssrMode) { + var info = this.pollingInfoByQueryId.get(queryId); + if (!info) { + this.pollingInfoByQueryId.set(queryId, (info = {})); + } + info.interval = pollInterval; + info.options = __assign({}, options, { fetchPolicy: 'network-only' }); + var maybeFetch_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + if (info) { + if (_this.checkInFlight(queryId)) { + poll_1(); + } + else { + _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); + } + } + }; + var poll_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + if (info) { + clearTimeout(info.timeout); + info.timeout = setTimeout(maybeFetch_1, info.interval); + } + }; + if (listener) { + this.addQueryListener(queryId, listener); + } + poll_1(); + } + return queryId; + }; + QueryManager.prototype.stopPollingQuery = function (queryId) { + this.pollingInfoByQueryId.delete(queryId); + }; + return QueryManager; +}()); + +var DataStore = (function () { + function DataStore(initialCache) { + this.cache = initialCache; + } + DataStore.prototype.getCache = function () { + return this.cache; + }; + DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { + if (ignoreErrors === void 0) { ignoreErrors = false; } + var writeWithErrors = !graphQLResultHasError(result); + if (ignoreErrors && graphQLResultHasError(result) && result.data) { + writeWithErrors = true; + } + if (!fetchMoreForQueryId && writeWithErrors) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_QUERY', + query: document, + variables: variables, + }); + } + }; + DataStore.prototype.markSubscriptionResult = function (result, document, variables) { + if (!graphQLResultHasError(result)) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_SUBSCRIPTION', + query: document, + variables: variables, + }); + } + }; + DataStore.prototype.markMutationInit = function (mutation) { + var _this = this; + if (mutation.optimisticResponse) { + var optimistic_1; + if (typeof mutation.optimisticResponse === 'function') { + optimistic_1 = mutation.optimisticResponse(mutation.variables); + } + else { + optimistic_1 = mutation.optimisticResponse; + } + this.cache.recordOptimisticTransaction(function (c) { + var orig = _this.cache; + _this.cache = c; + try { + _this.markMutationResult({ + mutationId: mutation.mutationId, + result: { data: optimistic_1 }, + document: mutation.document, + variables: mutation.variables, + updateQueries: mutation.updateQueries, + update: mutation.update, + }); + } + finally { + _this.cache = orig; + } + }, mutation.mutationId); + } + }; + DataStore.prototype.markMutationResult = function (mutation) { + var _this = this; + if (!graphQLResultHasError(mutation.result)) { + var cacheWrites_1 = [{ + result: mutation.result.data, + dataId: 'ROOT_MUTATION', + query: mutation.document, + variables: mutation.variables, + }]; + var updateQueries_1 = mutation.updateQueries; + if (updateQueries_1) { + Object.keys(updateQueries_1).forEach(function (id) { + var _a = updateQueries_1[id], query = _a.query, updater = _a.updater; + var _b = _this.cache.diff({ + query: query.document, + variables: query.variables, + returnPartialData: true, + optimistic: false, + }), currentQueryResult = _b.result, complete = _b.complete; + if (complete) { + var nextQueryResult = tryFunctionOrLogError(function () { + return updater(currentQueryResult, { + mutationResult: mutation.result, + queryName: getOperationName(query.document) || undefined, + queryVariables: query.variables, + }); + }); + if (nextQueryResult) { + cacheWrites_1.push({ + result: nextQueryResult, + dataId: 'ROOT_QUERY', + query: query.document, + variables: query.variables, + }); + } + } + }); + } + this.cache.performTransaction(function (c) { + cacheWrites_1.forEach(function (write) { return c.write(write); }); + var update = mutation.update; + if (update) { + tryFunctionOrLogError(function () { return update(c, mutation.result); }); + } + }); + } + }; + DataStore.prototype.markMutationComplete = function (_a) { + var mutationId = _a.mutationId, optimisticResponse = _a.optimisticResponse; + if (optimisticResponse) { + this.cache.removeOptimistic(mutationId); + } + }; + DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { + this.cache.write({ + result: newResult, + dataId: 'ROOT_QUERY', + variables: variables, + query: document, + }); + }; + DataStore.prototype.reset = function () { + return this.cache.reset(); + }; + return DataStore; +}()); + +var version = "2.6.3"; + +var hasSuggestedDevtools = false; +var ApolloClient = (function () { + function ApolloClient(options) { + var _this = this; + this.defaultOptions = {}; + this.resetStoreCallbacks = []; + this.clearStoreCallbacks = []; + var cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, connectToDevTools = options.connectToDevTools, _c = options.queryDeduplication, queryDeduplication = _c === void 0 ? true : _c, defaultOptions = options.defaultOptions, _d = options.assumeImmutableResults, assumeImmutableResults = _d === void 0 ? false : _d, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version; + var link = options.link; + if (!link && resolvers) { + link = ApolloLink.empty(); + } + if (!link || !cache) { + throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); + } + this.link = link; + this.cache = cache; + this.store = new DataStore(cache); + this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; + this.queryDeduplication = queryDeduplication; + this.defaultOptions = defaultOptions || {}; + this.typeDefs = typeDefs; + if (ssrForceFetchDelay) { + setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay); + } + this.watchQuery = this.watchQuery.bind(this); + this.query = this.query.bind(this); + this.mutate = this.mutate.bind(this); + this.resetStore = this.resetStore.bind(this); + this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); + var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && + typeof window !== 'undefined' && + !window.__APOLLO_CLIENT__; + if (typeof connectToDevTools === 'undefined' + ? defaultConnectToDevTools + : connectToDevTools && typeof window !== 'undefined') { + window.__APOLLO_CLIENT__ = this; + } + if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { + hasSuggestedDevtools = true; + if (typeof window !== 'undefined' && + window.document && + window.top === window.self) { + if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + if (window.navigator && + window.navigator.userAgent && + window.navigator.userAgent.indexOf('Chrome') > -1) { + console.debug('Download the Apollo DevTools ' + + 'for a better development experience: ' + + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); + } + } + } + } + this.version = version; + this.localState = new LocalState({ + cache: cache, + client: this, + resolvers: resolvers, + fragmentMatcher: fragmentMatcher, + }); + this.queryManager = new QueryManager({ + link: this.link, + store: this.store, + queryDeduplication: queryDeduplication, + ssrMode: ssrMode, + clientAwareness: { + name: clientAwarenessName, + version: clientAwarenessVersion, + }, + localState: this.localState, + assumeImmutableResults: assumeImmutableResults, + onBroadcast: function () { + if (_this.devToolsHookCb) { + _this.devToolsHookCb({ + action: {}, + state: { + queries: _this.queryManager.queryStore.getStore(), + mutations: _this.queryManager.mutationStore.getStore(), + }, + dataWithOptimisticResults: _this.cache.extract(true), + }); + } + }, + }); + } + ApolloClient.prototype.stop = function () { + this.queryManager.stop(); + }; + ApolloClient.prototype.watchQuery = function (options) { + if (this.defaultOptions.watchQuery) { + options = __assign({}, this.defaultOptions.watchQuery, options); + } + if (this.disableNetworkFetches && + (options.fetchPolicy === 'network-only' || + options.fetchPolicy === 'cache-and-network')) { + options = __assign({}, options, { fetchPolicy: 'cache-first' }); + } + return this.queryManager.watchQuery(options); + }; + ApolloClient.prototype.query = function (options) { + if (this.defaultOptions.query) { + options = __assign({}, this.defaultOptions.query, options); + } + process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'cache-and-network', 2) : invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + + 'client.query can only return a single result. Please use client.watchQuery ' + + 'to receive multiple results from the cache and the network, or consider ' + + 'using a different fetchPolicy, such as cache-first or network-only.'); + if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { + options = __assign({}, options, { fetchPolicy: 'cache-first' }); + } + return this.queryManager.query(options); + }; + ApolloClient.prototype.mutate = function (options) { + if (this.defaultOptions.mutate) { + options = __assign({}, this.defaultOptions.mutate, options); + } + return this.queryManager.mutate(options); + }; + ApolloClient.prototype.subscribe = function (options) { + return this.queryManager.startGraphQLSubscription(options); + }; + ApolloClient.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.cache.readQuery(options, optimistic); + }; + ApolloClient.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { optimistic = false; } + return this.cache.readFragment(options, optimistic); + }; + ApolloClient.prototype.writeQuery = function (options) { + var result = this.cache.writeQuery(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.writeFragment = function (options) { + var result = this.cache.writeFragment(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.writeData = function (options) { + var result = this.cache.writeData(options); + this.queryManager.broadcastQueries(); + return result; + }; + ApolloClient.prototype.__actionHookForDevTools = function (cb) { + this.devToolsHookCb = cb; + }; + ApolloClient.prototype.__requestRaw = function (payload) { + return execute(this.link, payload); + }; + ApolloClient.prototype.initQueryManager = function () { + process.env.NODE_ENV === "production" || invariant.warn('Calling the initQueryManager method is no longer necessary, ' + + 'and it will be removed from ApolloClient in version 3.0.'); + return this.queryManager; + }; + ApolloClient.prototype.resetStore = function () { + var _this = this; + return Promise.resolve() + .then(function () { return _this.queryManager.clearStore(); }) + .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); }) + .then(function () { return _this.reFetchObservableQueries(); }); + }; + ApolloClient.prototype.clearStore = function () { + var _this = this; + return Promise.resolve() + .then(function () { return _this.queryManager.clearStore(); }) + .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); }); + }; + ApolloClient.prototype.onResetStore = function (cb) { + var _this = this; + this.resetStoreCallbacks.push(cb); + return function () { + _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; }); + }; + }; + ApolloClient.prototype.onClearStore = function (cb) { + var _this = this; + this.clearStoreCallbacks.push(cb); + return function () { + _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; }); + }; + }; + ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { + return this.queryManager.reFetchObservableQueries(includeStandby); + }; + ApolloClient.prototype.extract = function (optimistic) { + return this.cache.extract(optimistic); + }; + ApolloClient.prototype.restore = function (serializedState) { + return this.cache.restore(serializedState); + }; + ApolloClient.prototype.addResolvers = function (resolvers) { + this.localState.addResolvers(resolvers); + }; + ApolloClient.prototype.setResolvers = function (resolvers) { + this.localState.setResolvers(resolvers); + }; + ApolloClient.prototype.getResolvers = function () { + return this.localState.getResolvers(); + }; + ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { + this.localState.setFragmentMatcher(fragmentMatcher); + }; + return ApolloClient; +}()); + +export default ApolloClient; +export { ApolloClient, ApolloError, FetchType, NetworkStatus, ObservableQuery, isApolloError }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-client/bundle.esm.js.map b/node_modules/apollo-client/bundle.esm.js.map new file mode 100644 index 000000000..421bbb371 --- /dev/null +++ b/node_modules/apollo-client/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [field: string]: (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: any,\n ) => any;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n ExecutionResult,\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n fieldName: string,\n rootValue: any,\n args: any,\n context: any,\n info: {\n field: FieldNode;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: ExecutionResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"fetchPolicy for mutations currently only supports the 'no-cache' policy\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: ExecutionResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result as FetchResult;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult as ExecutionResult);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: ExecutionResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: ExecutionResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.3\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"],"names":["tslib_1.__extends","LinkObservable","tslib_1.__assign"],"mappings":";;;;;;;IAGY,aA0CX;AA1CD,WAAY,aAAa;IAMvB,uDAAW,CAAA;IAMX,iEAAgB,CAAA;IAMhB,2DAAa,CAAA;IAMb,uDAAW,CAAA;IAOX,iDAAQ,CAAA;IAKR,mDAAS,CAAA;IAKT,mDAAS,CAAA;CACV,EA1CW,aAAa,KAAb,aAAa,QA0CxB;AAMD,SAAgB,wBAAwB,CACtC,aAA4B;IAE5B,OAAO,aAAa,GAAG,CAAC,CAAC;CAC1B;;AC7CD;IAAmCA,8BAAiB;IAApD;;KAQC;IAPQ,qBAAC,YAAY,CAAC,GAArB;QACE,OAAO,IAAI,CAAC;KACb;IAEM,qBAAC,cAAqB,CAAC,GAA9B;QACE,OAAO,IAAI,CAAC;KACb;IACH,iBAAC;CARD,CAAmCC,YAAc,GAQhD;;SClBe,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;CACjD;;SCCe,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;CAC5C;AAMD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K,EAAE,GAAA,CAAC,CAAC;SAC3E,CAAC;KACH;IAOM,mCAAY,GAAnB,UAAoB,EAAsB;QAA1C,iBAKC;QAJC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClC,OAAO;YACL,KAAI,CAAC,mBAAmB,GAAG,KAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,KAAK,EAAE,GAAA,CAAC,CAAC;SAC3E,CAAC;KACH;IAcM,+CAAwB,GAA/B,UACE,cAAwB;QAExB,OAAO,IAAI,CAAC,YAAY,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;KACnE;IAKM,8BAAO,GAAd,UAAe,UAAoB;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACvC;IASM,8BAAO,GAAd,UAAe,eAA4B;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;KAC5C;IAKM,mCAAY,GAAnB,UAAoB,SAAkC;QACpD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;KACzC;IAKM,mCAAY,GAAnB,UAAoB,SAAkC;QACpD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;KACzC;IAKM,mCAAY,GAAnB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;KACvC;IAKM,mDAA4B,GAAnC,UAAoC,eAAgC;QAClE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;KACrD;IACH,mBAAC;CAAA,IAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-client/bundle.umd.js b/node_modules/apollo-client/bundle.umd.js new file mode 100644 index 000000000..66792320e --- /dev/null +++ b/node_modules/apollo-client/bundle.umd.js @@ -0,0 +1,2726 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "tslib", "apollo-utilities", "apollo-link", "symbol-observable", "ts-invariant", "graphql/language/visitor"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("tslib"), require("apollo-utilities"), require("apollo-link"), require("symbol-observable"), require("ts-invariant"), require("graphql/language/visitor")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.tslib, global.apolloUtilities, global.apolloLink, global.symbolObservable, global.tsInvariant, global.visitor); + global.unknown = mod.exports; + } +})(this, function (_exports, _tslib, _apolloUtilities, _apolloLink, _symbolObservable, _tsInvariant, _visitor) { + + _exports.__esModule = true; + _exports.isApolloError = isApolloError; + _exports.ObservableQuery = _exports.NetworkStatus = _exports.FetchType = _exports.ApolloError = _exports.ApolloClient = _exports.default = void 0; + _symbolObservable = _interopRequireDefault(_symbolObservable); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var NetworkStatus; + _exports.NetworkStatus = NetworkStatus; + + (function (NetworkStatus) { + NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; + NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; + NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; + NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; + NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; + NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; + NetworkStatus[NetworkStatus["error"] = 8] = "error"; + })(NetworkStatus || (_exports.NetworkStatus = NetworkStatus = {})); + + function isNetworkRequestInFlight(networkStatus) { + return networkStatus < 7; + } + + var Observable = function (_super) { + (0, _tslib.__extends)(Observable, _super); + + function Observable() { + return _super !== null && _super.apply(this, arguments) || this; + } + + Observable.prototype[_symbolObservable.default] = function () { + return this; + }; + + Observable.prototype['@@observable'] = function () { + return this; + }; + + return Observable; + }(_apolloLink.Observable); + + function isNonEmptyArray(value) { + return Array.isArray(value) && value.length > 0; + } + + function isApolloError(err) { + return err.hasOwnProperty('graphQLErrors'); + } + + var generateErrorMessage = function (err) { + var message = ''; + + if (isNonEmptyArray(err.graphQLErrors)) { + err.graphQLErrors.forEach(function (graphQLError) { + var errorMessage = graphQLError ? graphQLError.message : 'Error message not found.'; + message += "GraphQL error: " + errorMessage + "\n"; + }); + } + + if (err.networkError) { + message += 'Network error: ' + err.networkError.message + '\n'; + } + + message = message.replace(/\n$/, ''); + return message; + }; + + var ApolloError = function (_super) { + (0, _tslib.__extends)(ApolloError, _super); + + function ApolloError(_a) { + var graphQLErrors = _a.graphQLErrors, + networkError = _a.networkError, + errorMessage = _a.errorMessage, + extraInfo = _a.extraInfo; + + var _this = _super.call(this, errorMessage) || this; + + _this.graphQLErrors = graphQLErrors || []; + _this.networkError = networkError || null; + + if (!errorMessage) { + _this.message = generateErrorMessage(_this); + } else { + _this.message = errorMessage; + } + + _this.extraInfo = extraInfo; + _this.__proto__ = ApolloError.prototype; + return _this; + } + + return ApolloError; + }(Error); + + _exports.ApolloError = ApolloError; + var FetchType; + _exports.FetchType = FetchType; + + (function (FetchType) { + FetchType[FetchType["normal"] = 1] = "normal"; + FetchType[FetchType["refetch"] = 2] = "refetch"; + FetchType[FetchType["poll"] = 3] = "poll"; + })(FetchType || (_exports.FetchType = FetchType = {})); + + var hasError = function (storeValue, policy) { + if (policy === void 0) { + policy = 'none'; + } + + return storeValue && (storeValue.networkError || policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors)); + }; + + var ObservableQuery = function (_super) { + (0, _tslib.__extends)(ObservableQuery, _super); + + function ObservableQuery(_a) { + var queryManager = _a.queryManager, + options = _a.options, + _b = _a.shouldSubscribe, + shouldSubscribe = _b === void 0 ? true : _b; + + var _this = _super.call(this, function (observer) { + return _this.onSubscribe(observer); + }) || this; + + _this.observers = new Set(); + _this.subscriptions = new Set(); + _this.isTornDown = false; + _this.options = options; + _this.variables = options.variables || {}; + _this.queryId = queryManager.generateQueryId(); + _this.shouldSubscribe = shouldSubscribe; + var opDef = (0, _apolloUtilities.getOperationDefinition)(options.query); + _this.queryName = opDef && opDef.name && opDef.name.value; + _this.queryManager = queryManager; + return _this; + } + + ObservableQuery.prototype.result = function () { + var _this = this; + + return new Promise(function (resolve, reject) { + var observer = { + next: function (result) { + resolve(result); + + _this.observers.delete(observer); + + if (!_this.observers.size) { + _this.queryManager.removeQuery(_this.queryId); + } + + setTimeout(function () { + subscription.unsubscribe(); + }, 0); + }, + error: reject + }; + + var subscription = _this.subscribe(observer); + }); + }; + + ObservableQuery.prototype.currentResult = function () { + var result = this.getCurrentResult(); + + if (result.data === undefined) { + result.data = {}; + } + + return result; + }; + + ObservableQuery.prototype.getCurrentResult = function () { + if (this.isTornDown) { + var lastResult = this.lastResult; + return { + data: !this.lastError && lastResult && lastResult.data || void 0, + error: this.lastError, + loading: false, + networkStatus: NetworkStatus.error + }; + } + + var _a = this.queryManager.getCurrentQueryResult(this), + data = _a.data, + partial = _a.partial; + + var queryStoreValue = this.queryManager.queryStore.get(this.queryId); + var result; + var fetchPolicy = this.options.fetchPolicy; + var isNetworkFetchPolicy = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + + if (queryStoreValue) { + var networkStatus = queryStoreValue.networkStatus; + + if (hasError(queryStoreValue, this.options.errorPolicy)) { + return { + data: void 0, + loading: false, + networkStatus: networkStatus, + error: new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError + }) + }; + } + + if (queryStoreValue.variables) { + this.options.variables = (0, _tslib.__assign)({}, this.options.variables, queryStoreValue.variables); + this.variables = this.options.variables; + } + + result = { + data: data, + loading: isNetworkRequestInFlight(networkStatus), + networkStatus: networkStatus + }; + + if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { + result.errors = queryStoreValue.graphQLErrors; + } + } else { + var loading = isNetworkFetchPolicy || partial && fetchPolicy !== 'cache-only'; + result = { + data: data, + loading: loading, + networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready + }; + } + + if (!partial) { + this.updateLastResult((0, _tslib.__assign)({}, result, { + stale: false + })); + } + + return (0, _tslib.__assign)({}, result, { + partial: partial + }); + }; + + ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { + var snapshot = this.lastResultSnapshot; + return !(snapshot && newResult && snapshot.networkStatus === newResult.networkStatus && snapshot.stale === newResult.stale && (0, _apolloUtilities.isEqual)(snapshot.data, newResult.data)); + }; + + ObservableQuery.prototype.getLastResult = function () { + return this.lastResult; + }; + + ObservableQuery.prototype.getLastError = function () { + return this.lastError; + }; + + ObservableQuery.prototype.resetLastResults = function () { + delete this.lastResult; + delete this.lastResultSnapshot; + delete this.lastError; + this.isTornDown = false; + }; + + ObservableQuery.prototype.resetQueryStoreErrors = function () { + var queryStore = this.queryManager.queryStore.get(this.queryId); + + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + }; + + ObservableQuery.prototype.refetch = function (variables) { + var fetchPolicy = this.options.fetchPolicy; + + if (fetchPolicy === 'cache-only') { + return Promise.reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); + } + + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'cache-and-network') { + fetchPolicy = 'network-only'; + } + + if (!(0, _apolloUtilities.isEqual)(this.variables, variables)) { + this.variables = (0, _tslib.__assign)({}, this.variables, variables); + } + + if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { + this.options.variables = (0, _tslib.__assign)({}, this.options.variables, this.variables); + } + + return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)({}, this.options, { + fetchPolicy: fetchPolicy + }), FetchType.refetch); + }; + + ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { + var _this = this; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 4) : (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); + var combinedOptions = (0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)({}, this.options, fetchMoreOptions, { + variables: (0, _tslib.__assign)({}, this.variables, fetchMoreOptions.variables) + }), { + fetchPolicy: 'network-only' + }); + var qid = this.queryManager.generateQueryId(); + return this.queryManager.fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId).then(function (fetchMoreResult) { + _this.updateQuery(function (previousResult) { + return fetchMoreOptions.updateQuery(previousResult, { + fetchMoreResult: fetchMoreResult.data, + variables: combinedOptions.variables + }); + }); + + _this.queryManager.stopQuery(qid); + + return fetchMoreResult; + }, function (error) { + _this.queryManager.stopQuery(qid); + + throw error; + }); + }; + + ObservableQuery.prototype.subscribeToMore = function (options) { + var _this = this; + + var subscription = this.queryManager.startGraphQLSubscription({ + query: options.document, + variables: options.variables + }).subscribe({ + next: function (subscriptionData) { + var updateQuery = options.updateQuery; + + if (updateQuery) { + _this.updateQuery(function (previous, _a) { + var variables = _a.variables; + return updateQuery(previous, { + subscriptionData: subscriptionData, + variables: variables + }); + }); + } + }, + error: function (err) { + if (options.onError) { + options.onError(err); + return; + } + + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled GraphQL subscription error', err); + } + }); + this.subscriptions.add(subscription); + return function () { + if (_this.subscriptions.delete(subscription)) { + subscription.unsubscribe(); + } + }; + }; + + ObservableQuery.prototype.setOptions = function (opts) { + var oldFetchPolicy = this.options.fetchPolicy; + this.options = (0, _tslib.__assign)({}, this.options, opts); + + if (opts.pollInterval) { + this.startPolling(opts.pollInterval); + } else if (opts.pollInterval === 0) { + this.stopPolling(); + } + + var fetchPolicy = opts.fetchPolicy; + return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || oldFetchPolicy === 'standby' || fetchPolicy === 'network-only'), opts.fetchResults); + }; + + ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { + if (tryFetch === void 0) { + tryFetch = false; + } + + if (fetchResults === void 0) { + fetchResults = true; + } + + this.isTornDown = false; + variables = variables || this.variables; + + if (!tryFetch && (0, _apolloUtilities.isEqual)(variables, this.variables)) { + return this.observers.size && fetchResults ? this.result() : Promise.resolve(); + } + + this.variables = this.options.variables = variables; + + if (!this.observers.size) { + return Promise.resolve(); + } + + return this.queryManager.fetchQuery(this.queryId, this.options); + }; + + ObservableQuery.prototype.updateQuery = function (mapFn) { + var queryManager = this.queryManager; + + var _a = queryManager.getQueryWithPreviousResult(this.queryId), + previousResult = _a.previousResult, + variables = _a.variables, + document = _a.document; + + var newResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return mapFn(previousResult, { + variables: variables + }); + }); + + if (newResult) { + queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); + queryManager.broadcastQueries(); + } + }; + + ObservableQuery.prototype.stopPolling = function () { + this.queryManager.stopPollingQuery(this.queryId); + this.options.pollInterval = undefined; + }; + + ObservableQuery.prototype.startPolling = function (pollInterval) { + assertNotCacheFirstOrOnly(this); + this.options.pollInterval = pollInterval; + this.queryManager.startPollingQuery(this.options, this.queryId); + }; + + ObservableQuery.prototype.updateLastResult = function (newResult) { + var previousResult = this.lastResult; + this.lastResult = newResult; + this.lastResultSnapshot = this.queryManager.assumeImmutableResults ? newResult : (0, _apolloUtilities.cloneDeep)(newResult); + return previousResult; + }; + + ObservableQuery.prototype.onSubscribe = function (observer) { + var _this = this; + + try { + var subObserver = observer._subscription._observer; + + if (subObserver && !subObserver.error) { + subObserver.error = defaultSubscriptionObserverErrorCallback; + } + } catch (_a) {} + + var first = !this.observers.size; + this.observers.add(observer); + if (observer.next && this.lastResult) observer.next(this.lastResult); + if (observer.error && this.lastError) observer.error(this.lastError); + + if (first) { + this.setUpQuery(); + } + + return function () { + if (_this.observers.delete(observer) && !_this.observers.size) { + _this.tearDownQuery(); + } + }; + }; + + ObservableQuery.prototype.setUpQuery = function () { + var _this = this; + + var _a = this, + queryManager = _a.queryManager, + queryId = _a.queryId; + + if (this.shouldSubscribe) { + queryManager.addObservableQuery(queryId, this); + } + + if (this.options.pollInterval) { + assertNotCacheFirstOrOnly(this); + queryManager.startPollingQuery(this.options, queryId); + } + + var onError = function (error) { + iterateObserversSafely(_this.observers, 'error', _this.lastError = error); + }; + + queryManager.observeQuery(queryId, this.options, { + next: function (result) { + if (_this.lastError || _this.isDifferentFromLastResult(result)) { + var previousResult_1 = _this.updateLastResult(result); + + var _a = _this.options, + query_1 = _a.query, + variables = _a.variables, + fetchPolicy_1 = _a.fetchPolicy; + + if (queryManager.transform(query_1).hasClientExports) { + queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { + var previousVariables = _this.variables; + _this.variables = _this.options.variables = variables; + + if (!result.loading && previousResult_1 && fetchPolicy_1 !== 'cache-only' && queryManager.transform(query_1).serverQuery && !(0, _apolloUtilities.isEqual)(previousVariables, variables)) { + _this.refetch(); + } else { + iterateObserversSafely(_this.observers, 'next', result); + } + }); + } else { + iterateObserversSafely(_this.observers, 'next', result); + } + } + }, + error: onError + }).catch(onError); + }; + + ObservableQuery.prototype.tearDownQuery = function () { + var queryManager = this.queryManager; + this.isTornDown = true; + queryManager.stopPollingQuery(this.queryId); + this.subscriptions.forEach(function (sub) { + return sub.unsubscribe(); + }); + this.subscriptions.clear(); + queryManager.removeObservableQuery(this.queryId); + queryManager.stopQuery(this.queryId); + this.observers.clear(); + }; + + return ObservableQuery; + }(Observable); + + _exports.ObservableQuery = ObservableQuery; + + function defaultSubscriptionObserverErrorCallback(error) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled error', error.message, error.stack); + } + + function iterateObserversSafely(observers, method, argument) { + var observersWithMethod = []; + observers.forEach(function (obs) { + return obs[method] && observersWithMethod.push(obs); + }); + observersWithMethod.forEach(function (obs) { + return obs[method](argument); + }); + } + + function assertNotCacheFirstOrOnly(obsQuery) { + var fetchPolicy = obsQuery.options.fetchPolicy; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 5) : (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); + } + + var MutationStore = function () { + function MutationStore() { + this.store = {}; + } + + MutationStore.prototype.getStore = function () { + return this.store; + }; + + MutationStore.prototype.get = function (mutationId) { + return this.store[mutationId]; + }; + + MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { + this.store[mutationId] = { + mutation: mutation, + variables: variables || {}, + loading: true, + error: null + }; + }; + + MutationStore.prototype.markMutationError = function (mutationId, error) { + var mutation = this.store[mutationId]; + + if (mutation) { + mutation.loading = false; + mutation.error = error; + } + }; + + MutationStore.prototype.markMutationResult = function (mutationId) { + var mutation = this.store[mutationId]; + + if (mutation) { + mutation.loading = false; + mutation.error = null; + } + }; + + MutationStore.prototype.reset = function () { + this.store = {}; + }; + + return MutationStore; + }(); + + var QueryStore = function () { + function QueryStore() { + this.store = {}; + } + + QueryStore.prototype.getStore = function () { + return this.store; + }; + + QueryStore.prototype.get = function (queryId) { + return this.store[queryId]; + }; + + QueryStore.prototype.initQuery = function (query) { + var previousQuery = this.store[query.queryId]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 19) : (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); + var isSetVariables = false; + var previousVariables = null; + + if (query.storePreviousVariables && previousQuery && previousQuery.networkStatus !== NetworkStatus.loading) { + if (!(0, _apolloUtilities.isEqual)(previousQuery.variables, query.variables)) { + isSetVariables = true; + previousVariables = previousQuery.variables; + } + } + + var networkStatus; + + if (isSetVariables) { + networkStatus = NetworkStatus.setVariables; + } else if (query.isPoll) { + networkStatus = NetworkStatus.poll; + } else if (query.isRefetch) { + networkStatus = NetworkStatus.refetch; + } else { + networkStatus = NetworkStatus.loading; + } + + var graphQLErrors = []; + + if (previousQuery && previousQuery.graphQLErrors) { + graphQLErrors = previousQuery.graphQLErrors; + } + + this.store[query.queryId] = { + document: query.document, + variables: query.variables, + previousVariables: previousVariables, + networkError: null, + graphQLErrors: graphQLErrors, + networkStatus: networkStatus, + metadata: query.metadata + }; + + if (typeof query.fetchMoreForQueryId === 'string' && this.store[query.fetchMoreForQueryId]) { + this.store[query.fetchMoreForQueryId].networkStatus = NetworkStatus.fetchMore; + } + }; + + QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) return; + this.store[queryId].networkError = null; + this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; + this.store[queryId].previousVariables = null; + this.store[queryId].networkStatus = NetworkStatus.ready; + + if (typeof fetchMoreForQueryId === 'string' && this.store[fetchMoreForQueryId]) { + this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; + } + }; + + QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) return; + this.store[queryId].networkError = error; + this.store[queryId].networkStatus = NetworkStatus.error; + + if (typeof fetchMoreForQueryId === 'string') { + this.markQueryResultClient(fetchMoreForQueryId, true); + } + }; + + QueryStore.prototype.markQueryResultClient = function (queryId, complete) { + var storeValue = this.store && this.store[queryId]; + + if (storeValue) { + storeValue.networkError = null; + storeValue.previousVariables = null; + + if (complete) { + storeValue.networkStatus = NetworkStatus.ready; + } + } + }; + + QueryStore.prototype.stopQuery = function (queryId) { + delete this.store[queryId]; + }; + + QueryStore.prototype.reset = function (observableQueryIds) { + var _this = this; + + Object.keys(this.store).forEach(function (queryId) { + if (observableQueryIds.indexOf(queryId) < 0) { + _this.stopQuery(queryId); + } else { + _this.store[queryId].networkStatus = NetworkStatus.loading; + } + }); + }; + + return QueryStore; + }(); + + function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + + var LocalState = function () { + function LocalState(_a) { + var cache = _a.cache, + client = _a.client, + resolvers = _a.resolvers, + fragmentMatcher = _a.fragmentMatcher; + this.cache = cache; + + if (client) { + this.client = client; + } + + if (resolvers) { + this.addResolvers(resolvers); + } + + if (fragmentMatcher) { + this.setFragmentMatcher(fragmentMatcher); + } + } + + LocalState.prototype.addResolvers = function (resolvers) { + var _this = this; + + this.resolvers = this.resolvers || {}; + + if (Array.isArray(resolvers)) { + resolvers.forEach(function (resolverGroup) { + _this.resolvers = (0, _apolloUtilities.mergeDeep)(_this.resolvers, resolverGroup); + }); + } else { + this.resolvers = (0, _apolloUtilities.mergeDeep)(this.resolvers, resolvers); + } + }; + + LocalState.prototype.setResolvers = function (resolvers) { + this.resolvers = {}; + this.addResolvers(resolvers); + }; + + LocalState.prototype.getResolvers = function () { + return this.resolvers || {}; + }; + + LocalState.prototype.runResolvers = function (_a) { + var document = _a.document, + remoteResult = _a.remoteResult, + context = _a.context, + variables = _a.variables, + _b = _a.onlyRunForcedResolvers, + onlyRunForcedResolvers = _b === void 0 ? false : _b; + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + return (0, _tslib.__generator)(this, function (_c) { + if (document) { + return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { + return (0, _tslib.__assign)({}, remoteResult, { + data: localResult.result + }); + })]; + } + + return [2, remoteResult]; + }); + }); + }; + + LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { + this.fragmentMatcher = fragmentMatcher; + }; + + LocalState.prototype.getFragmentMatcher = function () { + return this.fragmentMatcher; + }; + + LocalState.prototype.clientQuery = function (document) { + if ((0, _apolloUtilities.hasDirectives)(['client'], document)) { + if (this.resolvers) { + return document; + } + + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + 'were specified. This means ApolloClient local resolver handling ' + 'has been disabled, and @client directives will be passed through ' + 'to your link chain.'); + } + + return null; + }; + + LocalState.prototype.serverQuery = function (document) { + return this.resolvers ? (0, _apolloUtilities.removeClientSetsFromDocument)(document) : document; + }; + + LocalState.prototype.prepareContext = function (context) { + if (context === void 0) { + context = {}; + } + + var cache = this.cache; + var newContext = (0, _tslib.__assign)({}, context, { + cache: cache, + getCacheKey: function (obj) { + if (cache.config) { + return cache.config.dataIdFromObject(obj); + } else { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(false, 17) : (0, _tsInvariant.invariant)(false, 'To use context.getCacheKey, you need to use a cache that has ' + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); + } + } + }); + return newContext; + }; + + LocalState.prototype.addExportedVariables = function (document, variables, context) { + if (variables === void 0) { + variables = {}; + } + + if (context === void 0) { + context = {}; + } + + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + return (0, _tslib.__generator)(this, function (_a) { + if (document) { + return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { + return (0, _tslib.__assign)({}, variables, data.exportedVariables); + })]; + } + + return [2, (0, _tslib.__assign)({}, variables)]; + }); + }); + }; + + LocalState.prototype.shouldForceResolvers = function (document) { + var forceResolvers = false; + (0, _visitor.visit)(document, { + Directive: { + enter: function (node) { + if (node.name.value === 'client' && node.arguments) { + forceResolvers = node.arguments.some(function (arg) { + return arg.name.value === 'always' && arg.value.kind === 'BooleanValue' && arg.value.value === true; + }); + + if (forceResolvers) { + return _visitor.BREAK; + } + } + } + } + }); + return forceResolvers; + }; + + LocalState.prototype.buildRootValueFromCache = function (document, variables) { + return this.cache.diff({ + query: (0, _apolloUtilities.buildQueryFromSelectionSet)(document), + variables: variables, + returnPartialData: true, + optimistic: false + }).result; + }; + + LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { + if (context === void 0) { + context = {}; + } + + if (variables === void 0) { + variables = {}; + } + + if (fragmentMatcher === void 0) { + fragmentMatcher = function () { + return true; + }; + } + + if (onlyRunForcedResolvers === void 0) { + onlyRunForcedResolvers = false; + } + + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; + + return (0, _tslib.__generator)(this, function (_b) { + mainDefinition = (0, _apolloUtilities.getMainDefinition)(document); + fragments = (0, _apolloUtilities.getFragmentDefinitions)(document); + fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); + definitionOperation = mainDefinition.operation; + defaultOperationType = definitionOperation ? capitalizeFirstLetter(definitionOperation) : 'Query'; + _a = this, cache = _a.cache, client = _a.client; + execContext = { + fragmentMap: fragmentMap, + context: (0, _tslib.__assign)({}, context, { + cache: cache, + client: client + }), + variables: variables, + fragmentMatcher: fragmentMatcher, + defaultOperationType: defaultOperationType, + exportedVariables: {}, + onlyRunForcedResolvers: onlyRunForcedResolvers + }; + return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { + return { + result: result, + exportedVariables: execContext.exportedVariables + }; + })]; + }); + }); + }; + + LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var fragmentMap, context, variables, resultsToMerge, execute; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_a) { + fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; + resultsToMerge = [rootValue]; + + execute = function (selection) { + return (0, _tslib.__awaiter)(_this, void 0, void 0, function () { + var fragment, typeCondition; + return (0, _tslib.__generator)(this, function (_a) { + if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { + return [2]; + } + + if ((0, _apolloUtilities.isField)(selection)) { + return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { + var _a; + + if (typeof fieldResult !== 'undefined') { + resultsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); + } + })]; + } + + if ((0, _apolloUtilities.isInlineFragment)(selection)) { + fragment = selection; + } else { + fragment = fragmentMap[selection.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 18) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value); + } + + if (fragment && fragment.typeCondition) { + typeCondition = fragment.typeCondition.name.value; + + if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { + return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { + resultsToMerge.push(fragmentResult); + })]; + } + } + + return [2]; + }); + }); + }; + + return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { + return (0, _apolloUtilities.mergeDeepArray)(resultsToMerge); + })]; + }); + }); + }; + + LocalState.prototype.resolveField = function (field, rootValue, execContext) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_a) { + variables = execContext.variables; + fieldName = field.name.value; + aliasedFieldName = (0, _apolloUtilities.resultKeyNameFromField)(field); + aliasUsed = fieldName !== aliasedFieldName; + defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; + resultPromise = Promise.resolve(defaultResult); + + if (!execContext.onlyRunForcedResolvers || this.shouldForceResolvers(field)) { + resolverType = rootValue.__typename || execContext.defaultOperationType; + resolverMap = this.resolvers && this.resolvers[resolverType]; + + if (resolverMap) { + resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; + + if (resolve) { + resultPromise = Promise.resolve(resolve(rootValue, (0, _apolloUtilities.argumentsObjectFromField)(field, variables), execContext.context, { + field: field + })); + } + } + } + + return [2, resultPromise.then(function (result) { + if (result === void 0) { + result = defaultResult; + } + + if (field.directives) { + field.directives.forEach(function (directive) { + if (directive.name.value === 'export' && directive.arguments) { + directive.arguments.forEach(function (arg) { + if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { + execContext.exportedVariables[arg.value.value] = result; + } + }); + } + }); + } + + if (!field.selectionSet) { + return result; + } + + if (result == null) { + return result; + } + + if (Array.isArray(result)) { + return _this.resolveSubSelectedArray(field, result, execContext); + } + + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, result, execContext); + } + })]; + }); + }); + }; + + LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { + var _this = this; + + return Promise.all(result.map(function (item) { + if (item === null) { + return null; + } + + if (Array.isArray(item)) { + return _this.resolveSubSelectedArray(field, item, execContext); + } + + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, item, execContext); + } + })); + }; + + return LocalState; + }(); + + function multiplex(inner) { + var observers = new Set(); + var sub = null; + return new Observable(function (observer) { + observers.add(observer); + sub = sub || inner.subscribe({ + next: function (value) { + observers.forEach(function (obs) { + return obs.next && obs.next(value); + }); + }, + error: function (error) { + observers.forEach(function (obs) { + return obs.error && obs.error(error); + }); + }, + complete: function () { + observers.forEach(function (obs) { + return obs.complete && obs.complete(); + }); + } + }); + return function () { + if (observers.delete(observer) && !observers.size && sub) { + sub.unsubscribe(); + sub = null; + } + }; + }); + } + + function asyncMap(observable, mapFn) { + return new Observable(function (observer) { + var next = observer.next, + error = observer.error, + complete = observer.complete; + var activeNextCount = 0; + var completed = false; + var handler = { + next: function (value) { + ++activeNextCount; + new Promise(function (resolve) { + resolve(mapFn(value)); + }).then(function (result) { + --activeNextCount; + next && next.call(observer, result); + completed && handler.complete(); + }, function (e) { + --activeNextCount; + error && error.call(observer, e); + }); + }, + error: function (e) { + error && error.call(observer, e); + }, + complete: function () { + completed = true; + + if (!activeNextCount) { + complete && complete.call(observer); + } + } + }; + var sub = observable.subscribe(handler); + return function () { + return sub.unsubscribe(); + }; + }); + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var QueryManager = function () { + function QueryManager(_a) { + var link = _a.link, + _b = _a.queryDeduplication, + queryDeduplication = _b === void 0 ? false : _b, + store = _a.store, + _c = _a.onBroadcast, + onBroadcast = _c === void 0 ? function () { + return undefined; + } : _c, + _d = _a.ssrMode, + ssrMode = _d === void 0 ? false : _d, + _e = _a.clientAwareness, + clientAwareness = _e === void 0 ? {} : _e, + localState = _a.localState, + assumeImmutableResults = _a.assumeImmutableResults; + this.mutationStore = new MutationStore(); + this.queryStore = new QueryStore(); + this.clientAwareness = {}; + this.idCounter = 1; + this.queries = new Map(); + this.fetchQueryRejectFns = new Map(); + this.transformCache = new (_apolloUtilities.canUseWeakMap ? WeakMap : Map)(); + this.inFlightLinkObservables = new Map(); + this.pollingInfoByQueryId = new Map(); + this.link = link; + this.queryDeduplication = queryDeduplication; + this.dataStore = store; + this.onBroadcast = onBroadcast; + this.clientAwareness = clientAwareness; + this.localState = localState || new LocalState({ + cache: store.getCache() + }); + this.ssrMode = ssrMode; + this.assumeImmutableResults = !!assumeImmutableResults; + } + + QueryManager.prototype.stop = function () { + var _this = this; + + this.queries.forEach(function (_info, queryId) { + _this.stopQueryNoBroadcast(queryId); + }); + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(6) : new _tsInvariant.InvariantError('QueryManager stopped while query was in flight')); + }); + }; + + QueryManager.prototype.mutate = function (_a) { + var mutation = _a.mutation, + variables = _a.variables, + optimisticResponse = _a.optimisticResponse, + updateQueriesByName = _a.updateQueries, + _b = _a.refetchQueries, + refetchQueries = _b === void 0 ? [] : _b, + _c = _a.awaitRefetchQueries, + awaitRefetchQueries = _c === void 0 ? false : _c, + updateWithProxyFn = _a.update, + _d = _a.errorPolicy, + errorPolicy = _d === void 0 ? 'none' : _d, + fetchPolicy = _a.fetchPolicy, + _e = _a.context, + context = _e === void 0 ? {} : _e; + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var mutationId, generateUpdateQueriesInfo, self; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_f) { + switch (_f.label) { + case 0: + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutation, 7) : (0, _tsInvariant.invariant)(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', 8) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "fetchPolicy for mutations currently only supports the 'no-cache' policy"); + mutationId = this.generateQueryId(); + mutation = this.transform(mutation).document; + this.setQuery(mutationId, function () { + return { + document: mutation + }; + }); + variables = this.getVariables(mutation, variables); + if (!this.transform(mutation).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(mutation, variables, context)]; + + case 1: + variables = _f.sent(); + _f.label = 2; + + case 2: + generateUpdateQueriesInfo = function () { + var ret = {}; + + if (updateQueriesByName) { + _this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + + if (observableQuery) { + var queryName = observableQuery.queryName; + + if (queryName && hasOwnProperty.call(updateQueriesByName, queryName)) { + ret[queryId] = { + updater: updateQueriesByName[queryName], + query: _this.queryStore.get(queryId) + }; + } + } + }); + } + + return ret; + }; + + this.mutationStore.initMutation(mutationId, mutation, variables); + this.dataStore.markMutationInit({ + mutationId: mutationId, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + optimisticResponse: optimisticResponse + }); + this.broadcastQueries(); + self = this; + return [2, new Promise(function (resolve, reject) { + var storeResult; + var error; + self.getObservableFromLink(mutation, (0, _tslib.__assign)({}, context, { + optimisticResponse: optimisticResponse + }), variables, false).subscribe({ + next: function (result) { + if ((0, _apolloUtilities.graphQLResultHasError)(result) && errorPolicy === 'none') { + error = new ApolloError({ + graphQLErrors: result.errors + }); + return; + } + + self.mutationStore.markMutationResult(mutationId); + + if (fetchPolicy !== 'no-cache') { + self.dataStore.markMutationResult({ + mutationId: mutationId, + result: result, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn + }); + } + + storeResult = result; + }, + error: function (err) { + self.mutationStore.markMutationError(mutationId, err); + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse + }); + self.broadcastQueries(); + self.setQuery(mutationId, function () { + return { + document: null + }; + }); + reject(new ApolloError({ + networkError: err + })); + }, + complete: function () { + if (error) { + self.mutationStore.markMutationError(mutationId, error); + } + + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse + }); + self.broadcastQueries(); + + if (error) { + reject(error); + return; + } + + if (typeof refetchQueries === 'function') { + refetchQueries = refetchQueries(storeResult); + } + + var refetchQueryPromises = []; + + if (isNonEmptyArray(refetchQueries)) { + refetchQueries.forEach(function (refetchQuery) { + if (typeof refetchQuery === 'string') { + self.queries.forEach(function (_a) { + var observableQuery = _a.observableQuery; + + if (observableQuery && observableQuery.queryName === refetchQuery) { + refetchQueryPromises.push(observableQuery.refetch()); + } + }); + } else { + var queryOptions = { + query: refetchQuery.query, + variables: refetchQuery.variables, + fetchPolicy: 'network-only' + }; + + if (refetchQuery.context) { + queryOptions.context = refetchQuery.context; + } + + refetchQueryPromises.push(self.query(queryOptions)); + } + }); + } + + Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { + self.setQuery(mutationId, function () { + return { + document: null + }; + }); + + if (errorPolicy === 'ignore' && storeResult && (0, _apolloUtilities.graphQLResultHasError)(storeResult)) { + delete storeResult.errors; + } + + resolve(storeResult); + }); + } + }); + })]; + } + }); + }); + }; + + QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { + return (0, _tslib.__awaiter)(this, void 0, void 0, function () { + var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; + + var _this = this; + + return (0, _tslib.__generator)(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; + query = this.transform(options.query).document; + variables = this.getVariables(query, options.variables); + if (!this.transform(query).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(query, variables, context)]; + + case 1: + variables = _e.sent(); + _e.label = 2; + + case 2: + options = (0, _tslib.__assign)({}, options, { + variables: variables + }); + isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + needToFetch = isNetworkOnly; + + if (!isNetworkOnly) { + _d = this.dataStore.getCache().diff({ + query: query, + variables: variables, + returnPartialData: true, + optimistic: false + }), complete = _d.complete, result = _d.result; + needToFetch = !complete || fetchPolicy === 'cache-and-network'; + storeResult = result; + } + + shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; + if ((0, _apolloUtilities.hasDirectives)(['live'], query)) shouldFetch = true; + requestId = this.idCounter++; + cancel = fetchPolicy !== 'no-cache' ? this.updateQueryWatch(queryId, query, options) : undefined; + this.setQuery(queryId, function () { + return { + document: query, + lastRequestId: requestId, + invalidated: true, + cancel: cancel + }; + }); + this.invalidate(fetchMoreForQueryId); + this.queryStore.initQuery({ + queryId: queryId, + document: query, + storePreviousVariables: shouldFetch, + variables: variables, + isPoll: fetchType === FetchType.poll, + isRefetch: fetchType === FetchType.refetch, + metadata: metadata, + fetchMoreForQueryId: fetchMoreForQueryId + }); + this.broadcastQueries(); + + if (shouldFetch) { + networkResult = this.fetchRequest({ + requestId: requestId, + queryId: queryId, + document: query, + options: options, + fetchMoreForQueryId: fetchMoreForQueryId + }).catch(function (error) { + if (isApolloError(error)) { + throw error; + } else { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); + + _this.invalidate(queryId); + + _this.invalidate(fetchMoreForQueryId); + + _this.broadcastQueries(); + } + + throw new ApolloError({ + networkError: error + }); + } + }); + + if (fetchPolicy !== 'cache-and-network') { + return [2, networkResult]; + } + + networkResult.catch(function () {}); + } + + this.queryStore.markQueryResultClient(queryId, !shouldFetch); + this.invalidate(queryId); + this.invalidate(fetchMoreForQueryId); + + if (this.transform(query).hasForcedResolvers) { + return [2, this.localState.runResolvers({ + document: query, + remoteResult: { + data: storeResult + }, + context: context, + variables: variables, + onlyRunForcedResolvers: true + }).then(function (result) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + + _this.broadcastQueries(); + + return result; + })]; + } + + this.broadcastQueries(); + return [2, { + data: storeResult + }]; + } + }); + }); + }; + + QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { + var fetchPolicy = _a.fetchPolicy, + variables = _a.variables, + errorPolicy = _a.errorPolicy; + + if (fetchPolicy === 'no-cache') { + this.setQuery(queryId, function () { + return { + newData: { + result: result.data, + complete: true + } + }; + }); + } else { + this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); + } + }; + + QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { + var _this = this; + + function invoke(method, argument) { + if (observer[method]) { + try { + observer[method](argument); + } catch (e) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(e); + } + } else if (method === 'error') { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(argument); + } + } + + return function (queryStoreValue, newData) { + _this.invalidate(queryId, false); + + if (!queryStoreValue) return; + + var _a = _this.getQuery(queryId), + observableQuery = _a.observableQuery, + document = _a.document; + + var fetchPolicy = observableQuery ? observableQuery.options.fetchPolicy : options.fetchPolicy; + if (fetchPolicy === 'standby') return; + var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); + var lastResult = observableQuery && observableQuery.getLastResult(); + var networkStatusChanged = !!(lastResult && lastResult.networkStatus !== queryStoreValue.networkStatus); + var shouldNotifyIfLoading = options.returnPartialData || !newData && queryStoreValue.previousVariables || networkStatusChanged && options.notifyOnNetworkStatusChange || fetchPolicy === 'cache-only' || fetchPolicy === 'cache-and-network'; + + if (loading && !shouldNotifyIfLoading) { + return; + } + + var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); + var errorPolicy = observableQuery && observableQuery.options.errorPolicy || options.errorPolicy || 'none'; + + if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { + return invoke('error', new ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError + })); + } + + try { + var data = void 0; + var isMissing = void 0; + + if (newData) { + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { + _this.setQuery(queryId, function () { + return { + newData: null + }; + }); + } + + data = newData.result; + isMissing = !newData.complete; + } else { + var lastError = observableQuery && observableQuery.getLastError(); + var errorStatusChanged = errorPolicy !== 'none' && (lastError && lastError.graphQLErrors) !== queryStoreValue.graphQLErrors; + + if (lastResult && lastResult.data && !errorStatusChanged) { + data = lastResult.data; + isMissing = false; + } else { + var diffResult = _this.dataStore.getCache().diff({ + query: document, + variables: queryStoreValue.previousVariables || queryStoreValue.variables, + returnPartialData: true, + optimistic: true + }); + + data = diffResult.result; + isMissing = !diffResult.complete; + } + } + + var stale = isMissing && !(options.returnPartialData || fetchPolicy === 'cache-only'); + var resultFromStore = { + data: stale ? lastResult && lastResult.data : data, + loading: loading, + networkStatus: queryStoreValue.networkStatus, + stale: stale + }; + + if (errorPolicy === 'all' && hasGraphQLErrors) { + resultFromStore.errors = queryStoreValue.graphQLErrors; + } + + invoke('next', resultFromStore); + } catch (networkError) { + invoke('error', new ApolloError({ + networkError: networkError + })); + } + }; + }; + + QueryManager.prototype.transform = function (document) { + var transformCache = this.transformCache; + + if (!transformCache.has(document)) { + var cache = this.dataStore.getCache(); + var transformed = cache.transformDocument(document); + var forLink = (0, _apolloUtilities.removeConnectionDirectiveFromDocument)(cache.transformForLink(transformed)); + var clientQuery = this.localState.clientQuery(transformed); + var serverQuery = this.localState.serverQuery(forLink); + var cacheEntry_1 = { + document: transformed, + hasClientExports: (0, _apolloUtilities.hasClientExports)(transformed), + hasForcedResolvers: this.localState.shouldForceResolvers(transformed), + clientQuery: clientQuery, + serverQuery: serverQuery, + defaultVars: (0, _apolloUtilities.getDefaultValues)((0, _apolloUtilities.getOperationDefinition)(transformed)) + }; + + var add = function (doc) { + if (doc && !transformCache.has(doc)) { + transformCache.set(doc, cacheEntry_1); + } + }; + + add(document); + add(transformed); + add(clientQuery); + add(serverQuery); + } + + return transformCache.get(document); + }; + + QueryManager.prototype.getVariables = function (document, variables) { + return (0, _tslib.__assign)({}, this.transform(document).defaultVars, variables); + }; + + QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { + if (shouldSubscribe === void 0) { + shouldSubscribe = true; + } + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 9) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); + options.variables = this.getVariables(options.query, options.variables); + + if (typeof options.notifyOnNetworkStatusChange === 'undefined') { + options.notifyOnNetworkStatusChange = false; + } + + var transformedOptions = (0, _tslib.__assign)({}, options); + return new ObservableQuery({ + queryManager: this, + options: transformedOptions, + shouldSubscribe: shouldSubscribe + }); + }; + + QueryManager.prototype.query = function (options) { + var _this = this; + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query, 10) : (0, _tsInvariant.invariant)(options.query, 'query option is required. You must specify your GraphQL document ' + 'in the query option.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query.kind === 'Document', 11) : (0, _tsInvariant.invariant)(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.returnPartialData, 12) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 13) : (0, _tsInvariant.invariant)(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); + return new Promise(function (resolve, reject) { + var watchedQuery = _this.watchQuery(options, false); + + _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); + + watchedQuery.result().then(resolve, reject).then(function () { + return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); + }); + }); + }; + + QueryManager.prototype.generateQueryId = function () { + return String(this.idCounter++); + }; + + QueryManager.prototype.stopQueryInStore = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.broadcastQueries(); + }; + + QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { + this.stopPollingQuery(queryId); + this.queryStore.stopQuery(queryId); + this.invalidate(queryId); + }; + + QueryManager.prototype.addQueryListener = function (queryId, listener) { + this.setQuery(queryId, function (_a) { + var listeners = _a.listeners; + listeners.add(listener); + return { + invalidated: false + }; + }); + }; + + QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { + var _this = this; + + var cancel = this.getQuery(queryId).cancel; + if (cancel) cancel(); + + var previousResult = function () { + var previousResult = null; + + var observableQuery = _this.getQuery(queryId).observableQuery; + + if (observableQuery) { + var lastResult = observableQuery.getLastResult(); + + if (lastResult) { + previousResult = lastResult.data; + } + } + + return previousResult; + }; + + return this.dataStore.getCache().watch({ + query: document, + variables: options.variables, + optimistic: true, + previousResult: previousResult, + callback: function (newData) { + _this.setQuery(queryId, function () { + return { + invalidated: true, + newData: newData + }; + }); + } + }); + }; + + QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { + this.setQuery(queryId, function () { + return { + observableQuery: observableQuery + }; + }); + }; + + QueryManager.prototype.removeObservableQuery = function (queryId) { + var cancel = this.getQuery(queryId).cancel; + this.setQuery(queryId, function () { + return { + observableQuery: null + }; + }); + if (cancel) cancel(); + }; + + QueryManager.prototype.clearStore = function () { + this.fetchQueryRejectFns.forEach(function (reject) { + reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(14) : new _tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)')); + }); + var resetIds = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) resetIds.push(queryId); + }); + this.queryStore.reset(resetIds); + this.mutationStore.reset(); + return this.dataStore.reset(); + }; + + QueryManager.prototype.resetStore = function () { + var _this = this; + + return this.clearStore().then(function () { + return _this.reFetchObservableQueries(); + }); + }; + + QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { + var _this = this; + + if (includeStandby === void 0) { + includeStandby = false; + } + + var observableQueryPromises = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + + if (observableQuery) { + var fetchPolicy = observableQuery.options.fetchPolicy; + observableQuery.resetLastResults(); + + if (fetchPolicy !== 'cache-only' && (includeStandby || fetchPolicy !== 'standby')) { + observableQueryPromises.push(observableQuery.refetch()); + } + + _this.setQuery(queryId, function () { + return { + newData: null + }; + }); + + _this.invalidate(queryId); + } + }); + this.broadcastQueries(); + return Promise.all(observableQueryPromises); + }; + + QueryManager.prototype.observeQuery = function (queryId, options, observer) { + this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); + return this.fetchQuery(queryId, options); + }; + + QueryManager.prototype.startQuery = function (queryId, options, listener) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("The QueryManager.startQuery method has been deprecated"); + this.addQueryListener(queryId, listener); + this.fetchQuery(queryId, options).catch(function () { + return undefined; + }); + return queryId; + }; + + QueryManager.prototype.startGraphQLSubscription = function (_a) { + var _this = this; + + var query = _a.query, + fetchPolicy = _a.fetchPolicy, + variables = _a.variables; + query = this.transform(query).document; + variables = this.getVariables(query, variables); + + var makeObservable = function (variables) { + return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { + if (!fetchPolicy || fetchPolicy !== 'no-cache') { + _this.dataStore.markSubscriptionResult(result, query, variables); + + _this.broadcastQueries(); + } + + if ((0, _apolloUtilities.graphQLResultHasError)(result)) { + throw new ApolloError({ + graphQLErrors: result.errors + }); + } + + return result; + }); + }; + + if (this.transform(query).hasClientExports) { + var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); + return new Observable(function (observer) { + var sub = null; + observablePromise_1.then(function (observable) { + return sub = observable.subscribe(observer); + }, observer.error); + return function () { + return sub && sub.unsubscribe(); + }; + }); + } + + return makeObservable(variables); + }; + + QueryManager.prototype.stopQuery = function (queryId) { + this.stopQueryNoBroadcast(queryId); + this.broadcastQueries(); + }; + + QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.removeQuery(queryId); + }; + + QueryManager.prototype.removeQuery = function (queryId) { + this.fetchQueryRejectFns.delete("query:" + queryId); + this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); + this.getQuery(queryId).subscriptions.forEach(function (x) { + return x.unsubscribe(); + }); + this.queries.delete(queryId); + }; + + QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { + if (optimistic === void 0) { + optimistic = true; + } + + var _a = observableQuery.options, + variables = _a.variables, + query = _a.query, + fetchPolicy = _a.fetchPolicy, + returnPartialData = _a.returnPartialData; + var lastResult = observableQuery.getLastResult(); + var newData = this.getQuery(observableQuery.queryId).newData; + + if (newData && newData.complete) { + return { + data: newData.result, + partial: false + }; + } + + if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { + return { + data: undefined, + partial: false + }; + } + + var _b = this.dataStore.getCache().diff({ + query: query, + variables: variables, + previousResult: lastResult ? lastResult.data : undefined, + returnPartialData: true, + optimistic: optimistic + }), + result = _b.result, + complete = _b.complete; + + return { + data: complete || returnPartialData ? result : void 0, + partial: !complete + }; + }; + + QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { + var observableQuery; + + if (typeof queryIdOrObservable === 'string') { + var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(foundObserveableQuery, 15) : (0, _tsInvariant.invariant)(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); + observableQuery = foundObserveableQuery; + } else { + observableQuery = queryIdOrObservable; + } + + var _a = observableQuery.options, + variables = _a.variables, + query = _a.query; + return { + previousResult: this.getCurrentQueryResult(observableQuery, false).data, + variables: variables, + document: query + }; + }; + + QueryManager.prototype.broadcastQueries = function () { + var _this = this; + + this.onBroadcast(); + this.queries.forEach(function (info, id) { + if (info.invalidated) { + info.listeners.forEach(function (listener) { + if (listener) { + listener(_this.queryStore.get(id), info.newData); + } + }); + } + }); + }; + + QueryManager.prototype.getLocalState = function () { + return this.localState; + }; + + QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { + var _this = this; + + if (deduplication === void 0) { + deduplication = this.queryDeduplication; + } + + var observable; + var serverQuery = this.transform(query).serverQuery; + + if (serverQuery) { + var _a = this, + inFlightLinkObservables_1 = _a.inFlightLinkObservables, + link = _a.link; + + var operation = { + query: serverQuery, + variables: variables, + operationName: (0, _apolloUtilities.getOperationName)(serverQuery) || void 0, + context: this.prepareContext((0, _tslib.__assign)({}, context, { + forceFetch: !deduplication + })) + }; + context = operation.context; + + if (deduplication) { + var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); + inFlightLinkObservables_1.set(serverQuery, byVariables_1); + var varJson_1 = JSON.stringify(variables); + observable = byVariables_1.get(varJson_1); + + if (!observable) { + byVariables_1.set(varJson_1, observable = multiplex((0, _apolloLink.execute)(link, operation))); + + var cleanup = function () { + byVariables_1.delete(varJson_1); + if (!byVariables_1.size) inFlightLinkObservables_1.delete(serverQuery); + cleanupSub_1.unsubscribe(); + }; + + var cleanupSub_1 = observable.subscribe({ + next: cleanup, + error: cleanup, + complete: cleanup + }); + } + } else { + observable = multiplex((0, _apolloLink.execute)(link, operation)); + } + } else { + observable = Observable.of({ + data: {} + }); + context = this.prepareContext(context); + } + + var clientQuery = this.transform(query).clientQuery; + + if (clientQuery) { + observable = asyncMap(observable, function (result) { + return _this.localState.runResolvers({ + document: clientQuery, + remoteResult: result, + context: context, + variables: variables + }); + }); + } + + return observable; + }; + + QueryManager.prototype.fetchRequest = function (_a) { + var _this = this; + + var requestId = _a.requestId, + queryId = _a.queryId, + document = _a.document, + options = _a.options, + fetchMoreForQueryId = _a.fetchMoreForQueryId; + var variables = options.variables, + _b = options.errorPolicy, + errorPolicy = _b === void 0 ? 'none' : _b, + fetchPolicy = options.fetchPolicy; + var resultFromStore; + var errorsFromStore; + return new Promise(function (resolve, reject) { + var observable = _this.getObservableFromLink(document, options.context, variables); + + var fqrfId = "fetchRequest:" + queryId; + + _this.fetchQueryRejectFns.set(fqrfId, reject); + + var cleanup = function () { + _this.fetchQueryRejectFns.delete(fqrfId); + + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.delete(subscription); + }); + }; + + var subscription = observable.map(function (result) { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + + _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); + + _this.invalidate(queryId); + + _this.invalidate(fetchMoreForQueryId); + + _this.broadcastQueries(); + } + + if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { + return reject(new ApolloError({ + graphQLErrors: result.errors + })); + } + + if (errorPolicy === 'all') { + errorsFromStore = result.errors; + } + + if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { + resultFromStore = result.data; + } else { + var _a = _this.dataStore.getCache().diff({ + variables: variables, + query: document, + optimistic: false, + returnPartialData: true + }), + result_1 = _a.result, + complete = _a.complete; + + if (complete || options.returnPartialData) { + resultFromStore = result_1; + } + } + }).subscribe({ + error: function (error) { + cleanup(); + reject(error); + }, + complete: function () { + cleanup(); + resolve({ + data: resultFromStore, + errors: errorsFromStore, + loading: false, + networkStatus: NetworkStatus.ready, + stale: false + }); + } + }); + + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.add(subscription); + }); + }); + }; + + QueryManager.prototype.getQuery = function (queryId) { + return this.queries.get(queryId) || { + listeners: new Set(), + invalidated: false, + document: null, + newData: null, + lastRequestId: 1, + observableQuery: null, + subscriptions: new Set() + }; + }; + + QueryManager.prototype.setQuery = function (queryId, updater) { + var prev = this.getQuery(queryId); + var newInfo = (0, _tslib.__assign)({}, prev, updater(prev)); + this.queries.set(queryId, newInfo); + }; + + QueryManager.prototype.invalidate = function (queryId, invalidated) { + if (invalidated === void 0) { + invalidated = true; + } + + if (queryId) { + this.setQuery(queryId, function () { + return { + invalidated: invalidated + }; + }); + } + }; + + QueryManager.prototype.prepareContext = function (context) { + if (context === void 0) { + context = {}; + } + + var newContext = this.localState.prepareContext(context); + return (0, _tslib.__assign)({}, newContext, { + clientAwareness: this.clientAwareness + }); + }; + + QueryManager.prototype.checkInFlight = function (queryId) { + var query = this.queryStore.get(queryId); + return query && query.networkStatus !== NetworkStatus.ready && query.networkStatus !== NetworkStatus.error; + }; + + QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { + var _this = this; + + var pollInterval = options.pollInterval; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(pollInterval, 16) : (0, _tsInvariant.invariant)(pollInterval, 'Attempted to start a polling query without a polling interval.'); + + if (!this.ssrMode) { + var info = this.pollingInfoByQueryId.get(queryId); + + if (!info) { + this.pollingInfoByQueryId.set(queryId, info = {}); + } + + info.interval = pollInterval; + info.options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'network-only' + }); + + var maybeFetch_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + + if (info) { + if (_this.checkInFlight(queryId)) { + poll_1(); + } else { + _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); + } + } + }; + + var poll_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + + if (info) { + clearTimeout(info.timeout); + info.timeout = setTimeout(maybeFetch_1, info.interval); + } + }; + + if (listener) { + this.addQueryListener(queryId, listener); + } + + poll_1(); + } + + return queryId; + }; + + QueryManager.prototype.stopPollingQuery = function (queryId) { + this.pollingInfoByQueryId.delete(queryId); + }; + + return QueryManager; + }(); + + var DataStore = function () { + function DataStore(initialCache) { + this.cache = initialCache; + } + + DataStore.prototype.getCache = function () { + return this.cache; + }; + + DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { + if (ignoreErrors === void 0) { + ignoreErrors = false; + } + + var writeWithErrors = !(0, _apolloUtilities.graphQLResultHasError)(result); + + if (ignoreErrors && (0, _apolloUtilities.graphQLResultHasError)(result) && result.data) { + writeWithErrors = true; + } + + if (!fetchMoreForQueryId && writeWithErrors) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_QUERY', + query: document, + variables: variables + }); + } + }; + + DataStore.prototype.markSubscriptionResult = function (result, document, variables) { + if (!(0, _apolloUtilities.graphQLResultHasError)(result)) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_SUBSCRIPTION', + query: document, + variables: variables + }); + } + }; + + DataStore.prototype.markMutationInit = function (mutation) { + var _this = this; + + if (mutation.optimisticResponse) { + var optimistic_1; + + if (typeof mutation.optimisticResponse === 'function') { + optimistic_1 = mutation.optimisticResponse(mutation.variables); + } else { + optimistic_1 = mutation.optimisticResponse; + } + + this.cache.recordOptimisticTransaction(function (c) { + var orig = _this.cache; + _this.cache = c; + + try { + _this.markMutationResult({ + mutationId: mutation.mutationId, + result: { + data: optimistic_1 + }, + document: mutation.document, + variables: mutation.variables, + updateQueries: mutation.updateQueries, + update: mutation.update + }); + } finally { + _this.cache = orig; + } + }, mutation.mutationId); + } + }; + + DataStore.prototype.markMutationResult = function (mutation) { + var _this = this; + + if (!(0, _apolloUtilities.graphQLResultHasError)(mutation.result)) { + var cacheWrites_1 = [{ + result: mutation.result.data, + dataId: 'ROOT_MUTATION', + query: mutation.document, + variables: mutation.variables + }]; + var updateQueries_1 = mutation.updateQueries; + + if (updateQueries_1) { + Object.keys(updateQueries_1).forEach(function (id) { + var _a = updateQueries_1[id], + query = _a.query, + updater = _a.updater; + + var _b = _this.cache.diff({ + query: query.document, + variables: query.variables, + returnPartialData: true, + optimistic: false + }), + currentQueryResult = _b.result, + complete = _b.complete; + + if (complete) { + var nextQueryResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return updater(currentQueryResult, { + mutationResult: mutation.result, + queryName: (0, _apolloUtilities.getOperationName)(query.document) || undefined, + queryVariables: query.variables + }); + }); + + if (nextQueryResult) { + cacheWrites_1.push({ + result: nextQueryResult, + dataId: 'ROOT_QUERY', + query: query.document, + variables: query.variables + }); + } + } + }); + } + + this.cache.performTransaction(function (c) { + cacheWrites_1.forEach(function (write) { + return c.write(write); + }); + var update = mutation.update; + + if (update) { + (0, _apolloUtilities.tryFunctionOrLogError)(function () { + return update(c, mutation.result); + }); + } + }); + } + }; + + DataStore.prototype.markMutationComplete = function (_a) { + var mutationId = _a.mutationId, + optimisticResponse = _a.optimisticResponse; + + if (optimisticResponse) { + this.cache.removeOptimistic(mutationId); + } + }; + + DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { + this.cache.write({ + result: newResult, + dataId: 'ROOT_QUERY', + variables: variables, + query: document + }); + }; + + DataStore.prototype.reset = function () { + return this.cache.reset(); + }; + + return DataStore; + }(); + + var version = "2.6.3"; + var hasSuggestedDevtools = false; + + var ApolloClient = function () { + function ApolloClient(options) { + var _this = this; + + this.defaultOptions = {}; + this.resetStoreCallbacks = []; + this.clearStoreCallbacks = []; + var cache = options.cache, + _a = options.ssrMode, + ssrMode = _a === void 0 ? false : _a, + _b = options.ssrForceFetchDelay, + ssrForceFetchDelay = _b === void 0 ? 0 : _b, + connectToDevTools = options.connectToDevTools, + _c = options.queryDeduplication, + queryDeduplication = _c === void 0 ? true : _c, + defaultOptions = options.defaultOptions, + _d = options.assumeImmutableResults, + assumeImmutableResults = _d === void 0 ? false : _d, + resolvers = options.resolvers, + typeDefs = options.typeDefs, + fragmentMatcher = options.fragmentMatcher, + clientAwarenessName = options.name, + clientAwarenessVersion = options.version; + var link = options.link; + + if (!link && resolvers) { + link = _apolloLink.ApolloLink.empty(); + } + + if (!link || !cache) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); + } + + this.link = link; + this.cache = cache; + this.store = new DataStore(cache); + this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; + this.queryDeduplication = queryDeduplication; + this.defaultOptions = defaultOptions || {}; + this.typeDefs = typeDefs; + + if (ssrForceFetchDelay) { + setTimeout(function () { + return _this.disableNetworkFetches = false; + }, ssrForceFetchDelay); + } + + this.watchQuery = this.watchQuery.bind(this); + this.query = this.query.bind(this); + this.mutate = this.mutate.bind(this); + this.resetStore = this.resetStore.bind(this); + this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); + var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && !window.__APOLLO_CLIENT__; + + if (typeof connectToDevTools === 'undefined' ? defaultConnectToDevTools : connectToDevTools && typeof window !== 'undefined') { + window.__APOLLO_CLIENT__ = this; + } + + if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { + hasSuggestedDevtools = true; + + if (typeof window !== 'undefined' && window.document && window.top === window.self) { + if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + if (window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('Chrome') > -1) { + console.debug('Download the Apollo DevTools ' + 'for a better development experience: ' + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); + } + } + } + } + + this.version = version; + this.localState = new LocalState({ + cache: cache, + client: this, + resolvers: resolvers, + fragmentMatcher: fragmentMatcher + }); + this.queryManager = new QueryManager({ + link: this.link, + store: this.store, + queryDeduplication: queryDeduplication, + ssrMode: ssrMode, + clientAwareness: { + name: clientAwarenessName, + version: clientAwarenessVersion + }, + localState: this.localState, + assumeImmutableResults: assumeImmutableResults, + onBroadcast: function () { + if (_this.devToolsHookCb) { + _this.devToolsHookCb({ + action: {}, + state: { + queries: _this.queryManager.queryStore.getStore(), + mutations: _this.queryManager.mutationStore.getStore() + }, + dataWithOptimisticResults: _this.cache.extract(true) + }); + } + } + }); + } + + ApolloClient.prototype.stop = function () { + this.queryManager.stop(); + }; + + ApolloClient.prototype.watchQuery = function (options) { + if (this.defaultOptions.watchQuery) { + options = (0, _tslib.__assign)({}, this.defaultOptions.watchQuery, options); + } + + if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { + options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'cache-first' + }); + } + + return this.queryManager.watchQuery(options); + }; + + ApolloClient.prototype.query = function (options) { + if (this.defaultOptions.query) { + options = (0, _tslib.__assign)({}, this.defaultOptions.query, options); + } + + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 2) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + 'client.query can only return a single result. Please use client.watchQuery ' + 'to receive multiple results from the cache and the network, or consider ' + 'using a different fetchPolicy, such as cache-first or network-only.'); + + if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { + options = (0, _tslib.__assign)({}, options, { + fetchPolicy: 'cache-first' + }); + } + + return this.queryManager.query(options); + }; + + ApolloClient.prototype.mutate = function (options) { + if (this.defaultOptions.mutate) { + options = (0, _tslib.__assign)({}, this.defaultOptions.mutate, options); + } + + return this.queryManager.mutate(options); + }; + + ApolloClient.prototype.subscribe = function (options) { + return this.queryManager.startGraphQLSubscription(options); + }; + + ApolloClient.prototype.readQuery = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.cache.readQuery(options, optimistic); + }; + + ApolloClient.prototype.readFragment = function (options, optimistic) { + if (optimistic === void 0) { + optimistic = false; + } + + return this.cache.readFragment(options, optimistic); + }; + + ApolloClient.prototype.writeQuery = function (options) { + var result = this.cache.writeQuery(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.writeFragment = function (options) { + var result = this.cache.writeFragment(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.writeData = function (options) { + var result = this.cache.writeData(options); + this.queryManager.broadcastQueries(); + return result; + }; + + ApolloClient.prototype.__actionHookForDevTools = function (cb) { + this.devToolsHookCb = cb; + }; + + ApolloClient.prototype.__requestRaw = function (payload) { + return (0, _apolloLink.execute)(this.link, payload); + }; + + ApolloClient.prototype.initQueryManager = function () { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + 'and it will be removed from ApolloClient in version 3.0.'); + return this.queryManager; + }; + + ApolloClient.prototype.resetStore = function () { + var _this = this; + + return Promise.resolve().then(function () { + return _this.queryManager.clearStore(); + }).then(function () { + return Promise.all(_this.resetStoreCallbacks.map(function (fn) { + return fn(); + })); + }).then(function () { + return _this.reFetchObservableQueries(); + }); + }; + + ApolloClient.prototype.clearStore = function () { + var _this = this; + + return Promise.resolve().then(function () { + return _this.queryManager.clearStore(); + }).then(function () { + return Promise.all(_this.clearStoreCallbacks.map(function (fn) { + return fn(); + })); + }); + }; + + ApolloClient.prototype.onResetStore = function (cb) { + var _this = this; + + this.resetStoreCallbacks.push(cb); + return function () { + _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { + return c !== cb; + }); + }; + }; + + ApolloClient.prototype.onClearStore = function (cb) { + var _this = this; + + this.clearStoreCallbacks.push(cb); + return function () { + _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { + return c !== cb; + }); + }; + }; + + ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { + return this.queryManager.reFetchObservableQueries(includeStandby); + }; + + ApolloClient.prototype.extract = function (optimistic) { + return this.cache.extract(optimistic); + }; + + ApolloClient.prototype.restore = function (serializedState) { + return this.cache.restore(serializedState); + }; + + ApolloClient.prototype.addResolvers = function (resolvers) { + this.localState.addResolvers(resolvers); + }; + + ApolloClient.prototype.setResolvers = function (resolvers) { + this.localState.setResolvers(resolvers); + }; + + ApolloClient.prototype.getResolvers = function () { + return this.localState.getResolvers(); + }; + + ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { + this.localState.setFragmentMatcher(fragmentMatcher); + }; + + return ApolloClient; + }(); + + _exports.ApolloClient = ApolloClient; + var _default = ApolloClient; + + _exports.default = _default; +}); diff --git a/node_modules/apollo-client/bundle.umd.js.map b/node_modules/apollo-client/bundle.umd.js.map new file mode 100644 index 000000000..9ed76cac8 --- /dev/null +++ b/node_modules/apollo-client/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"names":["LinkObservable","tslib_1.__assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGY,a;;;AAAZ,GAAA,UAAY,aAAZ,EAAyB;AAMvB,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAOA,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AAKA,IAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AAKA,IAAA,aAA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AOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,WAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,WAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,YAAA;AACE,aAAO,KAAK,UAAL,CAAgB,YAAhB,EAAP;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,4BAAA,GAAP,UAAoC,eAApC,EAAoE;AAClE,WAAK,UAAL,CAAgB,kBAAhB,CAAmC,eAAnC;AACD,KAFM;;AAGT,WAAA,YAAA;AAAC,GA3gBD,EAAA","sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [field: string]: (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: any,\n ) => any;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n ExecutionResult,\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n fieldName: string,\n rootValue: any,\n args: any,\n context: any,\n info: {\n field: FieldNode;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: ExecutionResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"fetchPolicy for mutations currently only supports the 'no-cache' policy\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: ExecutionResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result as FetchResult;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult as ExecutionResult);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: ExecutionResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: ExecutionResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.3\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.d.ts b/node_modules/apollo-client/config/jest/setup.d.ts new file mode 100644 index 000000000..34f15b40e --- /dev/null +++ b/node_modules/apollo-client/config/jest/setup.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=setup.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.d.ts.map b/node_modules/apollo-client/config/jest/setup.d.ts.map new file mode 100644 index 000000000..62b670a26 --- /dev/null +++ b/node_modules/apollo-client/config/jest/setup.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/config/jest/setup.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.js b/node_modules/apollo-client/config/jest/setup.js new file mode 100644 index 000000000..e45f1b02a --- /dev/null +++ b/node_modules/apollo-client/config/jest/setup.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var graphql_tag_1 = require("graphql-tag"); +graphql_tag_1.disableFragmentWarnings(); +process.on('unhandledRejection', function () { }); +//# sourceMappingURL=setup.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.js.map b/node_modules/apollo-client/config/jest/setup.js.map new file mode 100644 index 000000000..56b7a5d68 --- /dev/null +++ b/node_modules/apollo-client/config/jest/setup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/config/jest/setup.ts"],"names":[],"mappings":";;AAAA,2CAAsD;AAGtD,qCAAuB,EAAE,CAAC;AAE1B,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,cAAO,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.d.ts b/node_modules/apollo-client/core/LocalState.d.ts new file mode 100644 index 000000000..49fbbe079 --- /dev/null +++ b/node_modules/apollo-client/core/LocalState.d.ts @@ -0,0 +1,65 @@ +import { ExecutionResult, DocumentNode, FieldNode, ASTNode } from 'graphql'; +import { ApolloCache } from 'apollo-cache'; +import { FragmentMap } from 'apollo-utilities'; +import ApolloClient from '../ApolloClient'; +import { Resolvers, OperationVariables } from './types'; +export declare type Resolver = (fieldName: string, rootValue: any, args: any, context: any, info: { + field: FieldNode; +}) => any; +export declare type VariableMap = { + [name: string]: any; +}; +export declare type FragmentMatcher = (rootValue: any, typeCondition: string, context: any) => boolean; +export declare type ExecContext = { + fragmentMap: FragmentMap; + context: any; + variables: VariableMap; + fragmentMatcher: FragmentMatcher; + defaultOperationType: string; + exportedVariables: Record; + onlyRunForcedResolvers: boolean; +}; +export declare type LocalStateOptions = { + cache: ApolloCache; + client?: ApolloClient; + resolvers?: Resolvers | Resolvers[]; + fragmentMatcher?: FragmentMatcher; +}; +export declare class LocalState { + private cache; + private client; + private resolvers?; + private fragmentMatcher; + constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions); + addResolvers(resolvers: Resolvers | Resolvers[]): void; + setResolvers(resolvers: Resolvers | Resolvers[]): void; + getResolvers(): Resolvers; + runResolvers({ document, remoteResult, context, variables, onlyRunForcedResolvers, }: { + document: DocumentNode | null; + remoteResult: ExecutionResult; + context?: Record; + variables?: Record; + onlyRunForcedResolvers?: boolean; + }): Promise>; + setFragmentMatcher(fragmentMatcher: FragmentMatcher): void; + getFragmentMatcher(): FragmentMatcher; + clientQuery(document: DocumentNode): DocumentNode | null; + serverQuery(document: DocumentNode): DocumentNode | null; + prepareContext(context?: {}): { + cache: ApolloCache; + getCacheKey: (obj: { + __typename: string; + id: string | number; + }) => any; + }; + addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{ + [x: string]: any; + }>; + shouldForceResolvers(document: ASTNode): boolean; + private buildRootValueFromCache; + private resolveDocument; + private resolveSelectionSet; + private resolveField; + private resolveSubSelectedArray; +} +//# sourceMappingURL=LocalState.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.d.ts.map b/node_modules/apollo-client/core/LocalState.d.ts.map new file mode 100644 index 000000000..79be65a7d --- /dev/null +++ b/node_modules/apollo-client/core/LocalState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LocalState.d.ts","sourceRoot":"","sources":["../src/core/LocalState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,YAAY,EAMZ,SAAS,EACT,OAAO,EACR,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAOL,WAAW,EAQZ,MAAM,kBAAkB,CAAC;AAI1B,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGxD,oBAAY,QAAQ,GAAG,CACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,GAAG,EACd,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE;IACJ,KAAK,EAAE,SAAS,CAAC;CAClB,KACE,GAAG,CAAC;AAET,oBAAY,WAAW,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAElD,oBAAY,eAAe,GAAG,CAC5B,SAAS,EAAE,GAAG,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,GAAG,KACT,OAAO,CAAC;AAEb,oBAAY,WAAW,GAAG;IACxB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC;IACb,SAAS,EAAE,WAAW,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,sBAAsB,EAAE,OAAO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AAO,KAAK;;;;;;;IAyBrB,oBAAoB,CAC/B,QAAQ,EAAE,YAAY,EACtB,SAAS,GAAE,kBAAuB,EAClC,OAAO,KAAK;;;IAmBP,oBAAoB,CAAC,QAAQ,EAAE,OAAO;IAuB7C,OAAO,CAAC,uBAAuB;YAYjB,eAAe;YA4Cf,mBAAmB;YAuDnB,YAAY;IA8E1B,OAAO,CAAC,uBAAuB;CAuBhC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.js b/node_modules/apollo-client/core/LocalState.js new file mode 100644 index 000000000..939046a74 --- /dev/null +++ b/node_modules/apollo-client/core/LocalState.js @@ -0,0 +1,276 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var visitor_1 = require("graphql/language/visitor"); +var apollo_utilities_1 = require("apollo-utilities"); +var ts_invariant_1 = require("ts-invariant"); +var capitalizeFirstLetter_1 = require("../util/capitalizeFirstLetter"); +var LocalState = (function () { + function LocalState(_a) { + var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher; + this.cache = cache; + if (client) { + this.client = client; + } + if (resolvers) { + this.addResolvers(resolvers); + } + if (fragmentMatcher) { + this.setFragmentMatcher(fragmentMatcher); + } + } + LocalState.prototype.addResolvers = function (resolvers) { + var _this = this; + this.resolvers = this.resolvers || {}; + if (Array.isArray(resolvers)) { + resolvers.forEach(function (resolverGroup) { + _this.resolvers = apollo_utilities_1.mergeDeep(_this.resolvers, resolverGroup); + }); + } + else { + this.resolvers = apollo_utilities_1.mergeDeep(this.resolvers, resolvers); + } + }; + LocalState.prototype.setResolvers = function (resolvers) { + this.resolvers = {}; + this.addResolvers(resolvers); + }; + LocalState.prototype.getResolvers = function () { + return this.resolvers || {}; + }; + LocalState.prototype.runResolvers = function (_a) { + var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b; + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_c) { + if (document) { + return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (tslib_1.__assign({}, remoteResult, { data: localResult.result })); })]; + } + return [2, remoteResult]; + }); + }); + }; + LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { + this.fragmentMatcher = fragmentMatcher; + }; + LocalState.prototype.getFragmentMatcher = function () { + return this.fragmentMatcher; + }; + LocalState.prototype.clientQuery = function (document) { + if (apollo_utilities_1.hasDirectives(['client'], document)) { + if (this.resolvers) { + return document; + } + ts_invariant_1.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + + 'were specified. This means ApolloClient local resolver handling ' + + 'has been disabled, and @client directives will be passed through ' + + 'to your link chain.'); + } + return null; + }; + LocalState.prototype.serverQuery = function (document) { + return this.resolvers ? apollo_utilities_1.removeClientSetsFromDocument(document) : document; + }; + LocalState.prototype.prepareContext = function (context) { + if (context === void 0) { context = {}; } + var cache = this.cache; + var newContext = tslib_1.__assign({}, context, { cache: cache, getCacheKey: function (obj) { + if (cache.config) { + return cache.config.dataIdFromObject(obj); + } + else { + ts_invariant_1.invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); + } + } }); + return newContext; + }; + LocalState.prototype.addExportedVariables = function (document, variables, context) { + if (variables === void 0) { variables = {}; } + if (context === void 0) { context = {}; } + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + if (document) { + return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (tslib_1.__assign({}, variables, data.exportedVariables)); })]; + } + return [2, tslib_1.__assign({}, variables)]; + }); + }); + }; + LocalState.prototype.shouldForceResolvers = function (document) { + var forceResolvers = false; + visitor_1.visit(document, { + Directive: { + enter: function (node) { + if (node.name.value === 'client' && node.arguments) { + forceResolvers = node.arguments.some(function (arg) { + return arg.name.value === 'always' && + arg.value.kind === 'BooleanValue' && + arg.value.value === true; + }); + if (forceResolvers) { + return visitor_1.BREAK; + } + } + }, + }, + }); + return forceResolvers; + }; + LocalState.prototype.buildRootValueFromCache = function (document, variables) { + return this.cache.diff({ + query: apollo_utilities_1.buildQueryFromSelectionSet(document), + variables: variables, + returnPartialData: true, + optimistic: false, + }).result; + }; + LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { + if (context === void 0) { context = {}; } + if (variables === void 0) { variables = {}; } + if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; } + if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; } + return tslib_1.__awaiter(this, void 0, void 0, function () { + var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; + return tslib_1.__generator(this, function (_b) { + mainDefinition = apollo_utilities_1.getMainDefinition(document); + fragments = apollo_utilities_1.getFragmentDefinitions(document); + fragmentMap = apollo_utilities_1.createFragmentMap(fragments); + definitionOperation = mainDefinition + .operation; + defaultOperationType = definitionOperation + ? capitalizeFirstLetter_1.capitalizeFirstLetter(definitionOperation) + : 'Query'; + _a = this, cache = _a.cache, client = _a.client; + execContext = { + fragmentMap: fragmentMap, + context: tslib_1.__assign({}, context, { cache: cache, + client: client }), + variables: variables, + fragmentMatcher: fragmentMatcher, + defaultOperationType: defaultOperationType, + exportedVariables: {}, + onlyRunForcedResolvers: onlyRunForcedResolvers, + }; + return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({ + result: result, + exportedVariables: execContext.exportedVariables, + }); })]; + }); + }); + }; + LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var fragmentMap, context, variables, resultsToMerge, execute; + var _this = this; + return tslib_1.__generator(this, function (_a) { + fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; + resultsToMerge = [rootValue]; + execute = function (selection) { return tslib_1.__awaiter(_this, void 0, void 0, function () { + var fragment, typeCondition; + return tslib_1.__generator(this, function (_a) { + if (!apollo_utilities_1.shouldInclude(selection, variables)) { + return [2]; + } + if (apollo_utilities_1.isField(selection)) { + return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { + var _a; + if (typeof fieldResult !== 'undefined') { + resultsToMerge.push((_a = {}, + _a[apollo_utilities_1.resultKeyNameFromField(selection)] = fieldResult, + _a)); + } + })]; + } + if (apollo_utilities_1.isInlineFragment(selection)) { + fragment = selection; + } + else { + fragment = fragmentMap[selection.name.value]; + ts_invariant_1.invariant(fragment, "No fragment named " + selection.name.value); + } + if (fragment && fragment.typeCondition) { + typeCondition = fragment.typeCondition.name.value; + if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { + return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { + resultsToMerge.push(fragmentResult); + })]; + } + } + return [2]; + }); + }); }; + return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { + return apollo_utilities_1.mergeDeepArray(resultsToMerge); + })]; + }); + }); + }; + LocalState.prototype.resolveField = function (field, rootValue, execContext) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; + var _this = this; + return tslib_1.__generator(this, function (_a) { + variables = execContext.variables; + fieldName = field.name.value; + aliasedFieldName = apollo_utilities_1.resultKeyNameFromField(field); + aliasUsed = fieldName !== aliasedFieldName; + defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; + resultPromise = Promise.resolve(defaultResult); + if (!execContext.onlyRunForcedResolvers || + this.shouldForceResolvers(field)) { + resolverType = rootValue.__typename || execContext.defaultOperationType; + resolverMap = this.resolvers && this.resolvers[resolverType]; + if (resolverMap) { + resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; + if (resolve) { + resultPromise = Promise.resolve(resolve(rootValue, apollo_utilities_1.argumentsObjectFromField(field, variables), execContext.context, { field: field })); + } + } + } + return [2, resultPromise.then(function (result) { + if (result === void 0) { result = defaultResult; } + if (field.directives) { + field.directives.forEach(function (directive) { + if (directive.name.value === 'export' && directive.arguments) { + directive.arguments.forEach(function (arg) { + if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { + execContext.exportedVariables[arg.value.value] = result; + } + }); + } + }); + } + if (!field.selectionSet) { + return result; + } + if (result == null) { + return result; + } + if (Array.isArray(result)) { + return _this.resolveSubSelectedArray(field, result, execContext); + } + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, result, execContext); + } + })]; + }); + }); + }; + LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { + var _this = this; + return Promise.all(result.map(function (item) { + if (item === null) { + return null; + } + if (Array.isArray(item)) { + return _this.resolveSubSelectedArray(field, item, execContext); + } + if (field.selectionSet) { + return _this.resolveSelectionSet(field.selectionSet, item, execContext); + } + })); + }; + return LocalState; +}()); +exports.LocalState = LocalState; +//# sourceMappingURL=LocalState.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.js.map b/node_modules/apollo-client/core/LocalState.js.map new file mode 100644 index 000000000..9ac58d022 --- /dev/null +++ b/node_modules/apollo-client/core/LocalState.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LocalState.js","sourceRoot":"","sources":["../../src/core/LocalState.ts"],"names":[],"mappings":";;;AAWA,oDAAwD;AAGxD,qDAe0B;AAE1B,6CAAyC;AAIzC,uEAAsE;AAqCtE;IAME,oBAAY,EAKqB;YAJ/B,gBAAK,EACL,kBAAM,EACN,wBAAS,EACT,oCAAe;QAEf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;QAED,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CA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YAAY,EAAE;gBACtB,OAAO,KAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;aACxE;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAzYD,IAyYC;AAzYY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.d.ts b/node_modules/apollo-client/core/ObservableQuery.d.ts new file mode 100644 index 000000000..1b1194b5a --- /dev/null +++ b/node_modules/apollo-client/core/ObservableQuery.d.ts @@ -0,0 +1,75 @@ +import { GraphQLError } from 'graphql'; +import { NetworkStatus } from './networkStatus'; +import { Observable } from '../util/Observable'; +import { ApolloError } from '../errors/ApolloError'; +import { QueryManager } from './QueryManager'; +import { ApolloQueryResult, OperationVariables } from './types'; +import { WatchQueryOptions, FetchMoreQueryOptions, SubscribeToMoreOptions, ErrorPolicy } from './watchQueryOptions'; +import { QueryStoreValue } from '../data/queries'; +export declare type ApolloCurrentResult = { + data: T | {}; + errors?: ReadonlyArray; + loading: boolean; + networkStatus: NetworkStatus; + error?: ApolloError; + partial?: boolean; +}; +export declare type ApolloCurrentQueryResult = { + data: T | undefined; + errors?: ReadonlyArray; + loading: boolean; + networkStatus: NetworkStatus; + error?: ApolloError; + partial?: boolean; + stale?: boolean; +}; +export interface FetchMoreOptions { + updateQuery: (previousQueryResult: TData, options: { + fetchMoreResult?: TData; + variables?: TVariables; + }) => TData; +} +export interface UpdateQueryOptions { + variables?: TVariables; +} +export declare const hasError: (storeValue: QueryStoreValue, policy?: ErrorPolicy) => boolean | Error; +export declare class ObservableQuery extends Observable> { + options: WatchQueryOptions; + readonly queryId: string; + readonly queryName?: string; + variables: TVariables; + private shouldSubscribe; + private isTornDown; + private queryManager; + private observers; + private subscriptions; + private lastResult; + private lastResultSnapshot; + private lastError; + constructor({ queryManager, options, shouldSubscribe, }: { + queryManager: QueryManager; + options: WatchQueryOptions; + shouldSubscribe?: boolean; + }); + result(): Promise>; + currentResult(): ApolloCurrentResult; + getCurrentResult(): ApolloCurrentQueryResult; + isDifferentFromLastResult(newResult: ApolloQueryResult): boolean; + getLastResult(): ApolloQueryResult; + getLastError(): ApolloError; + resetLastResults(): void; + resetQueryStoreErrors(): void; + refetch(variables?: TVariables): Promise>; + fetchMore(fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions): Promise>; + subscribeToMore(options: SubscribeToMoreOptions): () => void; + setOptions(opts: WatchQueryOptions): Promise | void>; + setVariables(variables: TVariables, tryFetch?: boolean, fetchResults?: boolean): Promise | void>; + updateQuery(mapFn: (previousQueryResult: TData, options: UpdateQueryOptions) => TData): void; + stopPolling(): void; + startPolling(pollInterval: number): void; + private updateLastResult; + private onSubscribe; + private setUpQuery; + private tearDownQuery; +} +//# sourceMappingURL=ObservableQuery.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.d.ts.map b/node_modules/apollo-client/core/ObservableQuery.d.ts.map new file mode 100644 index 000000000..fdf2a6e8d --- /dev/null +++ b/node_modules/apollo-client/core/ObservableQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ObservableQuery.d.ts","sourceRoot":"","sources":["../src/core/ObservableQuery.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAA4B,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAA0B,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAa,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MA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,EACtB,iBAAiB,CAClB;IAwCI,UAAU,CACf,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAuDpC,YAAY,CACjB,SAAS,EAAE,UAAU,EACrB,QAAQ,GAAE,OAAe,EACzB,YAAY,UAAO,GAClB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IA6BpC,WAAW,CAAC,KAAK,GAAG,UAAU,EACnC,KAAK,EAAE,CACL,mBAAmB,EAAE,KAAK,EAC1B,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAC/B,KAAK,GACT,IAAI;IAwBA,WAAW;IAKX,YAAY,CAAC,YAAY,EAAE,MAAM;IAMxC,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,UAAU;IAwDlB,OAAO,CAAC,aAAa;CAetB"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.js b/node_modules/apollo-client/core/ObservableQuery.js new file mode 100644 index 000000000..d4e891d4b --- /dev/null +++ b/node_modules/apollo-client/core/ObservableQuery.js @@ -0,0 +1,366 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_utilities_1 = require("apollo-utilities"); +var networkStatus_1 = require("./networkStatus"); +var Observable_1 = require("../util/Observable"); +var ApolloError_1 = require("../errors/ApolloError"); +var types_1 = require("./types"); +var ts_invariant_1 = require("ts-invariant"); +var arrays_1 = require("../util/arrays"); +exports.hasError = function (storeValue, policy) { + if (policy === void 0) { policy = 'none'; } + return storeValue && (storeValue.networkError || + (policy === 'none' && arrays_1.isNonEmptyArray(storeValue.graphQLErrors))); +}; +var ObservableQuery = (function (_super) { + tslib_1.__extends(ObservableQuery, _super); + function ObservableQuery(_a) { + var queryManager = _a.queryManager, options = _a.options, _b = _a.shouldSubscribe, shouldSubscribe = _b === void 0 ? true : _b; + var _this = _super.call(this, function (observer) { + return _this.onSubscribe(observer); + }) || this; + _this.observers = new Set(); + _this.subscriptions = new Set(); + _this.isTornDown = false; + _this.options = options; + _this.variables = options.variables || {}; + _this.queryId = queryManager.generateQueryId(); + _this.shouldSubscribe = shouldSubscribe; + var opDef = apollo_utilities_1.getOperationDefinition(options.query); + _this.queryName = opDef && opDef.name && opDef.name.value; + _this.queryManager = queryManager; + return _this; + } + ObservableQuery.prototype.result = function () { + var _this = this; + return new Promise(function (resolve, reject) { + var observer = { + next: function (result) { + resolve(result); + _this.observers.delete(observer); + if (!_this.observers.size) { + _this.queryManager.removeQuery(_this.queryId); + } + setTimeout(function () { + subscription.unsubscribe(); + }, 0); + }, + error: reject, + }; + var subscription = _this.subscribe(observer); + }); + }; + ObservableQuery.prototype.currentResult = function () { + var result = this.getCurrentResult(); + if (result.data === undefined) { + result.data = {}; + } + return result; + }; + ObservableQuery.prototype.getCurrentResult = function () { + if (this.isTornDown) { + var lastResult = this.lastResult; + return { + data: !this.lastError && lastResult && lastResult.data || void 0, + error: this.lastError, + loading: false, + networkStatus: networkStatus_1.NetworkStatus.error, + }; + } + var _a = this.queryManager.getCurrentQueryResult(this), data = _a.data, partial = _a.partial; + var queryStoreValue = this.queryManager.queryStore.get(this.queryId); + var result; + var fetchPolicy = this.options.fetchPolicy; + var isNetworkFetchPolicy = fetchPolicy === 'network-only' || + fetchPolicy === 'no-cache'; + if (queryStoreValue) { + var networkStatus = queryStoreValue.networkStatus; + if (exports.hasError(queryStoreValue, this.options.errorPolicy)) { + return { + data: void 0, + loading: false, + networkStatus: networkStatus, + error: new ApolloError_1.ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError, + }), + }; + } + if (queryStoreValue.variables) { + this.options.variables = tslib_1.__assign({}, this.options.variables, queryStoreValue.variables); + this.variables = this.options.variables; + } + result = { + data: data, + loading: networkStatus_1.isNetworkRequestInFlight(networkStatus), + networkStatus: networkStatus, + }; + if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { + result.errors = queryStoreValue.graphQLErrors; + } + } + else { + var loading = isNetworkFetchPolicy || + (partial && fetchPolicy !== 'cache-only'); + result = { + data: data, + loading: loading, + networkStatus: loading ? networkStatus_1.NetworkStatus.loading : networkStatus_1.NetworkStatus.ready, + }; + } + if (!partial) { + this.updateLastResult(tslib_1.__assign({}, result, { stale: false })); + } + return tslib_1.__assign({}, result, { partial: partial }); + }; + ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { + var snapshot = this.lastResultSnapshot; + return !(snapshot && + newResult && + snapshot.networkStatus === newResult.networkStatus && + snapshot.stale === newResult.stale && + apollo_utilities_1.isEqual(snapshot.data, newResult.data)); + }; + ObservableQuery.prototype.getLastResult = function () { + return this.lastResult; + }; + ObservableQuery.prototype.getLastError = function () { + return this.lastError; + }; + ObservableQuery.prototype.resetLastResults = function () { + delete this.lastResult; + delete this.lastResultSnapshot; + delete this.lastError; + this.isTornDown = false; + }; + ObservableQuery.prototype.resetQueryStoreErrors = function () { + var queryStore = this.queryManager.queryStore.get(this.queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + }; + ObservableQuery.prototype.refetch = function (variables) { + var fetchPolicy = this.options.fetchPolicy; + if (fetchPolicy === 'cache-only') { + return Promise.reject(new ts_invariant_1.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); + } + if (fetchPolicy !== 'no-cache' && + fetchPolicy !== 'cache-and-network') { + fetchPolicy = 'network-only'; + } + if (!apollo_utilities_1.isEqual(this.variables, variables)) { + this.variables = tslib_1.__assign({}, this.variables, variables); + } + if (!apollo_utilities_1.isEqual(this.options.variables, this.variables)) { + this.options.variables = tslib_1.__assign({}, this.options.variables, this.variables); + } + return this.queryManager.fetchQuery(this.queryId, tslib_1.__assign({}, this.options, { fetchPolicy: fetchPolicy }), types_1.FetchType.refetch); + }; + ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { + var _this = this; + ts_invariant_1.invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); + var combinedOptions = tslib_1.__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : tslib_1.__assign({}, this.options, fetchMoreOptions, { variables: tslib_1.__assign({}, this.variables, fetchMoreOptions.variables) })), { fetchPolicy: 'network-only' }); + var qid = this.queryManager.generateQueryId(); + return this.queryManager + .fetchQuery(qid, combinedOptions, types_1.FetchType.normal, this.queryId) + .then(function (fetchMoreResult) { + _this.updateQuery(function (previousResult) { + return fetchMoreOptions.updateQuery(previousResult, { + fetchMoreResult: fetchMoreResult.data, + variables: combinedOptions.variables, + }); + }); + _this.queryManager.stopQuery(qid); + return fetchMoreResult; + }, function (error) { + _this.queryManager.stopQuery(qid); + throw error; + }); + }; + ObservableQuery.prototype.subscribeToMore = function (options) { + var _this = this; + var subscription = this.queryManager + .startGraphQLSubscription({ + query: options.document, + variables: options.variables, + }) + .subscribe({ + next: function (subscriptionData) { + var updateQuery = options.updateQuery; + if (updateQuery) { + _this.updateQuery(function (previous, _a) { + var variables = _a.variables; + return updateQuery(previous, { + subscriptionData: subscriptionData, + variables: variables, + }); + }); + } + }, + error: function (err) { + if (options.onError) { + options.onError(err); + return; + } + ts_invariant_1.invariant.error('Unhandled GraphQL subscription error', err); + }, + }); + this.subscriptions.add(subscription); + return function () { + if (_this.subscriptions.delete(subscription)) { + subscription.unsubscribe(); + } + }; + }; + ObservableQuery.prototype.setOptions = function (opts) { + var oldFetchPolicy = this.options.fetchPolicy; + this.options = tslib_1.__assign({}, this.options, opts); + if (opts.pollInterval) { + this.startPolling(opts.pollInterval); + } + else if (opts.pollInterval === 0) { + this.stopPolling(); + } + var fetchPolicy = opts.fetchPolicy; + return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || + oldFetchPolicy === 'standby' || + fetchPolicy === 'network-only'), opts.fetchResults); + }; + ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { + if (tryFetch === void 0) { tryFetch = false; } + if (fetchResults === void 0) { fetchResults = true; } + this.isTornDown = false; + variables = variables || this.variables; + if (!tryFetch && apollo_utilities_1.isEqual(variables, this.variables)) { + return this.observers.size && fetchResults + ? this.result() + : Promise.resolve(); + } + this.variables = this.options.variables = variables; + if (!this.observers.size) { + return Promise.resolve(); + } + return this.queryManager.fetchQuery(this.queryId, this.options); + }; + ObservableQuery.prototype.updateQuery = function (mapFn) { + var queryManager = this.queryManager; + var _a = queryManager.getQueryWithPreviousResult(this.queryId), previousResult = _a.previousResult, variables = _a.variables, document = _a.document; + var newResult = apollo_utilities_1.tryFunctionOrLogError(function () { + return mapFn(previousResult, { variables: variables }); + }); + if (newResult) { + queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); + queryManager.broadcastQueries(); + } + }; + ObservableQuery.prototype.stopPolling = function () { + this.queryManager.stopPollingQuery(this.queryId); + this.options.pollInterval = undefined; + }; + ObservableQuery.prototype.startPolling = function (pollInterval) { + assertNotCacheFirstOrOnly(this); + this.options.pollInterval = pollInterval; + this.queryManager.startPollingQuery(this.options, this.queryId); + }; + ObservableQuery.prototype.updateLastResult = function (newResult) { + var previousResult = this.lastResult; + this.lastResult = newResult; + this.lastResultSnapshot = this.queryManager.assumeImmutableResults + ? newResult + : apollo_utilities_1.cloneDeep(newResult); + return previousResult; + }; + ObservableQuery.prototype.onSubscribe = function (observer) { + var _this = this; + try { + var subObserver = observer._subscription._observer; + if (subObserver && !subObserver.error) { + subObserver.error = defaultSubscriptionObserverErrorCallback; + } + } + catch (_a) { } + var first = !this.observers.size; + this.observers.add(observer); + if (observer.next && this.lastResult) + observer.next(this.lastResult); + if (observer.error && this.lastError) + observer.error(this.lastError); + if (first) { + this.setUpQuery(); + } + return function () { + if (_this.observers.delete(observer) && !_this.observers.size) { + _this.tearDownQuery(); + } + }; + }; + ObservableQuery.prototype.setUpQuery = function () { + var _this = this; + var _a = this, queryManager = _a.queryManager, queryId = _a.queryId; + if (this.shouldSubscribe) { + queryManager.addObservableQuery(queryId, this); + } + if (this.options.pollInterval) { + assertNotCacheFirstOrOnly(this); + queryManager.startPollingQuery(this.options, queryId); + } + var onError = function (error) { + iterateObserversSafely(_this.observers, 'error', _this.lastError = error); + }; + queryManager.observeQuery(queryId, this.options, { + next: function (result) { + if (_this.lastError || _this.isDifferentFromLastResult(result)) { + var previousResult_1 = _this.updateLastResult(result); + var _a = _this.options, query_1 = _a.query, variables = _a.variables, fetchPolicy_1 = _a.fetchPolicy; + if (queryManager.transform(query_1).hasClientExports) { + queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { + var previousVariables = _this.variables; + _this.variables = _this.options.variables = variables; + if (!result.loading && + previousResult_1 && + fetchPolicy_1 !== 'cache-only' && + queryManager.transform(query_1).serverQuery && + !apollo_utilities_1.isEqual(previousVariables, variables)) { + _this.refetch(); + } + else { + iterateObserversSafely(_this.observers, 'next', result); + } + }); + } + else { + iterateObserversSafely(_this.observers, 'next', result); + } + } + }, + error: onError, + }).catch(onError); + }; + ObservableQuery.prototype.tearDownQuery = function () { + var queryManager = this.queryManager; + this.isTornDown = true; + queryManager.stopPollingQuery(this.queryId); + this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); }); + this.subscriptions.clear(); + queryManager.removeObservableQuery(this.queryId); + queryManager.stopQuery(this.queryId); + this.observers.clear(); + }; + return ObservableQuery; +}(Observable_1.Observable)); +exports.ObservableQuery = ObservableQuery; +function defaultSubscriptionObserverErrorCallback(error) { + ts_invariant_1.invariant.error('Unhandled error', error.message, error.stack); +} +function iterateObserversSafely(observers, method, argument) { + var observersWithMethod = []; + observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); }); + observersWithMethod.forEach(function (obs) { return obs[method](argument); }); +} +function assertNotCacheFirstOrOnly(obsQuery) { + var fetchPolicy = obsQuery.options.fetchPolicy; + ts_invariant_1.invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); +} +//# sourceMappingURL=ObservableQuery.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.js.map b/node_modules/apollo-client/core/ObservableQuery.js.map new file mode 100644 index 000000000..3f685ba0e --- /dev/null +++ b/node_modules/apollo-client/core/ObservableQuery.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ObservableQuery.js","sourceRoot":"","sources":["../../src/core/ObservableQuery.ts"],"names":[],"mappings":";;;AAAA,qDAK0B;AAE1B,iDAA0E;AAC1E,iDAAwE;AACxE,qDAAoD;AAEpD,iCAA2E;AAU3E,6CAAyD;AACzD,yCAAiD;AAwCpC,QAAA,QAAQ,GAAG,UACtB,UAA2B,EAC3B,MAA4B;IAA5B,uBAAA,EAAA,eAA4B;IACzB,OAAA,UAAU,IAAI,CACjB,UAAU,CAAC,YAAY;QACvB,CAAC,MAAM,KAAK,MAAM,IAAI,wBAAe,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CACjE;AAHI,CAGJ,CAAC;AAEF;IAGU,2CAAoC;IAoB5C,yBAAY,EAQX;YAPC,8BAAY,EACZ,oBAAO,EACP,uBAAsB,EAAtB,2CAAsB;QAHxB,YASE,kBAAM,UAAC,QAA4C;YACjD,OAAA,KAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QAA1B,CAA0B,CAC3B,SAgBF;QAlCO,eAAS,GAAG,IAAI,GAAG,EAAsC,CAAC;QAC1D,mBAAa,GAAG,IAAI,GAAG,EAAgB,CAAC;QAoB9C,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAGxB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAK,EAAiB,CAAC;QACzD,KAAI,CAAC,OAAO,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC;QAC9C,KAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAEvC,IAAM,KAAK,GAAG,yCAAsB,CAAC,OAAO,CAAC,KAAK,C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AAE,CAAC;IAC9C,SAAS,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,MAAM,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAA5C,CAA4C,CAAC,CAAC;IACvE,mBAAmB,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAC,GAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAA9B,CAA8B,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,yBAAyB,CAChC,QAA4C;IAEpC,IAAA,0CAAW,CAAsB;IACzC,wBAAS,CACP,WAAW,KAAK,aAAa,IAAI,WAAW,KAAK,YAAY,EAC7D,mGAAmG,CACpG,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.d.ts b/node_modules/apollo-client/core/QueryManager.d.ts new file mode 100644 index 000000000..6a4a36d54 --- /dev/null +++ b/node_modules/apollo-client/core/QueryManager.d.ts @@ -0,0 +1,102 @@ +import { ApolloLink, FetchResult } from 'apollo-link'; +import { DocumentNode } from 'graphql'; +import { Cache } from 'apollo-cache'; +import { Observer, Subscription, Observable } from '../util/Observable'; +import { DataStore } from '../data/store'; +import { MutationStore } from '../data/mutations'; +import { QueryStore } from '../data/queries'; +import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } from './watchQueryOptions'; +import { ObservableQuery } from './ObservableQuery'; +import { QueryListener, ApolloQueryResult, FetchType, OperationVariables } from './types'; +import { LocalState } from './LocalState'; +export interface QueryInfo { + listeners: Set; + invalidated: boolean; + newData: Cache.DiffResult | null; + document: DocumentNode | null; + lastRequestId: number; + observableQuery: ObservableQuery | null; + subscriptions: Set; + cancel?: () => void; +} +export declare class QueryManager { + link: ApolloLink; + mutationStore: MutationStore; + queryStore: QueryStore; + dataStore: DataStore; + readonly assumeImmutableResults: boolean; + private queryDeduplication; + private clientAwareness; + private localState; + private onBroadcast; + private ssrMode; + private idCounter; + private queries; + private fetchQueryRejectFns; + constructor({ link, queryDeduplication, store, onBroadcast, ssrMode, clientAwareness, localState, assumeImmutableResults, }: { + link: ApolloLink; + queryDeduplication?: boolean; + store: DataStore; + onBroadcast?: () => void; + ssrMode?: boolean; + clientAwareness?: Record; + localState?: LocalState; + assumeImmutableResults?: boolean; + }); + stop(): void; + mutate({ mutation, variables, optimisticResponse, updateQueries: updateQueriesByName, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, errorPolicy, fetchPolicy, context, }: MutationOptions): Promise>; + fetchQuery(queryId: string, options: WatchQueryOptions, fetchType?: FetchType, fetchMoreForQueryId?: string): Promise>; + private markQueryResult; + queryListenerForObserver(queryId: string, options: WatchQueryOptions, observer: Observer>): QueryListener; + private transformCache; + transform(document: DocumentNode): Readonly<{ + document: Readonly; + hasClientExports: boolean; + hasForcedResolvers: boolean; + clientQuery: Readonly | null; + serverQuery: Readonly | null; + defaultVars: Readonly; + }>; + private getVariables; + watchQuery(options: WatchQueryOptions, shouldSubscribe?: boolean): ObservableQuery; + query(options: QueryOptions): Promise>; + generateQueryId(): string; + stopQueryInStore(queryId: string): void; + private stopQueryInStoreNoBroadcast; + addQueryListener(queryId: string, listener: QueryListener): void; + updateQueryWatch(queryId: string, document: DocumentNode, options: WatchQueryOptions): () => void; + addObservableQuery(queryId: string, observableQuery: ObservableQuery): void; + removeObservableQuery(queryId: string): void; + clearStore(): Promise; + resetStore(): Promise[]>; + reFetchObservableQueries(includeStandby?: boolean): Promise[]>; + observeQuery(queryId: string, options: WatchQueryOptions, observer: Observer>): Promise, Record>>; + startQuery(queryId: string, options: WatchQueryOptions, listener: QueryListener): string; + startGraphQLSubscription({ query, fetchPolicy, variables, }: SubscriptionOptions): Observable>; + stopQuery(queryId: string): void; + private stopQueryNoBroadcast; + removeQuery(queryId: string): void; + getCurrentQueryResult(observableQuery: ObservableQuery, optimistic?: boolean): { + data: T | undefined; + partial: boolean; + }; + getQueryWithPreviousResult(queryIdOrObservable: string | ObservableQuery): { + previousResult: any; + variables: TVariables | undefined; + document: DocumentNode; + }; + broadcastQueries(): void; + getLocalState(): LocalState; + private inFlightLinkObservables; + private getObservableFromLink; + private fetchRequest; + private getQuery; + private setQuery; + private invalidate; + private prepareContext; + checkInFlight(queryId: string): boolean; + private pollingInfoByQueryId; + startPollingQuery(options: WatchQueryOptions, queryId: string, listener?: QueryListener): string; + stopPollingQuery(queryId: string): void; +} +//# sourceMappingURL=QueryManager.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.d.ts.map b/node_modules/apollo-client/core/QueryManager.d.ts.map new file mode 100644 index 000000000..a99a7f397 --- /dev/null +++ b/node_modules/apollo-client/core/QueryManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"QueryManager.d.ts","sourceRoot":"","sources":["../src/core/QueryManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAmB,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAerC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAoB,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,GAAG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,CAAC;QACpB,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC;QAClC,QAAQ,EAAE,YAAY,CAAC;KACxB;IAuBM,gBAAgB;IAehB,aAAa,IAAI,UAAU,CAAC,MAAM,CAAC;IAI1C,OAAO,CAAC,uBAAuB,CAG3B;IAEJ,OAAO,CAAC,qBAAqB;IA8E7B,OAAO,CAAC,YAAY;IA0GpB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,cAAc;IAQf,aAAa,CAAC,OAAO,EAAE,MAAM;IAWpC,OAAO,CAAC,oBAAoB,CAIvB;IAEE,iBAAiB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,GACvB,MAAM;IAqDF,gBAAgB,CAAC,OAAO,EAAE,MAAM;CAGxC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.js b/node_modules/apollo-client/core/QueryManager.js new file mode 100644 index 000000000..d4f0694b2 --- /dev/null +++ b/node_modules/apollo-client/core/QueryManager.js @@ -0,0 +1,867 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +var apollo_utilities_1 = require("apollo-utilities"); +var ts_invariant_1 = require("ts-invariant"); +var ApolloError_1 = require("../errors/ApolloError"); +var Observable_1 = require("../util/Observable"); +var mutations_1 = require("../data/mutations"); +var queries_1 = require("../data/queries"); +var ObservableQuery_1 = require("./ObservableQuery"); +var networkStatus_1 = require("./networkStatus"); +var types_1 = require("./types"); +var LocalState_1 = require("./LocalState"); +var observables_1 = require("../util/observables"); +var arrays_1 = require("../util/arrays"); +var hasOwnProperty = Object.prototype.hasOwnProperty; +var QueryManager = (function () { + function QueryManager(_a) { + var link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, store = _a.store, _c = _a.onBroadcast, onBroadcast = _c === void 0 ? function () { return undefined; } : _c, _d = _a.ssrMode, ssrMode = _d === void 0 ? false : _d, _e = _a.clientAwareness, clientAwareness = _e === void 0 ? {} : _e, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults; + this.mutationStore = new mutations_1.MutationStore(); + this.queryStore = new queries_1.QueryStore(); + this.clientAwareness = {}; + this.idCounter = 1; + this.queries = new Map(); + this.fetchQueryRejectFns = new Map(); + this.transformCache = new (apollo_utilities_1.canUseWeakMap ? WeakMap : Map)(); + this.inFlightLinkObservables = new Map(); + this.pollingInfoByQueryId = new Map(); + this.link = link; + this.queryDeduplication = queryDeduplication; + this.dataStore = store; + this.onBroadcast = onBroadcast; + this.clientAwareness = clientAwareness; + this.localState = localState || new LocalState_1.LocalState({ cache: store.getCache() }); + this.ssrMode = ssrMode; + this.assumeImmutableResults = !!assumeImmutableResults; + } + QueryManager.prototype.stop = function () { + var _this = this; + this.queries.forEach(function (_info, queryId) { + _this.stopQueryNoBroadcast(queryId); + }); + this.fetchQueryRejectFns.forEach(function (reject) { + reject(new ts_invariant_1.InvariantError('QueryManager stopped while query was in flight')); + }); + }; + QueryManager.prototype.mutate = function (_a) { + var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueriesByName = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e; + return tslib_1.__awaiter(this, void 0, void 0, function () { + var mutationId, generateUpdateQueriesInfo, self; + var _this = this; + return tslib_1.__generator(this, function (_f) { + switch (_f.label) { + case 0: + ts_invariant_1.invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); + ts_invariant_1.invariant(!fetchPolicy || fetchPolicy === 'no-cache', "fetchPolicy for mutations currently only supports the 'no-cache' policy"); + mutationId = this.generateQueryId(); + mutation = this.transform(mutation).document; + this.setQuery(mutationId, function () { return ({ document: mutation }); }); + variables = this.getVariables(mutation, variables); + if (!this.transform(mutation).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(mutation, variables, context)]; + case 1: + variables = _f.sent(); + _f.label = 2; + case 2: + generateUpdateQueriesInfo = function () { + var ret = {}; + if (updateQueriesByName) { + _this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) { + var queryName = observableQuery.queryName; + if (queryName && + hasOwnProperty.call(updateQueriesByName, queryName)) { + ret[queryId] = { + updater: updateQueriesByName[queryName], + query: _this.queryStore.get(queryId), + }; + } + } + }); + } + return ret; + }; + this.mutationStore.initMutation(mutationId, mutation, variables); + this.dataStore.markMutationInit({ + mutationId: mutationId, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + optimisticResponse: optimisticResponse, + }); + this.broadcastQueries(); + self = this; + return [2, new Promise(function (resolve, reject) { + var storeResult; + var error; + self.getObservableFromLink(mutation, tslib_1.__assign({}, context, { optimisticResponse: optimisticResponse }), variables, false).subscribe({ + next: function (result) { + if (apollo_utilities_1.graphQLResultHasError(result) && errorPolicy === 'none') { + error = new ApolloError_1.ApolloError({ + graphQLErrors: result.errors, + }); + return; + } + self.mutationStore.markMutationResult(mutationId); + if (fetchPolicy !== 'no-cache') { + self.dataStore.markMutationResult({ + mutationId: mutationId, + result: result, + document: mutation, + variables: variables, + updateQueries: generateUpdateQueriesInfo(), + update: updateWithProxyFn, + }); + } + storeResult = result; + }, + error: function (err) { + self.mutationStore.markMutationError(mutationId, err); + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse, + }); + self.broadcastQueries(); + self.setQuery(mutationId, function () { return ({ document: null }); }); + reject(new ApolloError_1.ApolloError({ + networkError: err, + })); + }, + complete: function () { + if (error) { + self.mutationStore.markMutationError(mutationId, error); + } + self.dataStore.markMutationComplete({ + mutationId: mutationId, + optimisticResponse: optimisticResponse, + }); + self.broadcastQueries(); + if (error) { + reject(error); + return; + } + if (typeof refetchQueries === 'function') { + refetchQueries = refetchQueries(storeResult); + } + var refetchQueryPromises = []; + if (arrays_1.isNonEmptyArray(refetchQueries)) { + refetchQueries.forEach(function (refetchQuery) { + if (typeof refetchQuery === 'string') { + self.queries.forEach(function (_a) { + var observableQuery = _a.observableQuery; + if (observableQuery && + observableQuery.queryName === refetchQuery) { + refetchQueryPromises.push(observableQuery.refetch()); + } + }); + } + else { + var queryOptions = { + query: refetchQuery.query, + variables: refetchQuery.variables, + fetchPolicy: 'network-only', + }; + if (refetchQuery.context) { + queryOptions.context = refetchQuery.context; + } + refetchQueryPromises.push(self.query(queryOptions)); + } + }); + } + Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { + self.setQuery(mutationId, function () { return ({ document: null }); }); + if (errorPolicy === 'ignore' && + storeResult && + apollo_utilities_1.graphQLResultHasError(storeResult)) { + delete storeResult.errors; + } + resolve(storeResult); + }); + }, + }); + })]; + } + }); + }); + }; + QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; + var _this = this; + return tslib_1.__generator(this, function (_e) { + switch (_e.label) { + case 0: + _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; + query = this.transform(options.query).document; + variables = this.getVariables(query, options.variables); + if (!this.transform(query).hasClientExports) return [3, 2]; + return [4, this.localState.addExportedVariables(query, variables, context)]; + case 1: + variables = _e.sent(); + _e.label = 2; + case 2: + options = tslib_1.__assign({}, options, { variables: variables }); + isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; + needToFetch = isNetworkOnly; + if (!isNetworkOnly) { + _d = this.dataStore.getCache().diff({ + query: query, + variables: variables, + returnPartialData: true, + optimistic: false, + }), complete = _d.complete, result = _d.result; + needToFetch = !complete || fetchPolicy === 'cache-and-network'; + storeResult = result; + } + shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; + if (apollo_utilities_1.hasDirectives(['live'], query)) + shouldFetch = true; + requestId = this.idCounter++; + cancel = fetchPolicy !== 'no-cache' + ? this.updateQueryWatch(queryId, query, options) + : undefined; + this.setQuery(queryId, function () { return ({ + document: query, + lastRequestId: requestId, + invalidated: true, + cancel: cancel, + }); }); + this.invalidate(fetchMoreForQueryId); + this.queryStore.initQuery({ + queryId: queryId, + document: query, + storePreviousVariables: shouldFetch, + variables: variables, + isPoll: fetchType === types_1.FetchType.poll, + isRefetch: fetchType === types_1.FetchType.refetch, + metadata: metadata, + fetchMoreForQueryId: fetchMoreForQueryId, + }); + this.broadcastQueries(); + if (shouldFetch) { + networkResult = this.fetchRequest({ + requestId: requestId, + queryId: queryId, + document: query, + options: options, + fetchMoreForQueryId: fetchMoreForQueryId, + }).catch(function (error) { + if (ApolloError_1.isApolloError(error)) { + throw error; + } + else { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); + _this.invalidate(queryId); + _this.invalidate(fetchMoreForQueryId); + _this.broadcastQueries(); + } + throw new ApolloError_1.ApolloError({ networkError: error }); + } + }); + if (fetchPolicy !== 'cache-and-network') { + return [2, networkResult]; + } + networkResult.catch(function () { }); + } + this.queryStore.markQueryResultClient(queryId, !shouldFetch); + this.invalidate(queryId); + this.invalidate(fetchMoreForQueryId); + if (this.transform(query).hasForcedResolvers) { + return [2, this.localState.runResolvers({ + document: query, + remoteResult: { data: storeResult }, + context: context, + variables: variables, + onlyRunForcedResolvers: true, + }).then(function (result) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + _this.broadcastQueries(); + return result; + })]; + } + this.broadcastQueries(); + return [2, { data: storeResult }]; + } + }); + }); + }; + QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { + var fetchPolicy = _a.fetchPolicy, variables = _a.variables, errorPolicy = _a.errorPolicy; + if (fetchPolicy === 'no-cache') { + this.setQuery(queryId, function () { return ({ + newData: { result: result.data, complete: true }, + }); }); + } + else { + this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); + } + }; + QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { + var _this = this; + function invoke(method, argument) { + if (observer[method]) { + try { + observer[method](argument); + } + catch (e) { + ts_invariant_1.invariant.error(e); + } + } + else if (method === 'error') { + ts_invariant_1.invariant.error(argument); + } + } + return function (queryStoreValue, newData) { + _this.invalidate(queryId, false); + if (!queryStoreValue) + return; + var _a = _this.getQuery(queryId), observableQuery = _a.observableQuery, document = _a.document; + var fetchPolicy = observableQuery + ? observableQuery.options.fetchPolicy + : options.fetchPolicy; + if (fetchPolicy === 'standby') + return; + var loading = networkStatus_1.isNetworkRequestInFlight(queryStoreValue.networkStatus); + var lastResult = observableQuery && observableQuery.getLastResult(); + var networkStatusChanged = !!(lastResult && + lastResult.networkStatus !== queryStoreValue.networkStatus); + var shouldNotifyIfLoading = options.returnPartialData || + (!newData && queryStoreValue.previousVariables) || + (networkStatusChanged && options.notifyOnNetworkStatusChange) || + fetchPolicy === 'cache-only' || + fetchPolicy === 'cache-and-network'; + if (loading && !shouldNotifyIfLoading) { + return; + } + var hasGraphQLErrors = arrays_1.isNonEmptyArray(queryStoreValue.graphQLErrors); + var errorPolicy = observableQuery + && observableQuery.options.errorPolicy + || options.errorPolicy + || 'none'; + if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { + return invoke('error', new ApolloError_1.ApolloError({ + graphQLErrors: queryStoreValue.graphQLErrors, + networkError: queryStoreValue.networkError, + })); + } + try { + var data = void 0; + var isMissing = void 0; + if (newData) { + if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { + _this.setQuery(queryId, function () { return ({ newData: null }); }); + } + data = newData.result; + isMissing = !newData.complete; + } + else { + var lastError = observableQuery && observableQuery.getLastError(); + var errorStatusChanged = errorPolicy !== 'none' && + (lastError && lastError.graphQLErrors) !== + queryStoreValue.graphQLErrors; + if (lastResult && lastResult.data && !errorStatusChanged) { + data = lastResult.data; + isMissing = false; + } + else { + var diffResult = _this.dataStore.getCache().diff({ + query: document, + variables: queryStoreValue.previousVariables || + queryStoreValue.variables, + returnPartialData: true, + optimistic: true, + }); + data = diffResult.result; + isMissing = !diffResult.complete; + } + } + var stale = isMissing && !(options.returnPartialData || + fetchPolicy === 'cache-only'); + var resultFromStore = { + data: stale ? lastResult && lastResult.data : data, + loading: loading, + networkStatus: queryStoreValue.networkStatus, + stale: stale, + }; + if (errorPolicy === 'all' && hasGraphQLErrors) { + resultFromStore.errors = queryStoreValue.graphQLErrors; + } + invoke('next', resultFromStore); + } + catch (networkError) { + invoke('error', new ApolloError_1.ApolloError({ networkError: networkError })); + } + }; + }; + QueryManager.prototype.transform = function (document) { + var transformCache = this.transformCache; + if (!transformCache.has(document)) { + var cache = this.dataStore.getCache(); + var transformed = cache.transformDocument(document); + var forLink = apollo_utilities_1.removeConnectionDirectiveFromDocument(cache.transformForLink(transformed)); + var clientQuery = this.localState.clientQuery(transformed); + var serverQuery = this.localState.serverQuery(forLink); + var cacheEntry_1 = { + document: transformed, + hasClientExports: apollo_utilities_1.hasClientExports(transformed), + hasForcedResolvers: this.localState.shouldForceResolvers(transformed), + clientQuery: clientQuery, + serverQuery: serverQuery, + defaultVars: apollo_utilities_1.getDefaultValues(apollo_utilities_1.getOperationDefinition(transformed)), + }; + var add = function (doc) { + if (doc && !transformCache.has(doc)) { + transformCache.set(doc, cacheEntry_1); + } + }; + add(document); + add(transformed); + add(clientQuery); + add(serverQuery); + } + return transformCache.get(document); + }; + QueryManager.prototype.getVariables = function (document, variables) { + return tslib_1.__assign({}, this.transform(document).defaultVars, variables); + }; + QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { + if (shouldSubscribe === void 0) { shouldSubscribe = true; } + ts_invariant_1.invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); + options.variables = this.getVariables(options.query, options.variables); + if (typeof options.notifyOnNetworkStatusChange === 'undefined') { + options.notifyOnNetworkStatusChange = false; + } + var transformedOptions = tslib_1.__assign({}, options); + return new ObservableQuery_1.ObservableQuery({ + queryManager: this, + options: transformedOptions, + shouldSubscribe: shouldSubscribe, + }); + }; + QueryManager.prototype.query = function (options) { + var _this = this; + ts_invariant_1.invariant(options.query, 'query option is required. You must specify your GraphQL document ' + + 'in the query option.'); + ts_invariant_1.invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); + ts_invariant_1.invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); + ts_invariant_1.invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); + return new Promise(function (resolve, reject) { + var watchedQuery = _this.watchQuery(options, false); + _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); + watchedQuery + .result() + .then(resolve, reject) + .then(function () { + return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); + }); + }); + }; + QueryManager.prototype.generateQueryId = function () { + return String(this.idCounter++); + }; + QueryManager.prototype.stopQueryInStore = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.broadcastQueries(); + }; + QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { + this.stopPollingQuery(queryId); + this.queryStore.stopQuery(queryId); + this.invalidate(queryId); + }; + QueryManager.prototype.addQueryListener = function (queryId, listener) { + this.setQuery(queryId, function (_a) { + var listeners = _a.listeners; + listeners.add(listener); + return { invalidated: false }; + }); + }; + QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { + var _this = this; + var cancel = this.getQuery(queryId).cancel; + if (cancel) + cancel(); + var previousResult = function () { + var previousResult = null; + var observableQuery = _this.getQuery(queryId).observableQuery; + if (observableQuery) { + var lastResult = observableQuery.getLastResult(); + if (lastResult) { + previousResult = lastResult.data; + } + } + return previousResult; + }; + return this.dataStore.getCache().watch({ + query: document, + variables: options.variables, + optimistic: true, + previousResult: previousResult, + callback: function (newData) { + _this.setQuery(queryId, function () { return ({ invalidated: true, newData: newData }); }); + }, + }); + }; + QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { + this.setQuery(queryId, function () { return ({ observableQuery: observableQuery }); }); + }; + QueryManager.prototype.removeObservableQuery = function (queryId) { + var cancel = this.getQuery(queryId).cancel; + this.setQuery(queryId, function () { return ({ observableQuery: null }); }); + if (cancel) + cancel(); + }; + QueryManager.prototype.clearStore = function () { + this.fetchQueryRejectFns.forEach(function (reject) { + reject(new ts_invariant_1.InvariantError('Store reset while query was in flight (not completed in link chain)')); + }); + var resetIds = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) + resetIds.push(queryId); + }); + this.queryStore.reset(resetIds); + this.mutationStore.reset(); + return this.dataStore.reset(); + }; + QueryManager.prototype.resetStore = function () { + var _this = this; + return this.clearStore().then(function () { + return _this.reFetchObservableQueries(); + }); + }; + QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { + var _this = this; + if (includeStandby === void 0) { includeStandby = false; } + var observableQueryPromises = []; + this.queries.forEach(function (_a, queryId) { + var observableQuery = _a.observableQuery; + if (observableQuery) { + var fetchPolicy = observableQuery.options.fetchPolicy; + observableQuery.resetLastResults(); + if (fetchPolicy !== 'cache-only' && + (includeStandby || fetchPolicy !== 'standby')) { + observableQueryPromises.push(observableQuery.refetch()); + } + _this.setQuery(queryId, function () { return ({ newData: null }); }); + _this.invalidate(queryId); + } + }); + this.broadcastQueries(); + return Promise.all(observableQueryPromises); + }; + QueryManager.prototype.observeQuery = function (queryId, options, observer) { + this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); + return this.fetchQuery(queryId, options); + }; + QueryManager.prototype.startQuery = function (queryId, options, listener) { + ts_invariant_1.invariant.warn("The QueryManager.startQuery method has been deprecated"); + this.addQueryListener(queryId, listener); + this.fetchQuery(queryId, options) + .catch(function () { return undefined; }); + return queryId; + }; + QueryManager.prototype.startGraphQLSubscription = function (_a) { + var _this = this; + var query = _a.query, fetchPolicy = _a.fetchPolicy, variables = _a.variables; + query = this.transform(query).document; + variables = this.getVariables(query, variables); + var makeObservable = function (variables) { + return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { + if (!fetchPolicy || fetchPolicy !== 'no-cache') { + _this.dataStore.markSubscriptionResult(result, query, variables); + _this.broadcastQueries(); + } + if (apollo_utilities_1.graphQLResultHasError(result)) { + throw new ApolloError_1.ApolloError({ + graphQLErrors: result.errors, + }); + } + return result; + }); + }; + if (this.transform(query).hasClientExports) { + var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); + return new Observable_1.Observable(function (observer) { + var sub = null; + observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error); + return function () { return sub && sub.unsubscribe(); }; + }); + } + return makeObservable(variables); + }; + QueryManager.prototype.stopQuery = function (queryId) { + this.stopQueryNoBroadcast(queryId); + this.broadcastQueries(); + }; + QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { + this.stopQueryInStoreNoBroadcast(queryId); + this.removeQuery(queryId); + }; + QueryManager.prototype.removeQuery = function (queryId) { + this.fetchQueryRejectFns.delete("query:" + queryId); + this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); + this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); }); + this.queries.delete(queryId); + }; + QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { + if (optimistic === void 0) { optimistic = true; } + var _a = observableQuery.options, variables = _a.variables, query = _a.query, fetchPolicy = _a.fetchPolicy, returnPartialData = _a.returnPartialData; + var lastResult = observableQuery.getLastResult(); + var newData = this.getQuery(observableQuery.queryId).newData; + if (newData && newData.complete) { + return { data: newData.result, partial: false }; + } + if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { + return { data: undefined, partial: false }; + } + var _b = this.dataStore.getCache().diff({ + query: query, + variables: variables, + previousResult: lastResult ? lastResult.data : undefined, + returnPartialData: true, + optimistic: optimistic, + }), result = _b.result, complete = _b.complete; + return { + data: (complete || returnPartialData) ? result : void 0, + partial: !complete, + }; + }; + QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { + var observableQuery; + if (typeof queryIdOrObservable === 'string') { + var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; + ts_invariant_1.invariant(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); + observableQuery = foundObserveableQuery; + } + else { + observableQuery = queryIdOrObservable; + } + var _a = observableQuery.options, variables = _a.variables, query = _a.query; + return { + previousResult: this.getCurrentQueryResult(observableQuery, false).data, + variables: variables, + document: query, + }; + }; + QueryManager.prototype.broadcastQueries = function () { + var _this = this; + this.onBroadcast(); + this.queries.forEach(function (info, id) { + if (info.invalidated) { + info.listeners.forEach(function (listener) { + if (listener) { + listener(_this.queryStore.get(id), info.newData); + } + }); + } + }); + }; + QueryManager.prototype.getLocalState = function () { + return this.localState; + }; + QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { + var _this = this; + if (deduplication === void 0) { deduplication = this.queryDeduplication; } + var observable; + var serverQuery = this.transform(query).serverQuery; + if (serverQuery) { + var _a = this, inFlightLinkObservables_1 = _a.inFlightLinkObservables, link = _a.link; + var operation = { + query: serverQuery, + variables: variables, + operationName: apollo_utilities_1.getOperationName(serverQuery) || void 0, + context: this.prepareContext(tslib_1.__assign({}, context, { forceFetch: !deduplication })), + }; + context = operation.context; + if (deduplication) { + var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); + inFlightLinkObservables_1.set(serverQuery, byVariables_1); + var varJson_1 = JSON.stringify(variables); + observable = byVariables_1.get(varJson_1); + if (!observable) { + byVariables_1.set(varJson_1, observable = observables_1.multiplex(apollo_link_1.execute(link, operation))); + var cleanup = function () { + byVariables_1.delete(varJson_1); + if (!byVariables_1.size) + inFlightLinkObservables_1.delete(serverQuery); + cleanupSub_1.unsubscribe(); + }; + var cleanupSub_1 = observable.subscribe({ + next: cleanup, + error: cleanup, + complete: cleanup, + }); + } + } + else { + observable = observables_1.multiplex(apollo_link_1.execute(link, operation)); + } + } + else { + observable = Observable_1.Observable.of({ data: {} }); + context = this.prepareContext(context); + } + var clientQuery = this.transform(query).clientQuery; + if (clientQuery) { + observable = observables_1.asyncMap(observable, function (result) { + return _this.localState.runResolvers({ + document: clientQuery, + remoteResult: result, + context: context, + variables: variables, + }); + }); + } + return observable; + }; + QueryManager.prototype.fetchRequest = function (_a) { + var _this = this; + var requestId = _a.requestId, queryId = _a.queryId, document = _a.document, options = _a.options, fetchMoreForQueryId = _a.fetchMoreForQueryId; + var variables = options.variables, _b = options.errorPolicy, errorPolicy = _b === void 0 ? 'none' : _b, fetchPolicy = options.fetchPolicy; + var resultFromStore; + var errorsFromStore; + return new Promise(function (resolve, reject) { + var observable = _this.getObservableFromLink(document, options.context, variables); + var fqrfId = "fetchRequest:" + queryId; + _this.fetchQueryRejectFns.set(fqrfId, reject); + var cleanup = function () { + _this.fetchQueryRejectFns.delete(fqrfId); + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.delete(subscription); + }); + }; + var subscription = observable.map(function (result) { + if (requestId >= _this.getQuery(queryId).lastRequestId) { + _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); + _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); + _this.invalidate(queryId); + _this.invalidate(fetchMoreForQueryId); + _this.broadcastQueries(); + } + if (errorPolicy === 'none' && arrays_1.isNonEmptyArray(result.errors)) { + return reject(new ApolloError_1.ApolloError({ + graphQLErrors: result.errors, + })); + } + if (errorPolicy === 'all') { + errorsFromStore = result.errors; + } + if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { + resultFromStore = result.data; + } + else { + var _a = _this.dataStore.getCache().diff({ + variables: variables, + query: document, + optimistic: false, + returnPartialData: true, + }), result_1 = _a.result, complete = _a.complete; + if (complete || options.returnPartialData) { + resultFromStore = result_1; + } + } + }).subscribe({ + error: function (error) { + cleanup(); + reject(error); + }, + complete: function () { + cleanup(); + resolve({ + data: resultFromStore, + errors: errorsFromStore, + loading: false, + networkStatus: networkStatus_1.NetworkStatus.ready, + stale: false, + }); + }, + }); + _this.setQuery(queryId, function (_a) { + var subscriptions = _a.subscriptions; + subscriptions.add(subscription); + }); + }); + }; + QueryManager.prototype.getQuery = function (queryId) { + return (this.queries.get(queryId) || { + listeners: new Set(), + invalidated: false, + document: null, + newData: null, + lastRequestId: 1, + observableQuery: null, + subscriptions: new Set(), + }); + }; + QueryManager.prototype.setQuery = function (queryId, updater) { + var prev = this.getQuery(queryId); + var newInfo = tslib_1.__assign({}, prev, updater(prev)); + this.queries.set(queryId, newInfo); + }; + QueryManager.prototype.invalidate = function (queryId, invalidated) { + if (invalidated === void 0) { invalidated = true; } + if (queryId) { + this.setQuery(queryId, function () { return ({ invalidated: invalidated }); }); + } + }; + QueryManager.prototype.prepareContext = function (context) { + if (context === void 0) { context = {}; } + var newContext = this.localState.prepareContext(context); + return tslib_1.__assign({}, newContext, { clientAwareness: this.clientAwareness }); + }; + QueryManager.prototype.checkInFlight = function (queryId) { + var query = this.queryStore.get(queryId); + return (query && + query.networkStatus !== networkStatus_1.NetworkStatus.ready && + query.networkStatus !== networkStatus_1.NetworkStatus.error); + }; + QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { + var _this = this; + var pollInterval = options.pollInterval; + ts_invariant_1.invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); + if (!this.ssrMode) { + var info = this.pollingInfoByQueryId.get(queryId); + if (!info) { + this.pollingInfoByQueryId.set(queryId, (info = {})); + } + info.interval = pollInterval; + info.options = tslib_1.__assign({}, options, { fetchPolicy: 'network-only' }); + var maybeFetch_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + if (info) { + if (_this.checkInFlight(queryId)) { + poll_1(); + } + else { + _this.fetchQuery(queryId, info.options, types_1.FetchType.poll).then(poll_1, poll_1); + } + } + }; + var poll_1 = function () { + var info = _this.pollingInfoByQueryId.get(queryId); + if (info) { + clearTimeout(info.timeout); + info.timeout = setTimeout(maybeFetch_1, info.interval); + } + }; + if (listener) { + this.addQueryListener(queryId, listener); + } + poll_1(); + } + return queryId; + }; + QueryManager.prototype.stopPollingQuery = function (queryId) { + this.pollingInfoByQueryId.delete(queryId); + }; + return QueryManager; +}()); +exports.QueryManager = QueryManager; +//# sourceMappingURL=QueryManager.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.js.map b/node_modules/apollo-client/core/QueryManager.js.map new file mode 100644 index 000000000..da4949bbd --- /dev/null +++ b/node_modules/apollo-client/core/QueryManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"QueryManager.js","sourceRoot":"","sources":["../../src/core/QueryManager.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAG/D,qDAS0B;AAE1B,6CAAyD;AAEzD,qDAAmE;AACnE,iDAAwE;AAExE,+CAAkD;AAClD,2CAA8D;AAS9D,qDAAoD;AACpD,iDAA0E;AAC1E,iCAKiB;AACjB,2CAA0C;AAC1C,mDAA0D;AAC1D,yCAAiD;AAEzC,IAAA,gDAAc,CAAsB;AAgB5C;IA6BE,sBAAY,EAkBX;YAjBC,cAAI,EACJ,0BAA0B,EAA1B,+CAA0B,EAC1B,gBAAK,EACL,mBAA6B,EAA7B,oEAA6B,EAC7B,eAAe,EAAf,oCAAe,EACf,uBAAoB,EAApB,yCAAoB,EACpB,0BAAU,EACV,kDAAsB;QAnCjB,kBAAa,GAAkB,IAAI,yBAAa,EAAE,CAAC;QACnD,eAAU,GAAe,IAAI,oBAAU,EAAE,CAAC;QAKzC,oBAAe,GAA2B,EAAE,CAAC;QA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,CAAC;YAEF,IAAM,MAAI,GAAG;gBACX,IAAM,IAAI,GAAG,KAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACpD,IAAI,IAAI,EAAE;oBACR,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,YAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACtD;YACH,CAAC,CAAC;YAEF,IAAI,QAAQ,EAAE;gBACZ,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;aAC1C;YAED,MAAI,EAAE,CAAC;SACR;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,uCAAgB,GAAvB,UAAwB,OAAe;QACrC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IACH,mBAAC;AAAD,CAAC,AAt0CD,IAs0CC;AAt0CY,oCAAY"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.d.ts b/node_modules/apollo-client/core/networkStatus.d.ts new file mode 100644 index 000000000..630a906bd --- /dev/null +++ b/node_modules/apollo-client/core/networkStatus.d.ts @@ -0,0 +1,11 @@ +export declare enum NetworkStatus { + loading = 1, + setVariables = 2, + fetchMore = 3, + refetch = 4, + poll = 6, + ready = 7, + error = 8 +} +export declare function isNetworkRequestInFlight(networkStatus: NetworkStatus): boolean; +//# sourceMappingURL=networkStatus.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.d.ts.map b/node_modules/apollo-client/core/networkStatus.d.ts.map new file mode 100644 index 000000000..96239647c --- /dev/null +++ b/node_modules/apollo-client/core/networkStatus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"networkStatus.d.ts","sourceRoot":"","sources":["../src/core/networkStatus.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa;IAMvB,OAAO,IAAI;IAMX,YAAY,IAAI;IAMhB,SAAS,IAAI;IAMb,OAAO,IAAI;IAOX,IAAI,IAAI;IAKR,KAAK,IAAI;IAKT,KAAK,IAAI;CACV;AAMD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAET"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.js b/node_modules/apollo-client/core/networkStatus.js new file mode 100644 index 000000000..262f964c0 --- /dev/null +++ b/node_modules/apollo-client/core/networkStatus.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var NetworkStatus; +(function (NetworkStatus) { + NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; + NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; + NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; + NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; + NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; + NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; + NetworkStatus[NetworkStatus["error"] = 8] = "error"; +})(NetworkStatus = exports.NetworkStatus || (exports.NetworkStatus = {})); +function isNetworkRequestInFlight(networkStatus) { + return networkStatus < 7; +} +exports.isNetworkRequestInFlight = isNetworkRequestInFlight; +//# sourceMappingURL=networkStatus.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.js.map b/node_modules/apollo-client/core/networkStatus.js.map new file mode 100644 index 000000000..ebe2effc6 --- /dev/null +++ b/node_modules/apollo-client/core/networkStatus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"networkStatus.js","sourceRoot":"","sources":["../../src/core/networkStatus.ts"],"names":[],"mappings":";;AAGA,IAAY,aA0CX;AA1CD,WAAY,aAAa;IAMvB,uDAAW,CAAA;IAMX,iEAAgB,CAAA;IAMhB,2DAAa,CAAA;IAMb,uDAAW,CAAA;IAOX,iDAAQ,CAAA;IAKR,mDAAS,CAAA;IAKT,mDAAS,CAAA;AACX,CAAC,EA1CW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA0CxB;AAMD,SAAgB,wBAAwB,CACtC,aAA4B;IAE5B,OAAO,aAAa,GAAG,CAAC,CAAC;AAC3B,CAAC;AAJD,4DAIC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.d.ts b/node_modules/apollo-client/core/types.d.ts new file mode 100644 index 000000000..c0a7b1d20 --- /dev/null +++ b/node_modules/apollo-client/core/types.d.ts @@ -0,0 +1,43 @@ +import { FetchResult } from 'apollo-link'; +import { DocumentNode, GraphQLError } from 'graphql'; +import { QueryStoreValue } from '../data/queries'; +import { NetworkStatus } from './networkStatus'; +export declare type QueryListener = (queryStoreValue: QueryStoreValue, newData?: any, forceResolvers?: boolean) => void; +export declare type OperationVariables = { + [key: string]: any; +}; +export declare type PureQueryOptions = { + query: DocumentNode; + variables?: { + [key: string]: any; + }; + context?: any; +}; +export declare type ApolloQueryResult = { + data: T; + errors?: ReadonlyArray; + loading: boolean; + networkStatus: NetworkStatus; + stale: boolean; +}; +export declare enum FetchType { + normal = 1, + refetch = 2, + poll = 3 +} +export declare type MutationQueryReducer = (previousResult: Record, options: { + mutationResult: FetchResult; + queryName: string | undefined; + queryVariables: Record; +}) => Record; +export declare type MutationQueryReducersMap = { + [queryName: string]: MutationQueryReducer; +}; +export interface Resolvers { + [key: string]: { + [field: string]: (rootValue?: any, args?: any, context?: any, info?: any) => any; + }; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.d.ts.map b/node_modules/apollo-client/core/types.d.ts.map new file mode 100644 index 000000000..e5c1d098e --- /dev/null +++ b/node_modules/apollo-client/core/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EA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AAE,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,CAAC,KAAK,EAAE,MAAM,GAAG,CACf,SAAS,CAAC,EAAE,GAAG,EACf,IAAI,CAAC,EAAE,GAAG,EACV,OAAO,CAAC,EAAE,GAAG,EACb,IAAI,CAAC,EAAE,GAAG,KACP,GAAG,CAAC;KACV,CAAC;CACH"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.js b/node_modules/apollo-client/core/types.js new file mode 100644 index 000000000..a0437d7f6 --- /dev/null +++ b/node_modules/apollo-client/core/types.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var FetchType; +(function (FetchType) { + FetchType[FetchType["normal"] = 1] = "normal"; + FetchType[FetchType["refetch"] = 2] = "refetch"; + FetchType[FetchType["poll"] = 3] = "poll"; +})(FetchType = exports.FetchType || (exports.FetchType = {})); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.js.map b/node_modules/apollo-client/core/types.js.map new file mode 100644 index 000000000..778c93ddf --- /dev/null +++ b/node_modules/apollo-client/core/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;AA4BA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,+CAAW,CAAA;IACX,yCAAQ,CAAA;AACV,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.d.ts b/node_modules/apollo-client/core/watchQueryOptions.d.ts new file mode 100644 index 000000000..0a9bcd1da --- /dev/null +++ b/node_modules/apollo-client/core/watchQueryOptions.d.ts @@ -0,0 +1,71 @@ +import { DocumentNode, ExecutionResult } from 'graphql'; +import { FetchResult } from 'apollo-link'; +import { DataProxy } from 'apollo-cache'; +import { MutationQueryReducersMap } from './types'; +import { PureQueryOptions, OperationVariables } from './types'; +export declare type FetchPolicy = 'cache-first' | 'network-only' | 'cache-only' | 'no-cache' | 'standby'; +export declare type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'; +export declare type ErrorPolicy = 'none' | 'ignore' | 'all'; +export interface QueryBaseOptions { + query: DocumentNode; + variables?: TVariables; + errorPolicy?: ErrorPolicy; + fetchResults?: boolean; + metadata?: any; + context?: any; +} +export interface QueryOptions extends QueryBaseOptions { + fetchPolicy?: FetchPolicy; +} +export interface ModifiableWatchQueryOptions extends QueryBaseOptions { + pollInterval?: number; + notifyOnNetworkStatusChange?: boolean; + returnPartialData?: boolean; +} +export interface WatchQueryOptions extends QueryBaseOptions, ModifiableWatchQueryOptions { + fetchPolicy?: WatchQueryFetchPolicy; +} +export interface FetchMoreQueryOptions { + query?: DocumentNode; + variables?: Pick; +} +export declare type UpdateQueryFn = (previousQueryResult: TData, options: { + subscriptionData: { + data: TSubscriptionData; + }; + variables?: TSubscriptionVariables; +}) => TData; +export declare type SubscribeToMoreOptions = { + document: DocumentNode; + variables?: TSubscriptionVariables; + updateQuery?: UpdateQueryFn; + onError?: (error: Error) => void; +}; +export interface SubscriptionOptions { + query: DocumentNode; + variables?: TVariables; + fetchPolicy?: FetchPolicy; +} +export declare type RefetchQueryDescription = Array; +export interface MutationBaseOptions { + optimisticResponse?: T | ((vars: TVariables) => T); + updateQueries?: MutationQueryReducersMap; + refetchQueries?: ((result: ExecutionResult) => RefetchQueryDescription) | RefetchQueryDescription; + awaitRefetchQueries?: boolean; + update?: MutationUpdaterFn; + errorPolicy?: ErrorPolicy; + variables?: TVariables; +} +export interface MutationOptions extends MutationBaseOptions { + mutation: DocumentNode; + context?: any; + fetchPolicy?: FetchPolicy; +} +export declare type MutationUpdaterFn = (proxy: DataProxy, mutationResult: FetchResult) => void; +//# sourceMappingURL=watchQueryOptions.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.d.ts.map b/node_modules/apollo-client/core/watchQueryOptions.d.ts.map new file mode 100644 index 000000000..b3f7526cb --- /dev/null +++ b/node_modules/apollo-client/core/watchQueryOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"watchQueryOptions.d.ts","sourceRoot":"","sources":["../src/core/watchQueryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAW/D,oBAAY,WAAW,GACnB,aAAa,GACb,cAAc,GACd,YAAY,GACZ,UAAU,GACV,SAAS,CAAC;AAEd,oBAAY,qBAAqB,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAQtE,oBAAY,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAKpD,MAAM,WAAW,gBAAgB,CAAC,UAAU,GAAG,kBAAkB;IAO/D,KAAK,EAAE,YAAY,CAAC;IAMpB,SAAS,CAAC,EAAE,UAAU,CAAC;IAKvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAK1B,YAAY,CAAC,EAAE,OAAO,CAAC;IAMvB,QAAQ,CAAC,EAAE,GAAG,CAAC;IAKf,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAKD,MAAM,WAAW,YAAY,CAAC,UAAU,GAAG,kBAAkB,CAC3D,SAAQ,gBAAgB,CAAC,UAAU,CAAC;IAIpC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAKD,MAAM,WAAW,2BAA2B,CAAC,UAAU,GAAG,kBAAkB,CAC1E,SAAQ,gBAAgB,CAAC,UAAU,CAAC;IAKp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CAAC;CAC3B;AAED,oBAAY,uBAAuB,GAAG,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC;AAEvE,MAAM,WAAW,mBAAmB,CAClC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC1B,UAAU,GAAG,kBAAkB;IAS/B,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC;IAQnD,aAAa,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAU5C,cAAc,CAAC,EACX,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,uBAAuB,CAAC,GACzD,uBAAuB,CAAC;IAU5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAyB9B,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAK9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAM1B,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,eAAe,CAC9B,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC1B,UAAU,GAAG,kBAAkB,CAC/B,SAAQ,mBAAmB,CAAC,CAAC,EAAE,UAAU,CAAC;IAK1C,QAAQ,EAAE,YAAY,CAAC;IAYvB,OAAO,CAAC,EAAE,GAAG,CAAC;IAKd,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAGD,oBAAY,iBAAiB,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,CAC1D,KAAK,EAAE,SAAS,EAChB,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,KAC3B,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.js b/node_modules/apollo-client/core/watchQueryOptions.js new file mode 100644 index 000000000..7a61e2edd --- /dev/null +++ b/node_modules/apollo-client/core/watchQueryOptions.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=watchQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.js.map b/node_modules/apollo-client/core/watchQueryOptions.js.map new file mode 100644 index 000000000..9ad66e306 --- /dev/null +++ b/node_modules/apollo-client/core/watchQueryOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.d.ts b/node_modules/apollo-client/data/mutations.d.ts new file mode 100644 index 000000000..1c6770c0b --- /dev/null +++ b/node_modules/apollo-client/data/mutations.d.ts @@ -0,0 +1,19 @@ +import { DocumentNode } from 'graphql'; +export declare class MutationStore { + private store; + getStore(): { + [mutationId: string]: MutationStoreValue; + }; + get(mutationId: string): MutationStoreValue; + initMutation(mutationId: string, mutation: DocumentNode, variables: Object | undefined): void; + markMutationError(mutationId: string, error: Error): void; + markMutationResult(mutationId: string): void; + reset(): void; +} +export interface MutationStoreValue { + mutation: DocumentNode; + variables: Object; + loading: boolean; + error: Error | null; +} +//# sourceMappingURL=mutations.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.d.ts.map b/node_modules/apollo-client/data/mutations.d.ts.map new file mode 100644 index 000000000..cd6b57266 --- /dev/null +++ b/node_modules/apollo-client/data/mutations.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../src/data/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAoD;IAE1D,QAAQ,IAAI;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAAA;KAAE;IAIxD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB;IAI3C,YAAY,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,MAAM,GAAG,SAAS;IAUxB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IAQlD,kBAAkB,CAAC,UAAU,EAAE,MAAM;IAQrC,KAAK;CAGb;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.js b/node_modules/apollo-client/data/mutations.js new file mode 100644 index 000000000..8779300b2 --- /dev/null +++ b/node_modules/apollo-client/data/mutations.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var MutationStore = (function () { + function MutationStore() { + this.store = {}; + } + MutationStore.prototype.getStore = function () { + return this.store; + }; + MutationStore.prototype.get = function (mutationId) { + return this.store[mutationId]; + }; + MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { + this.store[mutationId] = { + mutation: mutation, + variables: variables || {}, + loading: true, + error: null, + }; + }; + MutationStore.prototype.markMutationError = function (mutationId, error) { + var mutation = this.store[mutationId]; + if (mutation) { + mutation.loading = false; + mutation.error = error; + } + }; + MutationStore.prototype.markMutationResult = function (mutationId) { + var mutation = this.store[mutationId]; + if (mutation) { + mutation.loading = false; + mutation.error = null; + } + }; + MutationStore.prototype.reset = function () { + this.store = {}; + }; + return MutationStore; +}()); +exports.MutationStore = MutationStore; +//# sourceMappingURL=mutations.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.js.map b/node_modules/apollo-client/data/mutations.js.map new file mode 100644 index 000000000..1f5364f11 --- /dev/null +++ b/node_modules/apollo-client/data/mutations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/data/mutations.ts"],"names":[],"mappings":";;AAEA;IAAA;QACU,UAAK,GAAiD,EAAE,CAAC;IA0CnE,CAAC;IAxCQ,gCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,2BAAG,GAAV,UAAW,UAAkB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAEM,oCAAY,GAAnB,UACE,UAAkB,EAClB,QAAsB,EACtB,SAA6B;QAE7B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG;YACvB,QAAQ,UAAA;YACR,SAAS,EAAE,SAAS,IAAI,EAAE;YAC1B,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAEM,yCAAiB,GAAxB,UAAyB,UAAkB,EAAE,KAAY;QACvD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;SACxB;IACH,CAAC;IAEM,0CAAkB,GAAzB,UAA0B,UAAkB;QAC1C,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;SACvB;IACH,CAAC;IAEM,6BAAK,GAAZ;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IACH,oBAAC;AAAD,CAAC,AA3CD,IA2CC;AA3CY,sCAAa"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.d.ts b/node_modules/apollo-client/data/queries.d.ts new file mode 100644 index 000000000..6b51294b1 --- /dev/null +++ b/node_modules/apollo-client/data/queries.d.ts @@ -0,0 +1,34 @@ +import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql'; +import { NetworkStatus } from '../core/networkStatus'; +export declare type QueryStoreValue = { + document: DocumentNode; + variables: Object; + previousVariables?: Object | null; + networkStatus: NetworkStatus; + networkError?: Error | null; + graphQLErrors?: ReadonlyArray; + metadata: any; +}; +export declare class QueryStore { + private store; + getStore(): { + [queryId: string]: QueryStoreValue; + }; + get(queryId: string): QueryStoreValue; + initQuery(query: { + queryId: string; + document: DocumentNode; + storePreviousVariables: boolean; + variables: Object; + isPoll: boolean; + isRefetch: boolean; + metadata: any; + fetchMoreForQueryId: string | undefined; + }): void; + markQueryResult(queryId: string, result: ExecutionResult, fetchMoreForQueryId: string | undefined): void; + markQueryError(queryId: string, error: Error, fetchMoreForQueryId: string | undefined): void; + markQueryResultClient(queryId: string, complete: boolean): void; + stopQuery(queryId: string): void; + reset(observableQueryIds: string[]): void; +} +//# sourceMappingURL=queries.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.d.ts.map b/node_modules/apollo-client/data/queries.d.ts.map new file mode 100644 index 000000000..70c3b714e --- /dev/null +++ b/node_modules/apollo-client/data/queries.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/data/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,oBAAY,eAAe,GAAG;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAA8C;IAEpD,QAAQ,IAAI;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE;IAIlD,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe;IAIrC,SAAS,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,YAAY,CAAC;QACvB,sBAAsB,EAAE,OAAO,CAAC;QAChC,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,GAAG,CAAC;QACd,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;KACzC;IA2EM,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,eAAe,EACvB,mBAAmB,EAAE,MAAM,GAAG,SAAS;IAoBlC,cAAc,CACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,EACZ,mBAAmB,EAAE,MAAM,GAAG,SAAS;IAelC,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;IAWxD,SAAS,CAAC,OAAO,EAAE,MAAM;IAIzB,KAAK,CAAC,kBAAkB,EAAE,MAAM,EAAE;CAU1C"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.js b/node_modules/apollo-client/data/queries.js new file mode 100644 index 000000000..22eadfff2 --- /dev/null +++ b/node_modules/apollo-client/data/queries.js @@ -0,0 +1,112 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var apollo_utilities_1 = require("apollo-utilities"); +var ts_invariant_1 = require("ts-invariant"); +var networkStatus_1 = require("../core/networkStatus"); +var arrays_1 = require("../util/arrays"); +var QueryStore = (function () { + function QueryStore() { + this.store = {}; + } + QueryStore.prototype.getStore = function () { + return this.store; + }; + QueryStore.prototype.get = function (queryId) { + return this.store[queryId]; + }; + QueryStore.prototype.initQuery = function (query) { + var previousQuery = this.store[query.queryId]; + ts_invariant_1.invariant(!previousQuery || + previousQuery.document === query.document || + apollo_utilities_1.isEqual(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); + var isSetVariables = false; + var previousVariables = null; + if (query.storePreviousVariables && + previousQuery && + previousQuery.networkStatus !== networkStatus_1.NetworkStatus.loading) { + if (!apollo_utilities_1.isEqual(previousQuery.variables, query.variables)) { + isSetVariables = true; + previousVariables = previousQuery.variables; + } + } + var networkStatus; + if (isSetVariables) { + networkStatus = networkStatus_1.NetworkStatus.setVariables; + } + else if (query.isPoll) { + networkStatus = networkStatus_1.NetworkStatus.poll; + } + else if (query.isRefetch) { + networkStatus = networkStatus_1.NetworkStatus.refetch; + } + else { + networkStatus = networkStatus_1.NetworkStatus.loading; + } + var graphQLErrors = []; + if (previousQuery && previousQuery.graphQLErrors) { + graphQLErrors = previousQuery.graphQLErrors; + } + this.store[query.queryId] = { + document: query.document, + variables: query.variables, + previousVariables: previousVariables, + networkError: null, + graphQLErrors: graphQLErrors, + networkStatus: networkStatus, + metadata: query.metadata, + }; + if (typeof query.fetchMoreForQueryId === 'string' && + this.store[query.fetchMoreForQueryId]) { + this.store[query.fetchMoreForQueryId].networkStatus = + networkStatus_1.NetworkStatus.fetchMore; + } + }; + QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) + return; + this.store[queryId].networkError = null; + this.store[queryId].graphQLErrors = arrays_1.isNonEmptyArray(result.errors) ? result.errors : []; + this.store[queryId].previousVariables = null; + this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.ready; + if (typeof fetchMoreForQueryId === 'string' && + this.store[fetchMoreForQueryId]) { + this.store[fetchMoreForQueryId].networkStatus = networkStatus_1.NetworkStatus.ready; + } + }; + QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { + if (!this.store || !this.store[queryId]) + return; + this.store[queryId].networkError = error; + this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.error; + if (typeof fetchMoreForQueryId === 'string') { + this.markQueryResultClient(fetchMoreForQueryId, true); + } + }; + QueryStore.prototype.markQueryResultClient = function (queryId, complete) { + var storeValue = this.store && this.store[queryId]; + if (storeValue) { + storeValue.networkError = null; + storeValue.previousVariables = null; + if (complete) { + storeValue.networkStatus = networkStatus_1.NetworkStatus.ready; + } + } + }; + QueryStore.prototype.stopQuery = function (queryId) { + delete this.store[queryId]; + }; + QueryStore.prototype.reset = function (observableQueryIds) { + var _this = this; + Object.keys(this.store).forEach(function (queryId) { + if (observableQueryIds.indexOf(queryId) < 0) { + _this.stopQuery(queryId); + } + else { + _this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.loading; + } + }); + }; + return QueryStore; +}()); +exports.QueryStore = QueryStore; +//# sourceMappingURL=queries.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.js.map b/node_modules/apollo-client/data/queries.js.map new file mode 100644 index 000000000..8e0c7519c --- /dev/null +++ b/node_modules/apollo-client/data/queries.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/data/queries.ts"],"names":[],"mappings":";;AACA,qDAA2C;AAC3C,6CAAyC;AACzC,uDAAsD;AACtD,yCAAiD;AAYjD;IAAA;QACU,UAAK,GAA2C,EAAE,CAAC;IAgK7D,CAAC;IA9JQ,6BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,wBAAG,GAAV,UAAW,OAAe;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEM,8BAAS,GAAhB,UAAiB,KAShB;QACC,IAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAKhD,wBAAS,CACP,CAAC,aAAa;YACd,aAAa,CAAC,QAAQ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aAAa,GAAG,6BAAa,CAAC,KAAK,CAAC;QAKxD,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE;YAC3C,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;SACvD;IACH,CAAC;IAEM,0CAAqB,GAA5B,UAA6B,OAAe,EAAE,QAAiB;QAC7D,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,UAAU,EAAE;YACd,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;YAC/B,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC;YACpC,IAAI,QAAQ,EAAE;gBACZ,UAAU,CAAC,aAAa,GAAG,6BAAa,CAAC,KAAK,CAAC;aAChD;SACF;IACH,CAAC;IAEM,8BAAS,GAAhB,UAAiB,OAAe;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEM,0BAAK,GAAZ,UAAa,kBAA4B;QAAzC,iBASC;QARC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAA,OAAO;YACrC,IAAI,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAC3C,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;aACzB;iBAAM;gBAEL,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,aAAa,GAAG,6BAAa,CAAC,OAAO,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAjKD,IAiKC;AAjKY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.d.ts b/node_modules/apollo-client/data/store.d.ts new file mode 100644 index 000000000..63613944b --- /dev/null +++ b/node_modules/apollo-client/data/store.d.ts @@ -0,0 +1,49 @@ +import { ExecutionResult, DocumentNode } from 'graphql'; +import { ApolloCache, DataProxy } from 'apollo-cache'; +import { QueryStoreValue } from '../data/queries'; +import { MutationQueryReducer } from '../core/types'; +export declare type QueryWithUpdater = { + updater: MutationQueryReducer; + query: QueryStoreValue; +}; +export interface DataWrite { + rootId: string; + result: any; + document: DocumentNode; + operationName: string | null; + variables: Object; +} +export declare class DataStore { + private cache; + constructor(initialCache: ApolloCache); + getCache(): ApolloCache; + markQueryResult(result: ExecutionResult, document: DocumentNode, variables: any, fetchMoreForQueryId: string | undefined, ignoreErrors?: boolean): void; + markSubscriptionResult(result: ExecutionResult, document: DocumentNode, variables: any): void; + markMutationInit(mutation: { + mutationId: string; + document: DocumentNode; + variables: any; + updateQueries: { + [queryId: string]: QueryWithUpdater; + }; + update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined; + optimisticResponse: Object | Function | undefined; + }): void; + markMutationResult(mutation: { + mutationId: string; + result: ExecutionResult; + document: DocumentNode; + variables: any; + updateQueries: { + [queryId: string]: QueryWithUpdater; + }; + update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined; + }): void; + markMutationComplete({ mutationId, optimisticResponse, }: { + mutationId: string; + optimisticResponse?: any; + }): void; + markUpdateQueryResult(document: DocumentNode, variables: any, newResult: any): void; + reset(): Promise; +} +//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.d.ts.map b/node_modules/apollo-client/data/store.d.ts.map new file mode 100644 index 000000000..7f0e559aa --- /dev/null +++ b/node_modules/apollo-client/data/store.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/data/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAS,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAA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B,SAAS,EAAE,GAAG,CAAC;QACf,aAAa,EAAE;YAAE,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAA;SAAE,CAAC;QACvD,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;KAC1E;IA4DM,oBAAoB,CAAC,EAC1B,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,CAAC,EAAE,GAAG,CAAC;KAC1B;IAMM,qBAAqB,CAC1B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,GAAG;IAUT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.js b/node_modules/apollo-client/data/store.js new file mode 100644 index 000000000..aecfa79f0 --- /dev/null +++ b/node_modules/apollo-client/data/store.js @@ -0,0 +1,132 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var apollo_utilities_1 = require("apollo-utilities"); +var DataStore = (function () { + function DataStore(initialCache) { + this.cache = initialCache; + } + DataStore.prototype.getCache = function () { + return this.cache; + }; + DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { + if (ignoreErrors === void 0) { ignoreErrors = false; } + var writeWithErrors = !apollo_utilities_1.graphQLResultHasError(result); + if (ignoreErrors && apollo_utilities_1.graphQLResultHasError(result) && result.data) { + writeWithErrors = true; + } + if (!fetchMoreForQueryId && writeWithErrors) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_QUERY', + query: document, + variables: variables, + }); + } + }; + DataStore.prototype.markSubscriptionResult = function (result, document, variables) { + if (!apollo_utilities_1.graphQLResultHasError(result)) { + this.cache.write({ + result: result.data, + dataId: 'ROOT_SUBSCRIPTION', + query: document, + variables: variables, + }); + } + }; + DataStore.prototype.markMutationInit = function (mutation) { + var _this = this; + if (mutation.optimisticResponse) { + var optimistic_1; + if (typeof mutation.optimisticResponse === 'function') { + optimistic_1 = mutation.optimisticResponse(mutation.variables); + } + else { + optimistic_1 = mutation.optimisticResponse; + } + this.cache.recordOptimisticTransaction(function (c) { + var orig = _this.cache; + _this.cache = c; + try { + _this.markMutationResult({ + mutationId: mutation.mutationId, + result: { data: optimistic_1 }, + document: mutation.document, + variables: mutation.variables, + updateQueries: mutation.updateQueries, + update: mutation.update, + }); + } + finally { + _this.cache = orig; + } + }, mutation.mutationId); + } + }; + DataStore.prototype.markMutationResult = function (mutation) { + var _this = this; + if (!apollo_utilities_1.graphQLResultHasError(mutation.result)) { + var cacheWrites_1 = [{ + result: mutation.result.data, + dataId: 'ROOT_MUTATION', + query: mutation.document, + variables: mutation.variables, + }]; + var updateQueries_1 = mutation.updateQueries; + if (updateQueries_1) { + Object.keys(updateQueries_1).forEach(function (id) { + var _a = updateQueries_1[id], query = _a.query, updater = _a.updater; + var _b = _this.cache.diff({ + query: query.document, + variables: query.variables, + returnPartialData: true, + optimistic: false, + }), currentQueryResult = _b.result, complete = _b.complete; + if (complete) { + var nextQueryResult = apollo_utilities_1.tryFunctionOrLogError(function () { + return updater(currentQueryResult, { + mutationResult: mutation.result, + queryName: apollo_utilities_1.getOperationName(query.document) || undefined, + queryVariables: query.variables, + }); + }); + if (nextQueryResult) { + cacheWrites_1.push({ + result: nextQueryResult, + dataId: 'ROOT_QUERY', + query: query.document, + variables: query.variables, + }); + } + } + }); + } + this.cache.performTransaction(function (c) { + cacheWrites_1.forEach(function (write) { return c.write(write); }); + var update = mutation.update; + if (update) { + apollo_utilities_1.tryFunctionOrLogError(function () { return update(c, mutation.result); }); + } + }); + } + }; + DataStore.prototype.markMutationComplete = function (_a) { + var mutationId = _a.mutationId, optimisticResponse = _a.optimisticResponse; + if (optimisticResponse) { + this.cache.removeOptimistic(mutationId); + } + }; + DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { + this.cache.write({ + result: newResult, + dataId: 'ROOT_QUERY', + variables: variables, + query: document, + }); + }; + DataStore.prototype.reset = function () { + return this.cache.reset(); + }; + return DataStore; +}()); +exports.DataStore = DataStore; +//# sourceMappingURL=store.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.js.map b/node_modules/apollo-client/data/store.js.map new file mode 100644 index 000000000..66905e96c --- /dev/null +++ b/node_modules/apollo-client/data/store.js.map @@ -0,0 +1 @@ +{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/data/store.ts"],"names":[],"mappings":";;AAIA,qDAI0B;AAgB1B;IAGE,mBAAY,YAAsC;QAChD,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;IAC5B,CAAC;IAEM,4BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,mCAAe,GAAtB,UACE,MAAuB,EACvB,QAAsB,EACtB,SAAc,EACd,mBAAuC,EACvC,YAA6B;QAA7B,6BAAA,EAAA,oBAA6B;QAE7B,IAAI,eAAe,GAAG,CAAC,wCAAqB,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,YAAY,IAAI,wCAAqB,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE;YAChE,eAAe,GAAG,IAAI,CAAC;SACxB;QACD,IAAI,CAAC,mBAAmB,IAAI,eAAe,EAAE;YAC3C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBACf,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,MAAM,EAAE,YAAY;gBACpB,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,SAAS;aACrB,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,0CAAsB,GAA7B,UACE,MAAuB,EACvB,QAAsB,EACtB,SAAc;QAId,IAAI,CAAC,wCAAqB,CAAC,MAAM,CAAC,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBACf,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,MAAM,EAAE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,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,wCAAoB,GAA3B,UAA4B,EAM3B;YALC,0BAAU,EACV,0CAAkB;QAKlB,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;SACzC;IACH,CAAC;IAEM,yCAAqB,GAA5B,UACE,QAAsB,EACtB,SAAc,EACd,SAAc;QAEd,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YACf,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,YAAY;YACpB,SAAS,WAAA;YACT,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAEM,yBAAK,GAAZ;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IACH,gBAAC;AAAD,CAAC,AApLD,IAoLC;AApLY,8BAAS"} \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.d.ts b/node_modules/apollo-client/errors/ApolloError.d.ts new file mode 100644 index 000000000..7e848879f --- /dev/null +++ b/node_modules/apollo-client/errors/ApolloError.d.ts @@ -0,0 +1,15 @@ +import { GraphQLError } from 'graphql'; +export declare function isApolloError(err: Error): err is ApolloError; +export declare class ApolloError extends Error { + message: string; + graphQLErrors: ReadonlyArray; + networkError: Error | null; + extraInfo: any; + constructor({ graphQLErrors, networkError, errorMessage, extraInfo, }: { + graphQLErrors?: ReadonlyArray; + networkError?: Error | null; + errorMessage?: string; + extraInfo?: any; + }); +} +//# sourceMappingURL=ApolloError.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.d.ts.map b/node_modules/apollo-client/errors/ApolloError.d.ts.map new file mode 100644 index 000000000..7881e6770 --- /dev/null +++ b/node_modules/apollo-client/errors/ApolloError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloError.d.ts","sourceRoot":"","sources":["../src/errors/ApolloError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,wBAAgB,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,WAAW,CAE5D;AA2BD,qBAAa,WAAY,SAAQ,KAAK;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAK3B,SAAS,EAAE,GAAG,CAAC;gBAKV,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,EAAE;QACD,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC5C,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,GAAG,CAAC;KACjB;CAiBF"} \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.js b/node_modules/apollo-client/errors/ApolloError.js new file mode 100644 index 000000000..e0eda4a47 --- /dev/null +++ b/node_modules/apollo-client/errors/ApolloError.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var arrays_1 = require("../util/arrays"); +function isApolloError(err) { + return err.hasOwnProperty('graphQLErrors'); +} +exports.isApolloError = isApolloError; +var generateErrorMessage = function (err) { + var message = ''; + if (arrays_1.isNonEmptyArray(err.graphQLErrors)) { + err.graphQLErrors.forEach(function (graphQLError) { + var errorMessage = graphQLError + ? graphQLError.message + : 'Error message not found.'; + message += "GraphQL error: " + errorMessage + "\n"; + }); + } + if (err.networkError) { + message += 'Network error: ' + err.networkError.message + '\n'; + } + message = message.replace(/\n$/, ''); + return message; +}; +var ApolloError = (function (_super) { + tslib_1.__extends(ApolloError, _super); + function ApolloError(_a) { + var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo; + var _this = _super.call(this, errorMessage) || this; + _this.graphQLErrors = graphQLErrors || []; + _this.networkError = networkError || null; + if (!errorMessage) { + _this.message = generateErrorMessage(_this); + } + else { + _this.message = errorMessage; + } + _this.extraInfo = extraInfo; + _this.__proto__ = ApolloError.prototype; + return _this; + } + return ApolloError; +}(Error)); +exports.ApolloError = ApolloError; +//# sourceMappingURL=ApolloError.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.js.map b/node_modules/apollo-client/errors/ApolloError.js.map new file mode 100644 index 000000000..e10bf8257 --- /dev/null +++ b/node_modules/apollo-client/errors/ApolloError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloError.js","sourceRoot":"","sources":["../../src/errors/ApolloError.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAEjD,SAAgB,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAFD,sCAEC;AAMD,IAAM,oBAAoB,GAAG,UAAC,GAAgB;IAC5C,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,wBAAe,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;QACtC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,YAA0B;YACnD,IAAM,YAAY,GAAG,YAAY;gBAC/B,CAAC,CAAC,YAAY,CAAC,OAAO;gBACtB,CAAC,CAAC,0BAA0B,CAAC;YAC/B,OAAO,IAAI,oBAAkB,YAAY,OAAI,CAAC;QAChD,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,OAAO,IAAI,iBAAiB,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;KAChE;IAGD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;IAAiC,uCAAK;IAapC,qBAAY,EAUX;YATC,gCAAa,EACb,8BAAY,EACZ,8BAAY,EACZ,wBAAS;QAJX,YAWE,kBAAM,YAAY,CAAC,SAepB;QAdC,KAAI,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;QACzC,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QAEzC,IAAI,CAAC,YAAY,EAAE;YACjB,KAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,KAAI,CAAC,CAAC;SAC3C;aAAM;YACL,KAAI,CAAC,OAAO,GAAG,YAAY,CAAC;SAC7B;QAED,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAI1B,KAAY,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;;IAClD,CAAC;IACH,kBAAC;AAAD,CAAC,AAxCD,CAAiC,KAAK,GAwCrC;AAxCY,kCAAW"} \ No newline at end of file diff --git a/node_modules/apollo-client/index.d.ts b/node_modules/apollo-client/index.d.ts new file mode 100644 index 000000000..141964a34 --- /dev/null +++ b/node_modules/apollo-client/index.d.ts @@ -0,0 +1,11 @@ +export { ObservableQuery, FetchMoreOptions, UpdateQueryOptions, ApolloCurrentResult, ApolloCurrentQueryResult, } from './core/ObservableQuery'; +export { QueryBaseOptions, QueryOptions, WatchQueryOptions, MutationOptions, SubscriptionOptions, FetchPolicy, WatchQueryFetchPolicy, ErrorPolicy, FetchMoreQueryOptions, SubscribeToMoreOptions, MutationUpdaterFn, } from './core/watchQueryOptions'; +export { NetworkStatus } from './core/networkStatus'; +export * from './core/types'; +export { Resolver, FragmentMatcher as LocalStateFragmentMatcher, } from './core/LocalState'; +export { isApolloError, ApolloError } from './errors/ApolloError'; +import ApolloClient, { ApolloClientOptions, DefaultOptions } from './ApolloClient'; +export { ApolloClientOptions, DefaultOptions }; +export { ApolloClient }; +export default ApolloClient; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/index.d.ts.map b/node_modules/apollo-client/index.d.ts.map new file mode 100644 index 000000000..6ca55e7ec --- /dev/null +++ b/node_modules/apollo-client/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,eAAe,IAAI,yBAAyB,GAC7C,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,YAAY,EAAE,EACnB,mBAAmB,EACnB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/index.js b/node_modules/apollo-client/index.js new file mode 100644 index 000000000..a259ed107 --- /dev/null +++ b/node_modules/apollo-client/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var ObservableQuery_1 = require("./core/ObservableQuery"); +exports.ObservableQuery = ObservableQuery_1.ObservableQuery; +var networkStatus_1 = require("./core/networkStatus"); +exports.NetworkStatus = networkStatus_1.NetworkStatus; +tslib_1.__exportStar(require("./core/types"), exports); +var ApolloError_1 = require("./errors/ApolloError"); +exports.isApolloError = ApolloError_1.isApolloError; +exports.ApolloError = ApolloError_1.ApolloError; +var ApolloClient_1 = tslib_1.__importDefault(require("./ApolloClient")); +exports.ApolloClient = ApolloClient_1.default; +exports.default = ApolloClient_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/index.js.map b/node_modules/apollo-client/index.js.map new file mode 100644 index 000000000..68b67287e --- /dev/null +++ b/node_modules/apollo-client/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0DAMgC;AAL9B,4CAAA,eAAe,CAAA;AAmBjB,sDAAqD;AAA5C,wCAAA,aAAa,CAAA;AACtB,uDAA6B;AAM7B,oDAAkE;AAAzD,sCAAA,aAAa,CAAA;AAAE,oCAAA,WAAW,CAAA;AAEnC,wEAGwB;AAIf,uBAPF,sBAAY,CAOE;AACrB,kBAAe,sBAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/package.json b/node_modules/apollo-client/package.json new file mode 100644 index 000000000..117aa8cda --- /dev/null +++ b/node_modules/apollo-client/package.json @@ -0,0 +1,38 @@ +{ + "name": "apollo-client", + "version": "2.6.3", + "description": "A simple yet functional GraphQL client.", + "main": "bundle.umd.js", + "module": "bundle.esm.js", + "typings": "index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "apollographql/apollo-client" + }, + "pre-commit": "lint-staged", + "keywords": [ + "ecmascript", + "es2015", + "jsnext", + "javascript", + "relay", + "npm", + "react" + ], + "author": "Sashko Stubailo ", + "license": "MIT", + "dependencies": { + "@types/zen-observable": "^0.8.0", + "apollo-cache": "1.3.2", + "apollo-link": "^1.0.0", + "apollo-utilities": "1.3.2", + "symbol-observable": "^1.0.2", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3", + "zen-observable": "^0.8.0" + }, + "peerDependencies": { + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + } +} \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.d.ts b/node_modules/apollo-client/util/Observable.d.ts new file mode 100644 index 000000000..585e146cb --- /dev/null +++ b/node_modules/apollo-client/util/Observable.d.ts @@ -0,0 +1,7 @@ +/// +import { Observable as LinkObservable } from 'apollo-link'; +export declare type Subscription = ZenObservable.Subscription; +export declare type Observer = ZenObservable.Observer; +export declare class Observable extends LinkObservable { +} +//# sourceMappingURL=Observable.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.d.ts.map b/node_modules/apollo-client/util/Observable.d.ts.map new file mode 100644 index 000000000..2f8454b87 --- /dev/null +++ b/node_modules/apollo-client/util/Observable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Observable.d.ts","sourceRoot":"","sources":["../src/util/Observable.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,oBAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC;AACtD,oBAAY,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAKpD,qBAAa,UAAU,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;CAQnD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.js b/node_modules/apollo-client/util/Observable.js new file mode 100644 index 000000000..59ead5316 --- /dev/null +++ b/node_modules/apollo-client/util/Observable.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +var symbol_observable_1 = tslib_1.__importDefault(require("symbol-observable")); +var Observable = (function (_super) { + tslib_1.__extends(Observable, _super); + function Observable() { + return _super !== null && _super.apply(this, arguments) || this; + } + Observable.prototype[symbol_observable_1.default] = function () { + return this; + }; + Observable.prototype['@@observable'] = function () { + return this; + }; + return Observable; +}(apollo_link_1.Observable)); +exports.Observable = Observable; +//# sourceMappingURL=Observable.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.js.map b/node_modules/apollo-client/util/Observable.js.map new file mode 100644 index 000000000..1222b5f83 --- /dev/null +++ b/node_modules/apollo-client/util/Observable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Observable.js","sourceRoot":"","sources":["../../src/util/Observable.ts"],"names":[],"mappings":";;;AAEA,2CAA2D;AAK3D,gFAA6C;AAG7C;IAAmC,sCAAiB;IAApD;;IAQA,CAAC;IAPQ,qBAAC,2BAAY,CAAC,GAArB;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,qBAAC,cAAqB,CAAC,GAA9B;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,iBAAC;AAAD,CAAC,AARD,CAAmC,wBAAc,GAQhD;AARY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.d.ts b/node_modules/apollo-client/util/arrays.d.ts new file mode 100644 index 000000000..8a46dc6f8 --- /dev/null +++ b/node_modules/apollo-client/util/arrays.d.ts @@ -0,0 +1,2 @@ +export declare function isNonEmptyArray(value?: ArrayLike): value is Array; +//# sourceMappingURL=arrays.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.d.ts.map b/node_modules/apollo-client/util/arrays.d.ts.map new file mode 100644 index 000000000..2db55b359 --- /dev/null +++ b/node_modules/apollo-client/util/arrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../src/util/arrays.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE1E"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.js b/node_modules/apollo-client/util/arrays.js new file mode 100644 index 000000000..e388142e9 --- /dev/null +++ b/node_modules/apollo-client/util/arrays.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function isNonEmptyArray(value) { + return Array.isArray(value) && value.length > 0; +} +exports.isNonEmptyArray = isNonEmptyArray; +//# sourceMappingURL=arrays.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.js.map b/node_modules/apollo-client/util/arrays.js.map new file mode 100644 index 000000000..9302fd1f2 --- /dev/null +++ b/node_modules/apollo-client/util/arrays.js.map @@ -0,0 +1 @@ +{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../src/util/arrays.ts"],"names":[],"mappings":";;AAAA,SAAgB,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts new file mode 100644 index 000000000..178652dc3 --- /dev/null +++ b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts @@ -0,0 +1,2 @@ +export declare function capitalizeFirstLetter(str: string): string; +//# sourceMappingURL=capitalizeFirstLetter.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map new file mode 100644 index 000000000..ceb2059b2 --- /dev/null +++ b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"capitalizeFirstLetter.d.ts","sourceRoot":"","sources":["../src/util/capitalizeFirstLetter.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,UAEhD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.js b/node_modules/apollo-client/util/capitalizeFirstLetter.js new file mode 100644 index 000000000..1ee854f01 --- /dev/null +++ b/node_modules/apollo-client/util/capitalizeFirstLetter.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function capitalizeFirstLetter(str) { + return str.charAt(0).toUpperCase() + str.slice(1); +} +exports.capitalizeFirstLetter = capitalizeFirstLetter; +//# sourceMappingURL=capitalizeFirstLetter.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.js.map b/node_modules/apollo-client/util/capitalizeFirstLetter.js.map new file mode 100644 index 000000000..639769e33 --- /dev/null +++ b/node_modules/apollo-client/util/capitalizeFirstLetter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"capitalizeFirstLetter.js","sourceRoot":"","sources":["../../src/util/capitalizeFirstLetter.ts"],"names":[],"mappings":";;AAAA,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,sDAEC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.d.ts b/node_modules/apollo-client/util/observableToPromise.d.ts new file mode 100644 index 000000000..099a90638 --- /dev/null +++ b/node_modules/apollo-client/util/observableToPromise.d.ts @@ -0,0 +1,16 @@ +import { ObservableQuery } from '../core/ObservableQuery'; +import { ApolloQueryResult } from '../core/types'; +import { Subscription } from '../util/Observable'; +export declare type Options = { + observable: ObservableQuery; + shouldResolve?: boolean; + wait?: number; + errorCallbacks?: ((error: Error) => any)[]; +}; +export declare type ResultCallback = ((result: ApolloQueryResult) => any); +export declare function observableToPromiseAndSubscription({ observable, shouldResolve, wait, errorCallbacks }: Options, ...cbs: ResultCallback[]): { + promise: Promise; + subscription: Subscription; +}; +export default function (options: Options, ...cbs: ResultCallback[]): Promise; +//# sourceMappingURL=observableToPromise.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.d.ts.map b/node_modules/apollo-client/util/observableToPromise.d.ts.map new file mode 100644 index 000000000..7935d2b32 --- /dev/null +++ b/node_modules/apollo-client/util/observableToPromise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"observableToPromise.d.ts","sourceRoot":"","sources":["../src/util/observableToPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD,oBAAY,OAAO,GAAG;IACpB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,oBAAY,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;AAMvE,wBAAgB,kCAAkC,CAChD,EAAE,UAAU,EAAE,aAAoB,EAAE,IAAS,EAAE,cAAmB,EAAE,EAAE,OAAO,EAC7E,GAAG,GAAG,EAAE,cAAc,EAAE,GACvB;IAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAE,CA8DzD;AAED,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,GAAG,GAAG,EAAE,cAAc,EAAE,GACvB,OAAO,CAAC,GAAG,EAAE,CAAC,CAEhB"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.js b/node_modules/apollo-client/util/observableToPromise.js new file mode 100644 index 000000000..1e2887452 --- /dev/null +++ b/node_modules/apollo-client/util/observableToPromise.js @@ -0,0 +1,78 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function observableToPromiseAndSubscription(_a) { + var observable = _a.observable, _b = _a.shouldResolve, shouldResolve = _b === void 0 ? true : _b, _c = _a.wait, wait = _c === void 0 ? -1 : _c, _d = _a.errorCallbacks, errorCallbacks = _d === void 0 ? [] : _d; + var cbs = []; + for (var _i = 1; _i < arguments.length; _i++) { + cbs[_i - 1] = arguments[_i]; + } + var subscription = null; + var promise = new Promise(function (resolve, reject) { + var errorIndex = 0; + var cbIndex = 0; + var results = []; + var tryToResolve = function () { + if (!shouldResolve) { + return; + } + var done = function () { + subscription.unsubscribe(); + resolve(results); + }; + if (cbIndex === cbs.length && errorIndex === errorCallbacks.length) { + if (wait === -1) { + done(); + } + else { + setTimeout(done, wait); + } + } + }; + subscription = observable.subscribe({ + next: function (result) { + var cb = cbs[cbIndex++]; + if (cb) { + try { + results.push(cb(result)); + } + catch (e) { + return reject(e); + } + tryToResolve(); + } + else { + reject(new Error("Observable called more than " + cbs.length + " times")); + } + }, + error: function (error) { + var errorCb = errorCallbacks[errorIndex++]; + if (errorCb) { + try { + errorCb(error); + } + catch (e) { + return reject(e); + } + tryToResolve(); + } + else { + reject(error); + } + }, + }); + }); + return { + promise: promise, + subscription: subscription, + }; +} +exports.observableToPromiseAndSubscription = observableToPromiseAndSubscription; +function default_1(options) { + var cbs = []; + for (var _i = 1; _i < arguments.length; _i++) { + cbs[_i - 1] = arguments[_i]; + } + return observableToPromiseAndSubscription.apply(void 0, [options].concat(cbs)).promise; +} +exports.default = default_1; +//# sourceMappingURL=observableToPromise.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.js.map b/node_modules/apollo-client/util/observableToPromise.js.map new file mode 100644 index 000000000..8d569b28b --- /dev/null +++ b/node_modules/apollo-client/util/observableToPromise.js.map @@ -0,0 +1 @@ +{"version":3,"file":"observableToPromise.js","sourceRoot":"","sources":["../../src/util/observableToPromise.ts"],"names":[],"mappings":";;AA0BA,SAAgB,kCAAkC,CAChD,EAA6E;QAA3E,0BAAU,EAAE,qBAAoB,EAApB,yCAAoB,EAAE,YAAS,EAAT,8BAAS,EAAE,sBA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AAY;gBAChB,IAAM,OAAO,GAAG,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC;gBAC7C,IAAI,OAAO,EAAE;oBACX,IAAI;wBAEF,OAAO,CAAC,KAAK,CAAC,CAAC;qBAChB;oBAAC,OAAO,CAAC,EAAE;wBACV,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;qBAClB;oBACD,YAAY,EAAE,CAAC;iBAChB;qBAAM;oBACL,MAAM,CAAC,KAAK,CAAC,CAAC;iBACf;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,SAAA;QACP,YAAY,cAAA;KACb,CAAC;AACJ,CAAC;AAjED,gFAiEC;AAED,mBACE,OAAgB;IAChB,aAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,4BAAwB;;IAExB,OAAO,kCAAkC,gBAAC,OAAO,SAAK,GAAG,GAAE,OAAO,CAAC;AACrE,CAAC;AALD,4BAKC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.d.ts b/node_modules/apollo-client/util/observables.d.ts new file mode 100644 index 000000000..c485b4366 --- /dev/null +++ b/node_modules/apollo-client/util/observables.d.ts @@ -0,0 +1,4 @@ +import { Observable } from './Observable'; +export declare function multiplex(inner: Observable): Observable; +export declare function asyncMap(observable: Observable, mapFn: (value: V) => R | Promise): Observable; +//# sourceMappingURL=observables.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.d.ts.map b/node_modules/apollo-client/util/observables.d.ts.map new file mode 100644 index 000000000..01993d3ae --- /dev/null +++ b/node_modules/apollo-client/util/observables.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"observables.d.ts","sourceRoot":"","sources":["../src/util/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAIlE,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAuBhE;AAID,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAClC,UAAU,CAAC,CAAC,CAAC,CAqCf"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.js b/node_modules/apollo-client/util/observables.js new file mode 100644 index 000000000..338470870 --- /dev/null +++ b/node_modules/apollo-client/util/observables.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var Observable_1 = require("./Observable"); +function multiplex(inner) { + var observers = new Set(); + var sub = null; + return new Observable_1.Observable(function (observer) { + observers.add(observer); + sub = sub || inner.subscribe({ + next: function (value) { + observers.forEach(function (obs) { return obs.next && obs.next(value); }); + }, + error: function (error) { + observers.forEach(function (obs) { return obs.error && obs.error(error); }); + }, + complete: function () { + observers.forEach(function (obs) { return obs.complete && obs.complete(); }); + }, + }); + return function () { + if (observers.delete(observer) && !observers.size && sub) { + sub.unsubscribe(); + sub = null; + } + }; + }); +} +exports.multiplex = multiplex; +function asyncMap(observable, mapFn) { + return new Observable_1.Observable(function (observer) { + var next = observer.next, error = observer.error, complete = observer.complete; + var activeNextCount = 0; + var completed = false; + var handler = { + next: function (value) { + ++activeNextCount; + new Promise(function (resolve) { + resolve(mapFn(value)); + }).then(function (result) { + --activeNextCount; + next && next.call(observer, result); + completed && handler.complete(); + }, function (e) { + --activeNextCount; + error && error.call(observer, e); + }); + }, + error: function (e) { + error && error.call(observer, e); + }, + complete: function () { + completed = true; + if (!activeNextCount) { + complete && complete.call(observer); + } + }, + }; + var sub = observable.subscribe(handler); + return function () { return sub.unsubscribe(); }; + }); +} +exports.asyncMap = asyncMap; +//# sourceMappingURL=observables.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.js.map b/node_modules/apollo-client/util/observables.js.map new file mode 100644 index 000000000..e75fe71ab --- /dev/null +++ b/node_modules/apollo-client/util/observables.js.map @@ -0,0 +1 @@ +{"version":3,"file":"observables.js","sourceRoot":"","sources":["../../src/util/observables.ts"],"names":[],"mappings":";;AAAA,2CAAkE;AAIlE,SAAgB,SAAS,CAAI,KAAoB;IAC/C,IAAM,SAAS,GAAG,IAAI,GAAG,EAAe,CAAC;IACzC,IAAI,GAAG,GAAwB,IAAI,CAAC;IACpC,OAAO,IAAI,uBAAU,CAAI,UAAA,QAAQ;QAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxB,GAAG,GAAG,GAAG,IAAI,KAAK,CAAC,SAAS,CAAC;YAC3B,IAAI,YAAC,KAAK;gBACR,SAAS,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAA3B,CAA2B,CAAC,CAAC;YACxD,CAAC;YACD,KAAK,YAAC,KAAK;gBACT,SAAS,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAAC;YAC1D,CAAC;YACD,QAAQ;gBACN,SAAS,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,EAA9B,CAA8B,CAAC,CAAC;YAC3D,CAAC;SACF,CAAC,CAAC;QACH,OAAO;YACL,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,EAAE;gBACxD,GAAG,CAAC,WAAW,EAAE,CAAC;gBAClB,GAAG,GAAG,IAAI,CAAC;aACZ;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,8BAuBC;AAID,SAAg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/apollo-client/util/subscribeAndCount.d.ts b/node_modules/apollo-client/util/subscribeAndCount.d.ts new file mode 100644 index 000000000..170fbba35 --- /dev/null +++ b/node_modules/apollo-client/util/subscribeAndCount.d.ts @@ -0,0 +1,6 @@ +/// +import { ObservableQuery } from '../core/ObservableQuery'; +import { ApolloQueryResult } from '../core/types'; +import { Subscription } from '../util/Observable'; +export default function subscribeAndCount(done: jest.DoneCallback, observable: ObservableQuery, cb: (handleCount: number, result: ApolloQueryResult) => any): Subscription; +//# sourceMappingURL=subscribeAndCount.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.d.ts.map b/node_modules/apollo-client/util/subscribeAndCount.d.ts.map new file mode 100644 index 000000000..6d367b1fd --- /dev/null +++ b/node_modules/apollo-client/util/subscribeAndCount.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"subscribeAndCount.d.ts","sourceRoot":"","sources":["../src/util/subscribeAndCount.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,EAChC,EAAE,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,KAAK,GAAG,GAC/D,YAAY,CAqBd"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.js b/node_modules/apollo-client/util/subscribeAndCount.js new file mode 100644 index 000000000..e809971b8 --- /dev/null +++ b/node_modules/apollo-client/util/subscribeAndCount.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var observables_1 = require("./observables"); +function subscribeAndCount(done, observable, cb) { + var handleCount = 0; + var subscription = observables_1.asyncMap(observable, function (result) { + try { + return cb(++handleCount, result); + } + catch (e) { + setImmediate(function () { + subscription.unsubscribe(); + done.fail(e); + }); + } + }).subscribe({ + error: done.fail, + }); + return subscription; +} +exports.default = subscribeAndCount; +//# sourceMappingURL=subscribeAndCount.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.js.map b/node_modules/apollo-client/util/subscribeAndCount.js.map new file mode 100644 index 000000000..8d939c416 --- /dev/null +++ b/node_modules/apollo-client/util/subscribeAndCount.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subscribeAndCount.js","sourceRoot":"","sources":["../../src/util/subscribeAndCount.ts"],"names":[],"mappings":";;AAGA,6CAAyC;AAEzC,SAAwB,iBAAiB,CACvC,IAAuB,EACvB,UAAgC,EAChC,EAAgE;IAEhE,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAM,YAAY,GAAG,sBAAQ,CAC3B,UAAU,EACV,UAAC,MAA8B;QAC7B,IAAI;YACF,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;SAClC;QAAC,OAAO,CAAC,EAAE;YAIV,YAAY,CAAC;gBACX,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CACF,CAAC,SAAS,CAAC;QACV,KAAK,EAAE,IAAI,CAAC,IAAI;KACjB,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC;AAzBD,oCAyBC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.d.ts b/node_modules/apollo-client/util/wrap.d.ts new file mode 100644 index 000000000..29775d99c --- /dev/null +++ b/node_modules/apollo-client/util/wrap.d.ts @@ -0,0 +1,6 @@ +/// +declare const _default: (done: jest.DoneCallback, cb: (...args: any[]) => any) => (...args: any[]) => any; +export default _default; +export declare function withWarning(func: Function, regex: RegExp): Promise; +export declare function withError(func: Function, regex: RegExp): any; +//# sourceMappingURL=wrap.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.d.ts.map b/node_modules/apollo-client/util/wrap.d.ts.map new file mode 100644 index 000000000..ba22fd9e9 --- /dev/null +++ b/node_modules/apollo-client/util/wrap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../src/util/wrap.ts"],"names":[],"mappings":";;AAEA,wBAQE;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAWxD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAatD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.js b/node_modules/apollo-client/util/wrap.js new file mode 100644 index 000000000..9447e5508 --- /dev/null +++ b/node_modules/apollo-client/util/wrap.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = (function (done, cb) { return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + try { + return cb.apply(void 0, args); + } + catch (e) { + done.fail(e); + } +}; }); +function withWarning(func, regex) { + var message = null; + var oldWarn = console.warn; + console.warn = function (m) { return (message = m); }; + return Promise.resolve(func()).then(function (val) { + expect(message).toMatch(regex); + console.warn = oldWarn; + return val; + }); +} +exports.withWarning = withWarning; +function withError(func, regex) { + var message = null; + var oldError = console.error; + console.error = function (m) { return (message = m); }; + try { + var result = func(); + expect(message).toMatch(regex); + return result; + } + finally { + console.error = oldError; + } +} +exports.withError = withError; +//# sourceMappingURL=wrap.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.js.map b/node_modules/apollo-client/util/wrap.js.map new file mode 100644 index 000000000..becadbf93 --- /dev/null +++ b/node_modules/apollo-client/util/wrap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"w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K,GAAG,QAAQ,CAAC;KAC1B;AACH,CAAC;AAbD,8BAaC"} \ No newline at end of file diff --git a/node_modules/apollo-client/version.d.ts b/node_modules/apollo-client/version.d.ts new file mode 100644 index 000000000..6306039cd --- /dev/null +++ b/node_modules/apollo-client/version.d.ts @@ -0,0 +1,2 @@ +export declare const version = "2.6.3"; +//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/version.d.ts.map b/node_modules/apollo-client/version.d.ts.map new file mode 100644 index 000000000..d53e1d9bd --- /dev/null +++ b/node_modules/apollo-client/version.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-client/version.js b/node_modules/apollo-client/version.js new file mode 100644 index 000000000..84997cf83 --- /dev/null +++ b/node_modules/apollo-client/version.js @@ -0,0 +1 @@ +exports.version = "2.6.3" \ No newline at end of file diff --git a/node_modules/apollo-client/version.js.map b/node_modules/apollo-client/version.js.map new file mode 100644 index 000000000..29a07815a --- /dev/null +++ b/node_modules/apollo-client/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,OAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/CHANGELOG.md b/node_modules/apollo-link-error/CHANGELOG.md new file mode 100644 index 000000000..aef899555 --- /dev/null +++ b/node_modules/apollo-link-error/CHANGELOG.md @@ -0,0 +1,52 @@ +# Change log + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). + +---- + +### 1.1.2 + +- No changes + +### 1.1.1 +- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
+ [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) +- Update types to be compatible with `@types/graphql@0.13.3` + +### 1.1.0 +- Pass `forward` into error handler for ErrorLink to support retrying a failed request + +### 1.0.9 +- Correct return type to FetchResult [#600](https://github.com/apollographql/apollo-link/pull/600) + +### 1.0.8 +- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) + +### 1.0.7 +- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) + +### 1.0.6 +- ApolloLink upgrade + +### 1.0.5 +- ApolloLink upgrade + +### 1.0.4 +- ApolloLink upgrade + +### 1.0.3 +- export options as named interface [TypeScript] + +### 1.0.2 +- changed peer-dependency of apollo-link to actual dependency +- graphQLErrors alias networkError.result.errors on a networkError + +### 1.0.1 +- moved to better rollup build + +### 1.0.0 +- Added the operation and any data to the error handler callback +- changed graphqlErrors to be graphQLErrors to be consistent with Apollo Client diff --git a/node_modules/apollo-link-error/LICENSE b/node_modules/apollo-link-error/LICENSE new file mode 100644 index 000000000..07ea66258 --- /dev/null +++ b/node_modules/apollo-link-error/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - 2017 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/apollo-link-error/README.md b/node_modules/apollo-link-error/README.md new file mode 100644 index 000000000..8c21341c7 --- /dev/null +++ b/node_modules/apollo-link-error/README.md @@ -0,0 +1,93 @@ +--- +title: apollo-link-error +description: Handle and inspect errors in your GraphQL network stack. +--- + +Use this link to do some custom logic when a GraphQL or network error happens: + +```js +import { onError } from "apollo-link-error"; + +const link = onError(({ graphQLErrors, networkError }) => { + if (graphQLErrors) + graphQLErrors.map(({ message, locations, path }) => + console.log( + `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}` + ) + ); + if (networkError) console.log(`[Network error]: ${networkError}`); +}); +``` + +Apollo Link is a system of modular components for GraphQL networking. [Read the docs](https://www.apollographql.com/docs/link/#usage) to learn how to use this link with libraries like Apollo Client and graphql-tools, or as a standalone client. + +

Callback

+ +Error Link takes a function that is called in the event of an error. This function is called with an object containing the following keys: + +* `operation`: The Operation that errored +* `response`: The result returned from lower down in the link chain +* `graphQLErrors`: An array of errors from the GraphQL endpoint +* `networkError`: Any error during the link execution or server response, that wasn't delivered as part of the `errors` field in the GraphQL result +* `forward`: A reference to the next link in the chain. Calling `return forward(operation)` in the callback will retry the request, returning a new observable for the upstream link to subscribe to. + +Returns: `Observable | void` The error callback can optionally return an observable from calling `forward(operation)` if it wants to retry the request. It should not return anything else. + +

Error categorization

+ +An error is passed as a `networkError` if a link further down the chain called the `error` callback on the observable. In most cases, `graphQLErrors` is the `errors` field of the result from the last `next` call. + +A `networkError` can contain additional fields, such as a GraphQL object in the case of a [failing HTTP status code](http.html#Errors) from [`apollo-link-http`](http.html). In this situation, `graphQLErrors` is an alias for `networkError.result.errors` if the property exists. + +

Retrying failed requests

+ +An error handler might want to do more than just logging errors. You can check for a certain failure condition or error code, and retry the request if rectifying the error is possible. For example, when using some form of token based authentication, there is a need to handle re-authentication when the token expires. Here is an example of how to do this using `forward()`. +```js +onError(({ graphQLErrors, networkError, operation, forward }) => { + if (graphQLErrors) { + for (let err of graphQLErrors) { + switch (err.extensions.code) { + case 'UNAUTHENTICATED': + // error code is set to UNAUTHENTICATED + // when AuthenticationError thrown in resolver + + // modify the operation context with a new token + const oldHeaders = operation.getContext().headers; + operation.setContext({ + headers: { + ...oldHeaders, + authorization: getNewToken(), + }, + }); + // retry the request, returning the new observable + return forward(operation); + } + } + } + if (networkError) { + console.log(`[Network error]: ${networkError}`); + // if you would also like to retry automatically on + // network errors, we recommend that you use + // apollo-link-retry + } + } +); +``` + +Here is a diagram of how the request flow looks like now: +![Diagram of request flow after retrying in error links](https://i.imgur.com/ncVAdz4.png) + +One caveat is that the errors from the new response from retrying the request does not get passed into the error handler again. This helps to avoid being trapped in an endless request loop when you call forward() in your error handler. + + +

Ignoring errors

+ +If you want to conditionally ignore errors, you can set `response.errors = null;` within the error handler: + +```js +onError(({ response, operation }) => { + if (operation.operationName === "IgnoreErrorsQuery") { + response.errors = null; + } +}); +``` diff --git a/node_modules/apollo-link-error/lib/bundle.cjs.js b/node_modules/apollo-link-error/lib/bundle.cjs.js new file mode 100644 index 000000000..b5afd6833 --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.cjs.js @@ -0,0 +1,89 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var tslib = require('tslib'); +var apolloLink = require('apollo-link'); + +function onError(errorHandler) { + return new apolloLink.ApolloLink(function (operation, forward) { + return new apolloLink.Observable(function (observer) { + var sub; + var retriedSub; + var retriedResult; + try { + sub = forward(operation).subscribe({ + next: function (result) { + if (result.errors) { + retriedResult = errorHandler({ + graphQLErrors: result.errors, + response: result, + operation: operation, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + } + observer.next(result); + }, + error: function (networkError) { + retriedResult = errorHandler({ + operation: operation, + networkError: networkError, + graphQLErrors: networkError && + networkError.result && + networkError.result.errors, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + observer.error(networkError); + }, + complete: function () { + if (!retriedResult) { + observer.complete.bind(observer)(); + } + }, + }); + } + catch (e) { + errorHandler({ networkError: e, operation: operation, forward: forward }); + observer.error(e); + } + return function () { + if (sub) + sub.unsubscribe(); + if (retriedSub) + sub.unsubscribe(); + }; + }); + }); +} +var ErrorLink = (function (_super) { + tslib.__extends(ErrorLink, _super); + function ErrorLink(errorHandler) { + var _this = _super.call(this) || this; + _this.link = onError(errorHandler); + return _this; + } + ErrorLink.prototype.request = function (operation, forward) { + return this.link.request(operation, forward); + }; + return ErrorLink; +}(apolloLink.ApolloLink)); + +exports.ErrorLink = ErrorLink; +exports.onError = onError; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.cjs.js.map b/node_modules/apollo-link-error/lib/bundle.cjs.js.map new file mode 100644 index 000000000..a8fe7e10d --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __extends } from 'tslib';\nimport { ApolloLink, Observable } from 'apollo-link';\n\nfunction onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\n\nexport { ErrorLink, onError };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["ApolloLink","Observable","__extends"],"mappings":";;;;;;;AAGA,SAAS,OAAO,CAAC,YAAY,EAAE;IAC3B,OAAO,IAAIA,qBAAU,CAAC,UAAU,SAAS,EAAE,OAAO,EAAE;QAChD,OAAO,IAAIC,qBAAU,CAAC,UAAU,QAAQ,EAAE;YACtC,IAAI,GAAG,CAAC;YACR,IAAI,UAAU,CAAC;YACf,IAAI,aAAa,CAAC;YAClB,IAAI;gBACA,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;oBAC/B,IAAI,EAAE,UAAU,MAAM,EAAE;wBACpB,IAAI,MAAM,CAAC,MAAM,EAAE;4BACf,aAAa,GAAG,YAAY,CAAC;gCACzB,aAAa,EAAE,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,MAAM;gCAChB,SAAS,EAAE,SAAS;gCACpB,OAAO,EAAE,OAAO;6BACnB,CAAC,CAAC;4BACH,IAAI,aAAa,EAAE;gCACf,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;oCACjC,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BAC1E,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACrB;YACD,OAAO,YAAY;gBACf,IAAI,GAAG;oBACH,GAAG,CAAC,WAAW,EAAE,CAAC;gBACtB,IAAI,UAAU;oBACV,GAAG,CAAC,WAAW,EAAE,CAAC;aACzB,CAAC;SACL,CAAC,CAAC;KACN,CAAC,CAAC;CACN;AACD,AAAG,IAAC,SAAS,IAAI,UAAU,MAAM,EAAE;IAC/BC,eAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,SAAS,CAAC,YAAY,EAAE;QAC7B,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;QACtC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;KAChB;IACD,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;QACxD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;KAChD,CAAC;IACF,OAAO,SAAS,CAAC;CACpB,CAACF,qBAAU,CAAC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/bundle.esm.js b/node_modules/apollo-link-error/lib/bundle.esm.js new file mode 100644 index 000000000..a7eb50371 --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.esm.js @@ -0,0 +1,84 @@ +import { __extends } from 'tslib'; +import { ApolloLink, Observable } from 'apollo-link'; + +function onError(errorHandler) { + return new ApolloLink(function (operation, forward) { + return new Observable(function (observer) { + var sub; + var retriedSub; + var retriedResult; + try { + sub = forward(operation).subscribe({ + next: function (result) { + if (result.errors) { + retriedResult = errorHandler({ + graphQLErrors: result.errors, + response: result, + operation: operation, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + } + observer.next(result); + }, + error: function (networkError) { + retriedResult = errorHandler({ + operation: operation, + networkError: networkError, + graphQLErrors: networkError && + networkError.result && + networkError.result.errors, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + observer.error(networkError); + }, + complete: function () { + if (!retriedResult) { + observer.complete.bind(observer)(); + } + }, + }); + } + catch (e) { + errorHandler({ networkError: e, operation: operation, forward: forward }); + observer.error(e); + } + return function () { + if (sub) + sub.unsubscribe(); + if (retriedSub) + sub.unsubscribe(); + }; + }); + }); +} +var ErrorLink = (function (_super) { + __extends(ErrorLink, _super); + function ErrorLink(errorHandler) { + var _this = _super.call(this) || this; + _this.link = onError(errorHandler); + return _this; + } + ErrorLink.prototype.request = function (operation, forward) { + return this.link.request(operation, forward); + }; + return ErrorLink; +}(ApolloLink)); + +export { ErrorLink, onError }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.esm.js.map b/node_modules/apollo-link-error/lib/bundle.esm.js.map new file mode 100644 index 000000000..92b6ec823 --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["/* tslint:disable */\n\nimport {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n} from 'apollo-link';\nimport { GraphQLError, ExecutionResult } from 'graphql';\nimport { ServerError, ServerParseError } from 'apollo-link-http-common';\n\nexport interface ErrorResponse {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | ServerError | ServerParseError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub;\n let retriedSub;\n let retriedResult;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable | null {\n return this.link.request(operation, forward);\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;SAgCgB,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,UAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IAAI,UAAU,CAAC,UAAA,QAAQ;YAC5B,IAAI,GAAG,CAAC;YACR,IAAI,UAAU,CAAC;YACf,IAAI,aAAa,CAAC;YAElB,IAAI;gBACF,GAAG,GAA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,CAAC;qBAC9B;oBACD,QAAQ,EAAE;wBAGR,IAAI,CAAC,aAAa,EAAE;4BAClB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;yBACpC;qBACF;iBACF,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;gBACV,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;gBACtD,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACnB;YAED,OAAO;gBACL,IAAI,GAAG;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,UAAU;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;aACnC,CAAC;SACH,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ;AAED;IAA+BA,6BAAU;IAEvC,mBAAY,YAAoC;QAAhD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;KACnC;IAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;KAC9C;IACH,gBAAC;CAbD,CAA+B,UAAU;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/bundle.umd.js b/node_modules/apollo-link-error/lib/bundle.umd.js new file mode 100644 index 000000000..95c9b7d8b --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.umd.js @@ -0,0 +1,92 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link')) : + typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link'], factory) : + (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.error = {}), global.tslib, global.apolloLink.core)); +}(this, function (exports, tslib_1, apolloLink) { 'use strict'; + + function onError(errorHandler) { + return new apolloLink.ApolloLink(function (operation, forward) { + return new apolloLink.Observable(function (observer) { + var sub; + var retriedSub; + var retriedResult; + try { + sub = forward(operation).subscribe({ + next: function (result) { + if (result.errors) { + retriedResult = errorHandler({ + graphQLErrors: result.errors, + response: result, + operation: operation, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + } + observer.next(result); + }, + error: function (networkError) { + retriedResult = errorHandler({ + operation: operation, + networkError: networkError, + graphQLErrors: networkError && + networkError.result && + networkError.result.errors, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + observer.error(networkError); + }, + complete: function () { + if (!retriedResult) { + observer.complete.bind(observer)(); + } + }, + }); + } + catch (e) { + errorHandler({ networkError: e, operation: operation, forward: forward }); + observer.error(e); + } + return function () { + if (sub) + sub.unsubscribe(); + if (retriedSub) + sub.unsubscribe(); + }; + }); + }); + } + var ErrorLink = (function (_super) { + tslib_1.__extends(ErrorLink, _super); + function ErrorLink(errorHandler) { + var _this = _super.call(this) || this; + _this.link = onError(errorHandler); + return _this; + } + ErrorLink.prototype.request = function (operation, forward) { + return this.link.request(operation, forward); + }; + return ErrorLink; + }(apolloLink.ApolloLink)); + + exports.ErrorLink = ErrorLink; + exports.onError = onError; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.umd.js.map b/node_modules/apollo-link-error/lib/bundle.umd.js.map new file mode 100644 index 000000000..151c5a867 --- /dev/null +++ b/node_modules/apollo-link-error/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.umd.js","sources":["../src/index.ts"],"sourcesContent":["/* tslint:disable */\n\nimport {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n} from 'apollo-link';\nimport { GraphQLError, ExecutionResult } from 'graphql';\nimport { ServerError, ServerParseError } from 'apollo-link-http-common';\n\nexport interface ErrorResponse {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | ServerError | ServerParseError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub;\n let retriedSub;\n let retriedResult;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable | null {\n return this.link.request(operation, forward);\n }\n}\n"],"names":["ApolloLink","Observable","tslib_1.__extends"],"mappings":";;;;;;WAgCgB,OAAO,CAAC,YAA0B;MAChD,OAAO,IAAIA,qBAAU,CAAC,UAAC,SAAS,EAAE,OAAO;UACvC,OAAO,IAAIC,qBAAU,CAAC,UAAA,QAAQ;cAC5B,IAAI,GAAG,CAAC;cACR,IAAI,UAAU,CAAC;cACf,IAAI,aAAa,CAAC;cAElB,IAAI;kBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;sBACjC,IAAI,EAAE,UAAA,MAAM;0BACV,IAAI,MAAM,CAAC,MAAM,EAAE;8BACjB,aAAa,GAAG,YAAY,CAAC;kCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;kCAC5B,QAAQ,EAAE,MAAM;kCAChB,SAAS,WAAA;kCACT,OAAO,SAAA;+BACR,CAAC,CAAC;8BAEH,IAAI,aAAa,EAAE;kCACjB,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;sCACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;sCAClC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;sCACpC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;mCAC3C,CAAC,CAAC;kCACH,OAAO;+BACR;2BACF;0BACD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;uBACvB;sBACD,KAAK,EAAE,UAAA,YAAY;0BACjB,aAAa,GAAG,YAAY,CAAC;8BAC3B,SAAS,WAAA;8BACT,YAAY,cAAA;8BAEZ,aAAa,EACX,YAAY;kCACZ,YAAY,CAAC,MAAM;kCACnB,YAAY,CAAC,MAAM,CAAC,MAAM;8BAC5B,OAAO,SAAA;2BACR,CAAC,CAAC;0BACH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apollo-link-error/lib/index.d.ts b/node_modules/apollo-link-error/lib/index.d.ts new file mode 100644 index 000000000..c959f0792 --- /dev/null +++ b/node_modules/apollo-link-error/lib/index.d.ts @@ -0,0 +1,23 @@ +import { ApolloLink, Observable, Operation, NextLink, FetchResult } from 'apollo-link'; +import { GraphQLError, ExecutionResult } from 'graphql'; +import { ServerError, ServerParseError } from 'apollo-link-http-common'; +export interface ErrorResponse { + graphQLErrors?: ReadonlyArray; + networkError?: Error | ServerError | ServerParseError; + response?: ExecutionResult; + operation: Operation; + forward: NextLink; +} +export declare namespace ErrorLink { + interface ErrorHandler { + (error: ErrorResponse): Observable | void; + } +} +export import ErrorHandler = ErrorLink.ErrorHandler; +export declare function onError(errorHandler: ErrorHandler): ApolloLink; +export declare class ErrorLink extends ApolloLink { + private link; + constructor(errorHandler: ErrorLink.ErrorHandler); + request(operation: Operation, forward: NextLink): Observable | null; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.d.ts.map b/node_modules/apollo-link-error/lib/index.d.ts.map new file mode 100644 index 000000000..503f24f17 --- /dev/null +++ b/node_modules/apollo-link-error/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACtD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,yBAAiB,SAAS,CAAC;IAIzB,UAAiB,YAAY;QAC3B,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;KACxD;CACF;AAGD,MAAM,QAAQ,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;AAEpD,wBAAgB,OAAO,CAAC,YAAY,EAAE,YAAY,GAAG,UAAU,CAqE9D;AAED,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,IAAI,CAAa;gBACb,YAAY,EAAE,SAAS,CAAC,YAAY;IAKzC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.js b/node_modules/apollo-link-error/lib/index.js new file mode 100644 index 000000000..5d4419040 --- /dev/null +++ b/node_modules/apollo-link-error/lib/index.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +function onError(errorHandler) { + return new apollo_link_1.ApolloLink(function (operation, forward) { + return new apollo_link_1.Observable(function (observer) { + var sub; + var retriedSub; + var retriedResult; + try { + sub = forward(operation).subscribe({ + next: function (result) { + if (result.errors) { + retriedResult = errorHandler({ + graphQLErrors: result.errors, + response: result, + operation: operation, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + } + observer.next(result); + }, + error: function (networkError) { + retriedResult = errorHandler({ + operation: operation, + networkError: networkError, + graphQLErrors: networkError && + networkError.result && + networkError.result.errors, + forward: forward, + }); + if (retriedResult) { + retriedSub = retriedResult.subscribe({ + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer), + }); + return; + } + observer.error(networkError); + }, + complete: function () { + if (!retriedResult) { + observer.complete.bind(observer)(); + } + }, + }); + } + catch (e) { + errorHandler({ networkError: e, operation: operation, forward: forward }); + observer.error(e); + } + return function () { + if (sub) + sub.unsubscribe(); + if (retriedSub) + sub.unsubscribe(); + }; + }); + }); +} +exports.onError = onError; +var ErrorLink = (function (_super) { + tslib_1.__extends(ErrorLink, _super); + function ErrorLink(errorHandler) { + var _this = _super.call(this) || this; + _this.link = onError(errorHandler); + return _this; + } + ErrorLink.prototype.request = function (operation, forward) { + return this.link.request(operation, forward); + }; + return ErrorLink; +}(apollo_link_1.ApolloLink)); +exports.ErrorLink = ErrorLink; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.js.map b/node_modules/apollo-link-error/lib/index.js.map new file mode 100644 index 000000000..cc5d05508 --- /dev/null +++ b/node_modules/apollo-link-error/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,2CAMqB;AAwBrB,SAAgB,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,wBAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IAAI,wBAAU,CAAC,UAAA,QAAQ;YAC5B,IAAI,GAAG,CAAC;YACR,IAAI,UAAU,CAAC;YACf,IAAI,aAAa,CAAC;YAElB,IAAI;gBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;oBACjC,IAAI,EAAE,UAAA,MAAM;wBACV,IAAI,MAAM,CAAC,MAAM,EAAE;4BACjB,aAAa,GAAG,YAAY,CAAC;gCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,MAAM;gCAChB,SAAS,WAAA;gCACT,OAAO,SAAA;6BACR,CAAC,CAAC;4BAEH,IAAI,aAAa,EAAE;gCACjB,UAAU,GAAG,aAAa,CAAC,SAAS,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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACnB;YAED,OAAO;gBACL,IAAI,GAAG;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,UAAU;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AArED,0BAqEC;AAED;IAA+B,qCAAU;IAEvC,mBAAY,YAAoC;QAAhD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;IACpC,CAAC;IAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IACH,gBAAC;AAAD,CAAC,AAbD,CAA+B,wBAAU,GAaxC;AAbY,8BAAS"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/package.json b/node_modules/apollo-link-error/package.json new file mode 100644 index 000000000..02c334c5d --- /dev/null +++ b/node_modules/apollo-link-error/package.json @@ -0,0 +1,61 @@ +{ + "name": "apollo-link-error", + "version": "1.1.11", + "description": "Error Apollo Link for GraphQL Network Stack", + "author": "James Baxley ", + "license": "MIT", + "main": "./lib/index.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-link.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-link/issues" + }, + "homepage": "https://github.com/apollographql/apollo-link#readme", + "scripts": { + "build": "tsc && rollup -c", + "clean": "rimraf lib/* && rimraf coverage/*", + "coverage": "jest --coverage", + "filesize": "../../scripts/minify", + "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", + "prebuild": "npm run clean", + "prepare": "npm run build", + "test": "npm run lint && jest", + "watch": "tsc -w -p . & rollup -c -w" + }, + "dependencies": { + "apollo-link": "^1.2.12", + "apollo-link-http-common": "^0.2.14", + "tslib": "^1.9.3" + }, + "devDependencies": { + "@types/graphql": "14.2.0", + "@types/jest": "24.0.14", + "graphql": "14.3.1", + "graphql-tag": "2.10.1", + "jest": "24.8.0", + "rimraf": "2.6.3", + "rollup": "1.15.4", + "ts-jest": "22.4.6", + "tslint": "5.17.0", + "typescript": "3.0.3" + }, + "jest": { + "transform": { + ".(ts|tsx)": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], + "testURL": "http://localhost" + }, + "gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" +} diff --git a/node_modules/apollo-link-http-common/CHANGELOG.md b/node_modules/apollo-link-http-common/CHANGELOG.md new file mode 100644 index 000000000..227e016eb --- /dev/null +++ b/node_modules/apollo-link-http-common/CHANGELOG.md @@ -0,0 +1,31 @@ +# Change log + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). + +---- + +### 0.2.6 + +- No changes + +### 0.2.5 +- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
+ [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) + +### 0.2.4 +- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) + +### v0.2.3 +- correct the warning message on no fetch found to node-fetch[PR#526](https://github.com/apollographql/apollo-link/pull/526) + +### v0.2.2 +- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) + +### v0.2.1 +- Apollo link upgrade + +### v0.2.0 +- rename serializeFetchBody to serializeFetchParameter and take a label argument diff --git a/node_modules/apollo-link-http-common/LICENSE b/node_modules/apollo-link-http-common/LICENSE new file mode 100644 index 000000000..07ea66258 --- /dev/null +++ b/node_modules/apollo-link-http-common/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - 2017 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/apollo-link-http-common/README.md b/node_modules/apollo-link-http-common/README.md new file mode 100644 index 000000000..9dd9a16a7 --- /dev/null +++ b/node_modules/apollo-link-http-common/README.md @@ -0,0 +1,9 @@ +--- +title: apollo-link-http-common +description: Http utilities shared across Apollo Links +--- + +This repository is used in apollo-link-http and apollo-link-http-batch. The +package is public to allow easier development of links that will be a part of +the main repository. Developers using this package should know that the api +will change and versions may not follow SemVer. diff --git a/node_modules/apollo-link-http-common/lib/bundle.cjs.js b/node_modules/apollo-link-http-common/lib/bundle.cjs.js new file mode 100644 index 000000000..60b8d2988 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.cjs.js @@ -0,0 +1,136 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var tslib = require('tslib'); +var printer = require('graphql/language/printer'); +var tsInvariant = require('ts-invariant'); + +var defaultHttpOptions = { + includeQuery: true, + includeExtensions: false, +}; +var defaultHeaders = { + accept: '*/*', + 'content-type': 'application/json', +}; +var defaultOptions = { + method: 'POST', +}; +var fallbackHttpConfig = { + http: defaultHttpOptions, + headers: defaultHeaders, + options: defaultOptions, +}; +var throwServerError = function (response, result, message) { + var error = new Error(message); + error.name = 'ServerError'; + error.response = response; + error.statusCode = response.status; + error.result = result; + throw error; +}; +var parseAndCheckHttpResponse = function (operations) { return function (response) { + return (response + .text() + .then(function (bodyText) { + try { + return JSON.parse(bodyText); + } + catch (err) { + var parseError = err; + parseError.name = 'ServerParseError'; + parseError.response = response; + parseError.statusCode = response.status; + parseError.bodyText = bodyText; + return Promise.reject(parseError); + } + }) + .then(function (result) { + if (response.status >= 300) { + throwServerError(response, result, "Response not successful: Received status code " + response.status); + } + if (!Array.isArray(result) && + !result.hasOwnProperty('data') && + !result.hasOwnProperty('errors')) { + throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) + ? operations.map(function (op) { return op.operationName; }) + : operations.operationName) + "'."); + } + return result; + })); +}; }; +var checkFetcher = function (fetcher) { + if (!fetcher && typeof fetch === 'undefined') { + var library = 'unfetch'; + if (typeof window === 'undefined') + library = 'node-fetch'; + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); + } +}; +var createSignalIfSupported = function () { + if (typeof AbortController === 'undefined') + return { controller: false, signal: false }; + var controller = new AbortController(); + var signal = controller.signal; + return { controller: controller, signal: signal }; +}; +var selectHttpOptionsAndBody = function (operation, fallbackConfig) { + var configs = []; + for (var _i = 2; _i < arguments.length; _i++) { + configs[_i - 2] = arguments[_i]; + } + var options = tslib.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); + var http = fallbackConfig.http; + configs.forEach(function (config) { + options = tslib.__assign({}, options, config.options, { headers: tslib.__assign({}, options.headers, config.headers) }); + if (config.credentials) + options.credentials = config.credentials; + http = tslib.__assign({}, http, config.http); + }); + var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; + var body = { operationName: operationName, variables: variables }; + if (http.includeExtensions) + body.extensions = extensions; + if (http.includeQuery) + body.query = printer.print(query); + return { + options: options, + body: body, + }; +}; +var serializeFetchParameter = function (p, label) { + var serialized; + try { + serialized = JSON.stringify(p); + } + catch (e) { + var parseError = process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); + parseError.parseError = e; + throw parseError; + } + return serialized; +}; +var selectURI = function (operation, fallbackURI) { + var context = operation.getContext(); + var contextURI = context.uri; + if (contextURI) { + return contextURI; + } + else if (typeof fallbackURI === 'function') { + return fallbackURI(operation); + } + else { + return fallbackURI || '/graphql'; + } +}; + +exports.checkFetcher = checkFetcher; +exports.createSignalIfSupported = createSignalIfSupported; +exports.fallbackHttpConfig = fallbackHttpConfig; +exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse; +exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody; +exports.selectURI = selectURI; +exports.serializeFetchParameter = serializeFetchParameter; +exports.throwServerError = throwServerError; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map b/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map new file mode 100644 index 000000000..04e914dd8 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __assign } from 'tslib';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nvar fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nvar throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\nvar parseAndCheckHttpResponse = function (operations) { return function (response) {\n return (response\n .text()\n .then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \" + response.status);\n }\n if (!Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')) {\n throwServerError(response, result, \"Server response was missing for query '\" + (Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName) + \"'.\");\n }\n return result;\n }));\n}; };\nvar checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n var library = 'unfetch';\n if (typeof window === 'undefined')\n library = 'node-fetch';\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(1) : new InvariantError(\"\\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\\nyour environment like https://www.npmjs.com/package/\" + library + \".\\n\\nFor example:\\nimport fetch from '\" + library + \"';\\nimport { createHttpLink } from 'apollo-link-http';\\n\\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });\");\n }\n};\nvar createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\nvar selectHttpOptionsAndBody = function (operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = __assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });\n var http = fallbackConfig.http;\n configs.forEach(function (config) {\n options = __assign({}, options, config.options, { headers: __assign({}, options.headers, config.headers) });\n if (config.credentials)\n options.credentials = config.credentials;\n http = __assign({}, http, config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = print(query);\n return {\n options: options,\n body: body,\n };\n};\nvar serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"Network request failed. \" + label + \" is not serializable: \" + e.message);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\nvar selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n\nexport { checkFetcher, createSignalIfSupported, fallbackHttpConfig, parseAndCheckHttpResponse, selectHttpOptionsAndBody, selectURI, serializeFetchParameter, throwServerError };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["InvariantError","__assign","print"],"mappings":";;;;;;;;AAIA,IAAI,kBAAkB,GAAG;IACrB,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CAC3B,CAAC;AACF,IAAI,cAAc,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACrC,CAAC;AACF,IAAI,cAAc,GAAG;IACjB,MAAM,EAAE,MAAM;CACjB,CAAC;AACF,AAAG,IAAC,kBAAkB,GAAG;IACrB,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CAC1B,CAAC;AACF,AAAG,IAA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AAI;KACb,CAAC;CACL,CAAC;AACF,AAAG,IAAC,uBAAuB,GAAG,UAAU,CAAC,EAAE,KAAK,EAAE;IAC9C,IAAI,UAAU,CAAC;IACf,IAAI;QACA,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAClC;IACD,OAAO,CAAC,EAAE;QACN,IAAI,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,IAAIF,0BAAc,CAAC,CAAC,CAAC,GAAG,IAAIA,0BAAc,CAAC,0BAA0B,GAAG,KAAK,GAAG,wBAAwB,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;QAC/K,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KACpB;IACD,OAAO,UAAU,CAAC;CACrB,CAAC;AACF,AAAG,IAAC,SAAS,GAAG,UAAU,SAAS,EAAE,WAAW,EAAE;IAC9C,IAAI,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACrC,IAAI,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAC7B,IAAI,UAAU,EAAE;QACZ,OAAO,UAAU,CAAC;KACrB;SACI,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QACxC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KACjC;SACI;QACD,OAAO,WAAW,IAAI,UAAU,CAAC;KACpC;CACJ;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/bundle.esm.js b/node_modules/apollo-link-http-common/lib/bundle.esm.js new file mode 100644 index 000000000..d84067e88 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.esm.js @@ -0,0 +1,125 @@ +import { __assign } from 'tslib'; +import { print } from 'graphql/language/printer'; +import { InvariantError } from 'ts-invariant'; + +var defaultHttpOptions = { + includeQuery: true, + includeExtensions: false, +}; +var defaultHeaders = { + accept: '*/*', + 'content-type': 'application/json', +}; +var defaultOptions = { + method: 'POST', +}; +var fallbackHttpConfig = { + http: defaultHttpOptions, + headers: defaultHeaders, + options: defaultOptions, +}; +var throwServerError = function (response, result, message) { + var error = new Error(message); + error.name = 'ServerError'; + error.response = response; + error.statusCode = response.status; + error.result = result; + throw error; +}; +var parseAndCheckHttpResponse = function (operations) { return function (response) { + return (response + .text() + .then(function (bodyText) { + try { + return JSON.parse(bodyText); + } + catch (err) { + var parseError = err; + parseError.name = 'ServerParseError'; + parseError.response = response; + parseError.statusCode = response.status; + parseError.bodyText = bodyText; + return Promise.reject(parseError); + } + }) + .then(function (result) { + if (response.status >= 300) { + throwServerError(response, result, "Response not successful: Received status code " + response.status); + } + if (!Array.isArray(result) && + !result.hasOwnProperty('data') && + !result.hasOwnProperty('errors')) { + throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) + ? operations.map(function (op) { return op.operationName; }) + : operations.operationName) + "'."); + } + return result; + })); +}; }; +var checkFetcher = function (fetcher) { + if (!fetcher && typeof fetch === 'undefined') { + var library = 'unfetch'; + if (typeof window === 'undefined') + library = 'node-fetch'; + throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); + } +}; +var createSignalIfSupported = function () { + if (typeof AbortController === 'undefined') + return { controller: false, signal: false }; + var controller = new AbortController(); + var signal = controller.signal; + return { controller: controller, signal: signal }; +}; +var selectHttpOptionsAndBody = function (operation, fallbackConfig) { + var configs = []; + for (var _i = 2; _i < arguments.length; _i++) { + configs[_i - 2] = arguments[_i]; + } + var options = __assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); + var http = fallbackConfig.http; + configs.forEach(function (config) { + options = __assign({}, options, config.options, { headers: __assign({}, options.headers, config.headers) }); + if (config.credentials) + options.credentials = config.credentials; + http = __assign({}, http, config.http); + }); + var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; + var body = { operationName: operationName, variables: variables }; + if (http.includeExtensions) + body.extensions = extensions; + if (http.includeQuery) + body.query = print(query); + return { + options: options, + body: body, + }; +}; +var serializeFetchParameter = function (p, label) { + var serialized; + try { + serialized = JSON.stringify(p); + } + catch (e) { + var parseError = process.env.NODE_ENV === "production" ? new InvariantError(2) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message); + parseError.parseError = e; + throw parseError; + } + return serialized; +}; +var selectURI = function (operation, fallbackURI) { + var context = operation.getContext(); + var contextURI = context.uri; + if (contextURI) { + return contextURI; + } + else if (typeof fallbackURI === 'function') { + return fallbackURI(operation); + } + else { + return fallbackURI || '/graphql'; + } +}; + +export { checkFetcher, createSignalIfSupported, fallbackHttpConfig, parseAndCheckHttpResponse, selectHttpOptionsAndBody, selectURI, serializeFetchParameter, throwServerError }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.esm.js.map b/node_modules/apollo-link-http-common/lib/bundle.esm.js.map new file mode 100644 index 000000000..3f49c5927 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new InvariantError(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n"],"names":[],"mappings":";;;;AA2FA,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM;CACf,CAAC;AAEF,IAAa,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC;AAEF,IAAa,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;IAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAEtB,MAAM,KAAK,CAAC;CACb,CAAC;AAGF,IAAa,yBAAyB,GAAG,UAAA,UAAU,IAAI,OAAA,UAAC,QAAkB;IACxE,QACE,QAAQ;S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AAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAE1D,OAAO;QACL,OAAO,SAAA;QACP,IAAI,MAAA;KACL,CAAC;CACH,CAAC;AAEF,IAAa,uBAAuB,GAAG,UAAC,CAAC,EAAE,KAAK;IAC9C,IAAI,UAAU,CAAC;IACf,IAAI;QACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,mFACwC;QAE3D,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;CACnB,CAAC;AAGF,IAAa,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;IAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE/B,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;CACF;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/bundle.umd.js b/node_modules/apollo-link-http-common/lib/bundle.umd.js new file mode 100644 index 000000000..d793a6687 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.umd.js @@ -0,0 +1,138 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('graphql/language/printer'), require('ts-invariant')) : + typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'graphql/language/printer', 'ts-invariant'], factory) : + (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.httpCommon = {}), global.tslib, global.graphql.printer, global.invariant)); +}(this, function (exports, tslib_1, printer, tsInvariant) { 'use strict'; + + var defaultHttpOptions = { + includeQuery: true, + includeExtensions: false, + }; + var defaultHeaders = { + accept: '*/*', + 'content-type': 'application/json', + }; + var defaultOptions = { + method: 'POST', + }; + var fallbackHttpConfig = { + http: defaultHttpOptions, + headers: defaultHeaders, + options: defaultOptions, + }; + var throwServerError = function (response, result, message) { + var error = new Error(message); + error.name = 'ServerError'; + error.response = response; + error.statusCode = response.status; + error.result = result; + throw error; + }; + var parseAndCheckHttpResponse = function (operations) { return function (response) { + return (response + .text() + .then(function (bodyText) { + try { + return JSON.parse(bodyText); + } + catch (err) { + var parseError = err; + parseError.name = 'ServerParseError'; + parseError.response = response; + parseError.statusCode = response.status; + parseError.bodyText = bodyText; + return Promise.reject(parseError); + } + }) + .then(function (result) { + if (response.status >= 300) { + throwServerError(response, result, "Response not successful: Received status code " + response.status); + } + if (!Array.isArray(result) && + !result.hasOwnProperty('data') && + !result.hasOwnProperty('errors')) { + throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) + ? operations.map(function (op) { return op.operationName; }) + : operations.operationName) + "'."); + } + return result; + })); + }; }; + var checkFetcher = function (fetcher) { + if (!fetcher && typeof fetch === 'undefined') { + var library = 'unfetch'; + if (typeof window === 'undefined') + library = 'node-fetch'; + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); + } + }; + var createSignalIfSupported = function () { + if (typeof AbortController === 'undefined') + return { controller: false, signal: false }; + var controller = new AbortController(); + var signal = controller.signal; + return { controller: controller, signal: signal }; + }; + var selectHttpOptionsAndBody = function (operation, fallbackConfig) { + var configs = []; + for (var _i = 2; _i < arguments.length; _i++) { + configs[_i - 2] = arguments[_i]; + } + var options = tslib_1.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); + var http = fallbackConfig.http; + configs.forEach(function (config) { + options = tslib_1.__assign({}, options, config.options, { headers: tslib_1.__assign({}, options.headers, config.headers) }); + if (config.credentials) + options.credentials = config.credentials; + http = tslib_1.__assign({}, http, config.http); + }); + var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; + var body = { operationName: operationName, variables: variables }; + if (http.includeExtensions) + body.extensions = extensions; + if (http.includeQuery) + body.query = printer.print(query); + return { + options: options, + body: body, + }; + }; + var serializeFetchParameter = function (p, label) { + var serialized; + try { + serialized = JSON.stringify(p); + } + catch (e) { + var parseError = process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); + parseError.parseError = e; + throw parseError; + } + return serialized; + }; + var selectURI = function (operation, fallbackURI) { + var context = operation.getContext(); + var contextURI = context.uri; + if (contextURI) { + return contextURI; + } + else if (typeof fallbackURI === 'function') { + return fallbackURI(operation); + } + else { + return fallbackURI || '/graphql'; + } + }; + + exports.checkFetcher = checkFetcher; + exports.createSignalIfSupported = createSignalIfSupported; + exports.fallbackHttpConfig = fallbackHttpConfig; + exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse; + exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody; + exports.selectURI = selectURI; + exports.serializeFetchParameter = serializeFetchParameter; + exports.throwServerError = throwServerError; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.umd.js.map b/node_modules/apollo-link-http-common/lib/bundle.umd.js.map new file mode 100644 index 000000000..11b1613ef --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: GlobalFetch['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: GlobalFetch['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new InvariantError(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n"],"names":["print"],"mappings":";;;;;;EA2FA,IAAM,kBAAkB,GAAqB;MAC3C,YAAY,EAAE,IAAI;MAClB,iBAAiB,EAAE,KAAK;GACzB,CAAC;EAEF,IAAM,cAAc,GAAG;MAErB,MAAM,EAAE,KAAK;MACb,cAAc,EAAE,kBAAkB;GACnC,CAAC;EAEF,IAAM,cAAc,GAAG;MACrB,MAAM,EAAE,MAAM;GACf,CAAC;AAEF,MAAa,kBAAkB,GAAG;MAChC,IAAI,EAAE,kBAAkB;MACxB,OAAO,EAAE,cAAc;MACvB,OAAO,EAAE,cAAc;GACxB,CAAC;AAEF,MAAa,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;MACxD,IAAM,KAAK,GAAG,IAAI,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index.d.ts b/node_modules/apollo-link-http-common/lib/index.d.ts new file mode 100644 index 000000000..db8e1ef07 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/index.d.ts @@ -0,0 +1,66 @@ +import { Operation } from 'apollo-link'; +import { InvariantError } from 'ts-invariant'; +export declare type ServerError = Error & { + response: Response; + result: Record; + statusCode: number; +}; +export declare type ServerParseError = Error & { + response: Response; + statusCode: number; + bodyText: string; +}; +export declare type ClientParseError = InvariantError & { + parseError: Error; +}; +export interface HttpQueryOptions { + includeQuery?: boolean; + includeExtensions?: boolean; +} +export interface HttpConfig { + http?: HttpQueryOptions; + options?: any; + headers?: any; + credentials?: any; +} +export interface UriFunction { + (operation: Operation): string; +} +export interface Body { + query?: string; + operationName?: string; + variables?: Record; + extensions?: Record; +} +export interface HttpOptions { + uri?: string | UriFunction; + includeExtensions?: boolean; + fetch?: GlobalFetch['fetch']; + headers?: any; + credentials?: string; + fetchOptions?: any; +} +export declare const fallbackHttpConfig: { + http: HttpQueryOptions; + headers: { + accept: string; + 'content-type': string; + }; + options: { + method: string; + }; +}; +export declare const throwServerError: (response: any, result: any, message: any) => never; +export declare const parseAndCheckHttpResponse: (operations: any) => (response: Response) => Promise; +export declare const checkFetcher: (fetcher: (input?: string | Request, init?: RequestInit) => Promise) => void; +export declare const createSignalIfSupported: () => { + controller: any; + signal: any; +}; +export declare const selectHttpOptionsAndBody: (operation: Operation, fallbackConfig: HttpConfig, ...configs: HttpConfig[]) => { + options: HttpConfig & Record; + body: Body; +}; +export declare const serializeFetchParameter: (p: any, label: any) => any; +export declare const selectURI: (operation: any, fallbackURI?: string | ((operation: Operation) => string)) => any; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.d.ts.map b/node_modules/apollo-link-http-common/lib/index.d.ts.map new file mode 100644 index 000000000..4f69f5054 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts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,OAAO,CAAC;IAK5B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAK7B,OAAO,CAAC,EAAE,GAAG,CAAC;IAKd,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB;AAiBD,eAAO,MAAM,kBAAkB;;;;;;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,qDAS5B,CAAC;AAGF,eAAO,MAAM,yBAAyB,2DA+CrC,CAAC;AAEF,eAAO,MAAM,YAAY,wFAcxB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;CAOnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CA8CpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,6BAYnC,CAAC;AAGF,eAAO,MAAM,SAAS,oFAcrB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.js b/node_modules/apollo-link-http-common/lib/index.js new file mode 100644 index 000000000..05cd0958e --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/index.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var printer_1 = require("graphql/language/printer"); +var ts_invariant_1 = require("ts-invariant"); +var defaultHttpOptions = { + includeQuery: true, + includeExtensions: false, +}; +var defaultHeaders = { + accept: '*/*', + 'content-type': 'application/json', +}; +var defaultOptions = { + method: 'POST', +}; +exports.fallbackHttpConfig = { + http: defaultHttpOptions, + headers: defaultHeaders, + options: defaultOptions, +}; +exports.throwServerError = function (response, result, message) { + var error = new Error(message); + error.name = 'ServerError'; + error.response = response; + error.statusCode = response.status; + error.result = result; + throw error; +}; +exports.parseAndCheckHttpResponse = function (operations) { return function (response) { + return (response + .text() + .then(function (bodyText) { + try { + return JSON.parse(bodyText); + } + catch (err) { + var parseError = err; + parseError.name = 'ServerParseError'; + parseError.response = response; + parseError.statusCode = response.status; + parseError.bodyText = bodyText; + return Promise.reject(parseError); + } + }) + .then(function (result) { + if (response.status >= 300) { + exports.throwServerError(response, result, "Response not successful: Received status code " + response.status); + } + if (!Array.isArray(result) && + !result.hasOwnProperty('data') && + !result.hasOwnProperty('errors')) { + exports.throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) + ? operations.map(function (op) { return op.operationName; }) + : operations.operationName) + "'."); + } + return result; + })); +}; }; +exports.checkFetcher = function (fetcher) { + if (!fetcher && typeof fetch === 'undefined') { + var library = 'unfetch'; + if (typeof window === 'undefined') + library = 'node-fetch'; + throw new ts_invariant_1.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); + } +}; +exports.createSignalIfSupported = function () { + if (typeof AbortController === 'undefined') + return { controller: false, signal: false }; + var controller = new AbortController(); + var signal = controller.signal; + return { controller: controller, signal: signal }; +}; +exports.selectHttpOptionsAndBody = function (operation, fallbackConfig) { + var configs = []; + for (var _i = 2; _i < arguments.length; _i++) { + configs[_i - 2] = arguments[_i]; + } + var options = tslib_1.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); + var http = fallbackConfig.http; + configs.forEach(function (config) { + options = tslib_1.__assign({}, options, config.options, { headers: tslib_1.__assign({}, options.headers, config.headers) }); + if (config.credentials) + options.credentials = config.credentials; + http = tslib_1.__assign({}, http, config.http); + }); + var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; + var body = { operationName: operationName, variables: variables }; + if (http.includeExtensions) + body.extensions = extensions; + if (http.includeQuery) + body.query = printer_1.print(query); + return { + options: options, + body: body, + }; +}; +exports.serializeFetchParameter = function (p, label) { + var serialized; + try { + serialized = JSON.stringify(p); + } + catch (e) { + var parseError = new ts_invariant_1.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); + parseError.parseError = e; + throw parseError; + } + return serialized; +}; +exports.selectURI = function (operation, fallbackURI) { + var context = operation.getContext(); + var contextURI = context.uri; + if (contextURI) { + return contextURI; + } + else if (typeof fallbackURI === 'function') { + return fallbackURI(operation); + } + else { + return fallbackURI || '/graphql'; + } +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.js.map b/node_modules/apollo-link-http-common/lib/index.js.map new file mode 100644 index 000000000..417de6887 --- /dev/null +++ b/node_modules/apollo-link-http-common/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oDAAiD;AACjD,6CAA8C;AAyF9C,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM;CACf,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC;AAEW,QAAA,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;IAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAEtB,MAAM,KAAK,CAAC;AACd,CAAC,CAAC;AAGW,QAAA,yBAAyB,GAAG,UAAA,UAAU,IAAI,OAAA,UAAC,QAAkB;IACxE,OAAO,CACL,QAAQ;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Aa,eAAA,EAAE,SAAS,WAAA,EAAE,CAAC;IAEhD,IAAI,IAAI,CAAC,iBAAiB;QAAG,IAAY,CAAC,UAAU,GAAG,UAAU,CAAC;IAGlE,IAAI,IAAI,CAAC,YAAY;QAAG,IAAY,CAAC,KAAK,GAAG,eAAK,CAAC,KAAK,CAAC,CAAC;IAE1D,OAAO;QACL,OAAO,SAAA;QACP,IAAI,MAAA;KACL,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,uBAAuB,GAAG,UAAC,CAAC,EAAE,KAAK;IAC9C,IAAI,UAAU,CAAC;IACf,IAAI;QACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,IAAI,6BAAc,CACnC,6BAA2B,KAAK,8BAAyB,CAAC,CAAC,OAAS,CACjD,CAAC;QACtB,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAGW,QAAA,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;IAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE/B,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/package.json b/node_modules/apollo-link-http-common/package.json new file mode 100644 index 000000000..1c1507caf --- /dev/null +++ b/node_modules/apollo-link-http-common/package.json @@ -0,0 +1,71 @@ +{ + "name": "apollo-link-http-common", + "version": "0.2.14", + "description": "Http utilities for Apollo Link shared across all links using http", + "main": "./lib/index.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "scripts": { + "build": "tsc && rollup -c", + "clean": "rimraf lib/* && rimraf coverage/*", + "coverage": "jest --coverage", + "filesize": "../../scripts/minify", + "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", + "prebuild": "npm run clean", + "prepare": "npm run build", + "test": "npm run lint && jest", + "watch": "tsc -w -p . & rollup -c -w" + }, + "keywords": [ + "apollo", + "http", + "network" + ], + "author": "Evans Hauser", + "license": "MIT", + "dependencies": { + "apollo-link": "^1.2.12", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "peerDependencies": { + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "devDependencies": { + "@types/graphql": "14.2.0", + "@types/jest": "24.0.14", + "fetch-mock": "6.5.2", + "graphql": "14.3.1", + "graphql-tag": "2.10.1", + "jest": "24.8.0", + "object-to-querystring": "1.0.8", + "rimraf": "2.6.3", + "rollup": "1.15.4", + "ts-jest": "22.4.6", + "tslint": "5.17.0", + "typescript": "3.0.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-link.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-link/issues" + }, + "homepage": "https://github.com/apollographql/apollo-link#readme", + "jest": { + "transform": { + ".(ts|tsx)": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], + "testURL": "http://localhost" + }, + "gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" +} diff --git a/node_modules/apollo-link-http/CHANGELOG.md b/node_modules/apollo-link-http/CHANGELOG.md new file mode 100644 index 000000000..33b0a2e00 --- /dev/null +++ b/node_modules/apollo-link-http/CHANGELOG.md @@ -0,0 +1,85 @@ +# Change log + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). + +---- + +### 1.5.7 + +- Fix a bug where empty `apollographql-client-name` and + `apollographql-client-version` headers were being included with requests + when they weren't set in the `context` based `clientAwareness` object.
+ [@hwillson](http://github.com/hwillson) in [#872](https://github.com/apollographql/apollo-link/pull/872) + +### 1.5.6 + +- If `name` or `version` client awareness settings are found in the + incoming `operation` `context`, they'll be extracted and added as headers + to all outgoing requests. The header names used (`apollographql-client-name` + and `apollographql-client-version`) line up with the associated Apollo Server + changes made in https://github.com/apollographql/apollo-server/pull/1960.
+ [@hwillson](http://github.com/hwillson) in [#872](https://github.com/apollographql/apollo-link/pull/872) + +### 1.5.5 +- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
+ [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) + +### 1.5.4 +- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) +- Check for signal already present on `fetchOptions` [#584](https://github.com/apollographql/apollo-link/pull/584) + +### 1.5.3 +- updated dependency on `apolloLink.httpCommon` [#522](https://github.com/apollographql/apollo-link/pull/522) + +### 1.5.2 +- fix issue where execution result with only `errors` key fired the `next` event +- Add missing rollup alias and make http-common exported as `apolloLink.httpCommon` [#522](https://github.com/apollographql/apollo-link/pull/522) + +### 1.5.1 +- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) + +### 1.5.0 +- New useGETForQueries option: if set, uses GET for queries (but not mutations) + +### 1.4.0 +- move logic to apollo-link-http-core [PR#364](https://github.com/apollographql/apollo-link/pull/364) +- follow the spec properly for GET requests [PR#490](https://github.com/apollographql/apollo-link/pull/490) +- ApolloLink upgrade + +### 1.3.3 +- ApolloLink upgrade +- Allow graphql results to fire even if there is a network error + +### 1.3.2 +- Update to graphql@0.12 + +### 1.3.1 +- export options as named interface [TypeScript] +- Fix typescript bug with destructuring of parameter in createHttpLink ([#189](https://github.com/apollographql/apollo-link/issues/189)) + +### 1.3.0 +- changed to initially parsing response as text to improve error handling +- cleaned up error handling types and added docs +- changed peer-dependency of apollo-link to actual dependency + +### 1.2.0 +- moved to better rollup build +- support for persisted queries by opting out of sending the query + +### v1.1.0 +- support dynamic endpoints using `uri` on the context +- the request not attaches the raw response as `response` on the context. This can be used to access response headers or more + +### v1.0.0 +- official release, not changes + +### v0.9.0 +- changed `fetcherOptions` to be `fetchOptions` and added a test for using 'GET' requests + +### v0.8.0 +- throw error on empty ExectionResult (missing) +- support setting credentials, headers, and fetcherOptions in the setup of the link +- removed sending of context to the server and allowed opt-in of sending extensions diff --git a/node_modules/apollo-link-http/LICENSE b/node_modules/apollo-link-http/LICENSE new file mode 100644 index 000000000..07ea66258 --- /dev/null +++ b/node_modules/apollo-link-http/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - 2017 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/apollo-link-http/README.md b/node_modules/apollo-link-http/README.md new file mode 100644 index 000000000..8980ec898 --- /dev/null +++ b/node_modules/apollo-link-http/README.md @@ -0,0 +1,315 @@ +--- +title: apollo-link-http +description: Get GraphQL results over a network using HTTP fetch. +--- + +The http link is the most common Apollo Link, a system of modular components +for GraphQL networking. If you haven't done so already, [read the Apollo Link +docs](https://www.apollographql.com/docs/link/#usage) to learn about the Apollo +Link ecosystem and how to use this link with libraries like Apollo Client and +graphql-tools, or as a standalone client. + +The http link is a terminating link that fetches GraphQL results from a GraphQL +endpoint over an http connection. The http link supports both POST and GET +requests with the ability to change the http options on a per query basis. This +can be used for authentication, persisted queries, dynamic uris, and other +granular updates. + +

Usage

+ +Import and initialize this link in just two lines: + +```js +import { createHttpLink } from "apollo-link-http"; + +const link = createHttpLink({ uri: "/graphql" }); +``` + +

Options

+ +HTTP Link takes an object with some options on it to customize the behavior of the link. If your server supports it, the HTTP link can also send over metadata about the request in the extensions field. To enable this, pass `includeExtensions` as true. The options you can pass are outlined below: + +* `uri`: the URI key is a string endpoint or function resolving to an endpoint -- will default to "/graphql" if not specified +* `includeExtensions`: allow passing the extensions field to your graphql server, defaults to false +* `fetch`: a `fetch` compatible API for making a request +* `headers`: an object representing values to be sent as headers on the request +* `credentials`: a string representing the credentials policy you want for the fetch call. Possible values are: `omit`, `include` and `same-origin` +* `fetchOptions`: any overrides of the fetch options argument to pass to the fetch call +* `useGETForQueries`: set to `true` to use the HTTP `GET` method for queries (but not for mutations) + +

Fetch polyfill

+ +The HTTP Link relies on having `fetch` present in your runtime environment. If you are running on react-native, or modern browsers, this should be no problem. If you are targeting an environment without `fetch` such as older browsers or the server, you will need to pass your own `fetch` to the link through the options. We recommend [`unfetch`](https://github.com/developit/unfetch) for older browsers and [`node-fetch`](https://github.com/bitinn/node-fetch) for running in Node. + +

Context

+ +The Http Link uses the `headers` field on the context to allow passing headers to the HTTP request. It also supports the `credentials` field for defining credentials policy, `uri` for changing the endpoint dynamically, and `fetchOptions` to allow generic fetch overrides (i.e. `method: "GET"`). These options will override the same key if passed when creating the the link. + +Note that if you set `fetchOptions.method` to `GET`, the http link will follow the [standard GraphQL HTTP GET encoding](http://graphql.org/learn/serving-over-http/#get-request): the query, variables, operation name, and extensions will be passed as query parameters rather than in the HTTP request body. If you want mutations to continue to be sent as non-idempotent `POST` requests, set the top-level `useGETForQueries` option to `true` instead of setting `fetchOptions.method` to `GET`. + +This link also attaches the response from the `fetch` operation on the context as `response` so you can access it from within another link. + +* `headers`: an object representing values to be sent as headers on the request +* `credentials`: a string representing the credentials policy you want for the fetch call. Possible values are: `omit`, `include` and `same-origin` +* `uri`: a string of the endpoint you want to fetch from +* `fetchOptions`: any overrides of the fetch options argument to pass to the fetch call +* `response`: this is the raw response from the fetch request after it is made. +* `http`: this is an object to control fine grained aspects of the http link itself, such as persisted queries (see below) + +

Persisted queries

+ +The http link supports an advanced GraphQL feature called persisted queries. This allows you to not send the stringified query over the wire, but instead send some kind of identifier of the query. To support this you need to attach the id somewhere to the extensions field and pass the following options to the context: + +```js +operation.setContext({ + http: { + includeExtensions: true, + includeQuery: false, + } +}) +``` + +The `http` object on context currently supports two keys: + +* `includeExtensions`: Send the extensions object for this request. +* `includeQuery`: Don't send the `query` field for this request. + +One way to use persisted queries is with [apollo-link-persisted-queries](https://github.com/apollographql/apollo-link-persisted-queries) and [Apollo Engine](https://www.apollographql.com/docs/engine/auto-persisted-queries.html). + +

Passing context per query

+ +Apollo Client supports passing context separately for every query, so you can do things like pass a special header for a single query invocation if you need to. + +```js +import { createHttpLink } from "apollo-link-http"; +import ApolloClient from "apollo-client"; +import { InMemoryCache } from "apollo-cache-inmemory"; + +const client = new ApolloClient({ + link: createHttpLink({ uri: "/graphql" }), + cache: new InMemoryCache() +}); + +// a query with apollo-client +client.query({ + query: MY_QUERY, + context: { + // example of setting the headers with context per operation + headers: { + special: "Special header value" + } + } +}); +``` + +

Errors

+ +The Http Link draws a distinction between client, server and GraphQL errors. Server errors can occur in three different scenarios: parse, network and data errors. [`apollo-link-error`](error.html) provides an [interface](error.html#Usage) for handling these errors. This list describes the scenarios that cause different errors: + +* _Client parse error_: the request body is not-serializable due to circular references for example +* _Server parse error_: the response from the server cannot be parsed ([response.json()](https://developer.mozilla.org/en-US/docs/Web/API/Body/json)) +* _Server network error_: the response has a status of >= 300 +* _Server data error_: the parse request does not contain `data` or `errors` +* _GraphQL error_: an objects in the `errors` array for a 200 level status + +Since many server implementations can return a valid GraphQL result on a server network error, the thrown `Error` object contains the parsed server result. A server data error also receives the parsed result. + +The table below provides a summary of error, `Observable` method called by the HTTP link, and type of error thrown for each failure: + +| Error | Callback | Error Type | +| -------------- | :------: | ------------------ | +| Client Parse | `error` | `ClientParseError` | +| Server Parse | `error` | `ServerParseError` | +| Server Network | `error` | `ServerError` | +| Server Data | `error` | `ServerError` | +| GraphQL Error | `next` | `Object` | + +All error types inherit the `name`, `message`, and nullable `stack` properties from the generic javascript [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error). + +```js +//type ClientParseError +{ + parseError: Error; // Error returned from response.json() +}; + +//type ServerParseError +{ + response: Response; // Object returned from fetch() + statusCode: number; // HTTP status code + bodyText: string // text that was returned from server +}; + +//type ServerError +{ + result: Record; // Parsed object from server response + response: Response; // Object returned from fetch() + statusCode: number; // HTTP status code +}; +``` + +

Custom fetching

+ +You can use the `fetch` option when creating an http-link to do a lot of custom networking. This is useful if you want to modify the request based on the calculated headers or calculate the uri based on the operation: + +

Custom auth

+ +```js +const customFetch = (uri, options) => { + const { header } = Hawk.client.header( + "http://example.com:8000/resource/1?b=1&a=2", + "POST", + { credentials: credentials, ext: "some-app-data" } + ); + options.headers.Authorization = header; + return fetch(uri, options); +}; + +const link = createHttpLink({ fetch: customFetch }); +``` + +

Dynamic URI

+ +```js +const customFetch = (uri, options) => { + const { operationName } = JSON.parse(options.body); + return fetch(`${uri}/graph/graphql?opname=${operationName}`, options); +}; + +const link = createHttpLink({ fetch: customFetch }); +``` + +

Upgrade: Apollo Client 1.0

+ +If you previously used either `apollo-fetch` or `apollo-client`'s `createNetworkInterface`, you will need to change the way `use` and `useAfter` are implemented in your app. Both can be implemented by writing a custom link. It's important to note that regardless of whether you're adding middleware or afterware, your Http link will always be last in the chain since it's a terminating link. + +#### Middleware + +_Before_ + +```js +// before +import ApolloClient, { createNetworkInterface } from "apollo-client"; + +const networkInterface = createNetworkInterface({ uri: "/graphql" }); + +networkInterface.use([ + { + applyMiddleware(req, next) { + if (!req.options.headers) { + req.options.headers = {}; // Create the header object if needed. + } + req.options.headers["authorization"] = localStorage.getItem("token") + ? localStorage.getItem("token") + : null; + next(); + } + } +]); +``` + +_After_ + +```js +import { ApolloLink } from "apollo-link"; +import { createHttpLink } from "apollo-link-http"; + +const httpLink = createHttpLink({ uri: "/graphql" }); +const middlewareLink = new ApolloLink((operation, forward) => { + operation.setContext({ + headers: { + authorization: localStorage.getItem("token") || null + } + }); + return forward(operation); +}); + +// use with apollo-client +const link = middlewareLink.concat(httpLink); +``` + +#### Afterware (error) + +_Before_ + +```js +import ApolloClient, { createNetworkInterface } from "apollo-client"; +import { logout } from "./logout"; + +const networkInterface = createNetworkInterface({ uri: "/graphql" }); + +networkInterface.useAfter([ + { + applyAfterware({ response }, next) { + if (response.statusCode === 401) { + logout(); + } + next(); + } + } +]); +``` + +_After_ + +```js +import { ApolloLink } from "apollo-link"; +import { createHttpLink } from "apollo-link-http"; +import { onError } from "apollo-link-error"; + +import { logout } from "./logout"; + +const httpLink = createHttpLink({ uri: "/graphql" }); +const errorLink = onError(({ networkError }) => { + if (networkError.statusCode === 401) { + logout(); + } +}); + +// use with apollo-client +const link = errorLink.concat(httpLink); +``` + +#### Afterware (data manipulation) + +_Before_ + +```js +import ApolloClient, { createNetworkInterface } from "apollo-client"; + +const networkInterface = createNetworkInterface({ uri: "/graphql" }); + +networkInterface.useAfter([ + { + applyAfterware({ response }, next) { + if (response.data.user.lastLoginDate) { + response.data.user.lastLoginDate = new Date( + response.data.user.lastLoginDate + ); + } + next(); + } + } +]); +``` + +_After_ + +```js +import { ApolloLink } from "apollo-link"; +import { createHttpLink } from "apollo-link-http"; + +const httpLink = createHttpLink({ uri: "/graphql" }); +const addDatesLink = new ApolloLink((operation, forward) => { + return forward(operation).map(response => { + if (response.data.user.lastLoginDate) { + response.data.user.lastLoginDate = new Date( + response.data.user.lastLoginDate + ); + } + return response; + }); +}); + +// use with apollo-client +const link = addDatesLink.concat(httpLink); +``` diff --git a/node_modules/apollo-link-http/lib/bundle.cjs.js b/node_modules/apollo-link-http/lib/bundle.cjs.js new file mode 100644 index 000000000..8199fb782 --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.cjs.js @@ -0,0 +1,150 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var tslib = require('tslib'); +var apolloLink = require('apollo-link'); +var apolloLinkHttpCommon = require('apollo-link-http-common'); + +var createHttpLink = function (linkOptions) { + if (linkOptions === void 0) { linkOptions = {}; } + var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); + apolloLinkHttpCommon.checkFetcher(fetcher); + if (!fetcher) { + fetcher = fetch; + } + var linkConfig = { + http: { includeExtensions: includeExtensions }, + options: requestOptions.fetchOptions, + credentials: requestOptions.credentials, + headers: requestOptions.headers, + }; + return new apolloLink.ApolloLink(function (operation) { + var chosenURI = apolloLinkHttpCommon.selectURI(operation, uri); + var context = operation.getContext(); + var clientAwarenessHeaders = {}; + if (context.clientAwareness) { + var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; + if (name_1) { + clientAwarenessHeaders['apollographql-client-name'] = name_1; + } + if (version) { + clientAwarenessHeaders['apollographql-client-version'] = version; + } + } + var contextHeaders = tslib.__assign({}, clientAwarenessHeaders, context.headers); + var contextConfig = { + http: context.http, + options: context.fetchOptions, + credentials: context.credentials, + headers: contextHeaders, + }; + var _b = apolloLinkHttpCommon.selectHttpOptionsAndBody(operation, apolloLinkHttpCommon.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; + var controller; + if (!options.signal) { + var _c = apolloLinkHttpCommon.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; + controller = _controller; + if (controller) + options.signal = signal; + } + var definitionIsMutation = function (d) { + return d.kind === 'OperationDefinition' && d.operation === 'mutation'; + }; + if (useGETForQueries && + !operation.query.definitions.some(definitionIsMutation)) { + options.method = 'GET'; + } + if (options.method === 'GET') { + var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; + if (parseError) { + return apolloLink.fromError(parseError); + } + chosenURI = newURI; + } + else { + try { + options.body = apolloLinkHttpCommon.serializeFetchParameter(body, 'Payload'); + } + catch (parseError) { + return apolloLink.fromError(parseError); + } + } + return new apolloLink.Observable(function (observer) { + fetcher(chosenURI, options) + .then(function (response) { + operation.setContext({ response: response }); + return response; + }) + .then(apolloLinkHttpCommon.parseAndCheckHttpResponse(operation)) + .then(function (result) { + observer.next(result); + observer.complete(); + return result; + }) + .catch(function (err) { + if (err.name === 'AbortError') + return; + if (err.result && err.result.errors && err.result.data) { + observer.next(err.result); + } + observer.error(err); + }); + return function () { + if (controller) + controller.abort(); + }; + }); + }); +}; +function rewriteURIForGET(chosenURI, body) { + var queryParams = []; + var addQueryParam = function (key, value) { + queryParams.push(key + "=" + encodeURIComponent(value)); + }; + if ('query' in body) { + addQueryParam('query', body.query); + } + if (body.operationName) { + addQueryParam('operationName', body.operationName); + } + if (body.variables) { + var serializedVariables = void 0; + try { + serializedVariables = apolloLinkHttpCommon.serializeFetchParameter(body.variables, 'Variables map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('variables', serializedVariables); + } + if (body.extensions) { + var serializedExtensions = void 0; + try { + serializedExtensions = apolloLinkHttpCommon.serializeFetchParameter(body.extensions, 'Extensions map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('extensions', serializedExtensions); + } + var fragment = '', preFragment = chosenURI; + var fragmentStart = chosenURI.indexOf('#'); + if (fragmentStart !== -1) { + fragment = chosenURI.substr(fragmentStart); + preFragment = chosenURI.substr(0, fragmentStart); + } + var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; + var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; + return { newURI: newURI }; +} +var HttpLink = (function (_super) { + tslib.__extends(HttpLink, _super); + function HttpLink(opts) { + return _super.call(this, createHttpLink(opts).request) || this; + } + return HttpLink; +}(apolloLink.ApolloLink)); + +exports.HttpLink = HttpLink; +exports.createHttpLink = createHttpLink; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.cjs.js.map b/node_modules/apollo-link-http/lib/bundle.cjs.js.map new file mode 100644 index 000000000..5668deb1e --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"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;IACxC,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;IACjD,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,mBAA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CAC7B;AACD,AAAG,IAAC,QAAQ,IAAI,UAAU,MAAM,EAAE;IAC9BG,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5B,SAAS,QAAQ,CAAC,IAAI,EAAE;QACpB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;KAClE;IACD,OAAO,QAAQ,CAAC;CACnB,CAACV,qBAAU,CAAC,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/bundle.esm.js b/node_modules/apollo-link-http/lib/bundle.esm.js new file mode 100644 index 000000000..88fe95db4 --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.esm.js @@ -0,0 +1,145 @@ +import { __rest, __assign, __extends } from 'tslib'; +import { ApolloLink, fromError, Observable } from 'apollo-link'; +import { checkFetcher, selectURI, selectHttpOptionsAndBody, fallbackHttpConfig, createSignalIfSupported, serializeFetchParameter, parseAndCheckHttpResponse } from 'apollo-link-http-common'; + +var createHttpLink = function (linkOptions) { + if (linkOptions === void 0) { linkOptions = {}; } + 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"]); + checkFetcher(fetcher); + if (!fetcher) { + fetcher = fetch; + } + var linkConfig = { + http: { includeExtensions: includeExtensions }, + options: requestOptions.fetchOptions, + credentials: requestOptions.credentials, + headers: requestOptions.headers, + }; + return new ApolloLink(function (operation) { + var chosenURI = selectURI(operation, uri); + var context = operation.getContext(); + var clientAwarenessHeaders = {}; + if (context.clientAwareness) { + var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; + if (name_1) { + clientAwarenessHeaders['apollographql-client-name'] = name_1; + } + if (version) { + clientAwarenessHeaders['apollographql-client-version'] = version; + } + } + var contextHeaders = __assign({}, clientAwarenessHeaders, context.headers); + var contextConfig = { + http: context.http, + options: context.fetchOptions, + credentials: context.credentials, + headers: contextHeaders, + }; + var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; + var controller; + if (!options.signal) { + var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; + controller = _controller; + if (controller) + options.signal = signal; + } + var definitionIsMutation = function (d) { + return d.kind === 'OperationDefinition' && d.operation === 'mutation'; + }; + if (useGETForQueries && + !operation.query.definitions.some(definitionIsMutation)) { + options.method = 'GET'; + } + if (options.method === 'GET') { + var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; + if (parseError) { + return fromError(parseError); + } + chosenURI = newURI; + } + else { + try { + options.body = serializeFetchParameter(body, 'Payload'); + } + catch (parseError) { + return fromError(parseError); + } + } + return new Observable(function (observer) { + fetcher(chosenURI, options) + .then(function (response) { + operation.setContext({ response: response }); + return response; + }) + .then(parseAndCheckHttpResponse(operation)) + .then(function (result) { + observer.next(result); + observer.complete(); + return result; + }) + .catch(function (err) { + if (err.name === 'AbortError') + return; + if (err.result && err.result.errors && err.result.data) { + observer.next(err.result); + } + observer.error(err); + }); + return function () { + if (controller) + controller.abort(); + }; + }); + }); +}; +function rewriteURIForGET(chosenURI, body) { + var queryParams = []; + var addQueryParam = function (key, value) { + queryParams.push(key + "=" + encodeURIComponent(value)); + }; + if ('query' in body) { + addQueryParam('query', body.query); + } + if (body.operationName) { + addQueryParam('operationName', body.operationName); + } + if (body.variables) { + var serializedVariables = void 0; + try { + serializedVariables = serializeFetchParameter(body.variables, 'Variables map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('variables', serializedVariables); + } + if (body.extensions) { + var serializedExtensions = void 0; + try { + serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('extensions', serializedExtensions); + } + var fragment = '', preFragment = chosenURI; + var fragmentStart = chosenURI.indexOf('#'); + if (fragmentStart !== -1) { + fragment = chosenURI.substr(fragmentStart); + preFragment = chosenURI.substr(0, fragmentStart); + } + var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; + var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; + return { newURI: newURI }; +} +var HttpLink = (function (_super) { + __extends(HttpLink, _super); + function HttpLink(opts) { + return _super.call(this, createHttpLink(opts).request) || this; + } + return HttpLink; +}(ApolloLink)); + +export { HttpLink, createHttpLink }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.esm.js.map b/node_modules/apollo-link-http/lib/bundle.esm.js.map new file mode 100644 index 000000000..6ff1b8076 --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/httpLink.ts"],"sourcesContent":["/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so it's already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we don't call next, the UI can only show networkError because AC didn't\n // get any graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\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 let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;IAkCa,cAAc,GAAG,UAAC,WAAkC;IAAlC,4BAAA,EAAA,gBAAkC;IAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,+FAAiB,CACH;IAGhB,YAAY,CAAC,OAAO,CAAC,CAAC;IAKtB,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,KAAK,CAAC;KACjB;IAED,IAAM,UAAU,GAAG;QACjB,IAAI,EAAE,EAAE,iBAAiB,mBAAA,EAAE;QAC3B,OAAO,EAAE,cAAc,CAAC,YAAY;QACpC,WAAW,EAAE,cAAc,CAAC,WAAW;QACvC,OAAO,EAAE,cAAc,CAAC,OAAO;KAChC,CAAC;IAEF,OAAO,IAAI,UAAU,CAAC,UAAA,SAAS;QAC7B,IAAI,SAAS,GAAG,SAA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,aAAa,CAAC,CAAC;QAC3C,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;KAClD;IACD,IAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;IACtE,IAAM,MAAM,GACV,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;CACnB;AAED;IAA8BA,4BAAU;IAEtC,kBAAY,IAAuB;eACjC,kBAAM,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;KACpC;IACH,eAAC;CALD,CAA8B,UAAU;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/bundle.umd.js b/node_modules/apollo-link-http/lib/bundle.umd.js new file mode 100644 index 000000000..43b28126b --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.umd.js @@ -0,0 +1,152 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link'), require('apollo-link-http-common')) : + typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link', 'apollo-link-http-common'], factory) : + (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.http = {}), global.tslib, global.apolloLink.core, global.apolloLink.httpCommon)); +}(this, function (exports, tslib_1, apolloLink, apolloLinkHttpCommon) { 'use strict'; + + var createHttpLink = function (linkOptions) { + if (linkOptions === void 0) { linkOptions = {}; } + var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib_1.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); + apolloLinkHttpCommon.checkFetcher(fetcher); + if (!fetcher) { + fetcher = fetch; + } + var linkConfig = { + http: { includeExtensions: includeExtensions }, + options: requestOptions.fetchOptions, + credentials: requestOptions.credentials, + headers: requestOptions.headers, + }; + return new apolloLink.ApolloLink(function (operation) { + var chosenURI = apolloLinkHttpCommon.selectURI(operation, uri); + var context = operation.getContext(); + var clientAwarenessHeaders = {}; + if (context.clientAwareness) { + var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; + if (name_1) { + clientAwarenessHeaders['apollographql-client-name'] = name_1; + } + if (version) { + clientAwarenessHeaders['apollographql-client-version'] = version; + } + } + var contextHeaders = tslib_1.__assign({}, clientAwarenessHeaders, context.headers); + var contextConfig = { + http: context.http, + options: context.fetchOptions, + credentials: context.credentials, + headers: contextHeaders, + }; + var _b = apolloLinkHttpCommon.selectHttpOptionsAndBody(operation, apolloLinkHttpCommon.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; + var controller; + if (!options.signal) { + var _c = apolloLinkHttpCommon.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; + controller = _controller; + if (controller) + options.signal = signal; + } + var definitionIsMutation = function (d) { + return d.kind === 'OperationDefinition' && d.operation === 'mutation'; + }; + if (useGETForQueries && + !operation.query.definitions.some(definitionIsMutation)) { + options.method = 'GET'; + } + if (options.method === 'GET') { + var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; + if (parseError) { + return apolloLink.fromError(parseError); + } + chosenURI = newURI; + } + else { + try { + options.body = apolloLinkHttpCommon.serializeFetchParameter(body, 'Payload'); + } + catch (parseError) { + return apolloLink.fromError(parseError); + } + } + return new apolloLink.Observable(function (observer) { + fetcher(chosenURI, options) + .then(function (response) { + operation.setContext({ response: response }); + return response; + }) + .then(apolloLinkHttpCommon.parseAndCheckHttpResponse(operation)) + .then(function (result) { + observer.next(result); + observer.complete(); + return result; + }) + .catch(function (err) { + if (err.name === 'AbortError') + return; + if (err.result && err.result.errors && err.result.data) { + observer.next(err.result); + } + observer.error(err); + }); + return function () { + if (controller) + controller.abort(); + }; + }); + }); + }; + function rewriteURIForGET(chosenURI, body) { + var queryParams = []; + var addQueryParam = function (key, value) { + queryParams.push(key + "=" + encodeURIComponent(value)); + }; + if ('query' in body) { + addQueryParam('query', body.query); + } + if (body.operationName) { + addQueryParam('operationName', body.operationName); + } + if (body.variables) { + var serializedVariables = void 0; + try { + serializedVariables = apolloLinkHttpCommon.serializeFetchParameter(body.variables, 'Variables map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('variables', serializedVariables); + } + if (body.extensions) { + var serializedExtensions = void 0; + try { + serializedExtensions = apolloLinkHttpCommon.serializeFetchParameter(body.extensions, 'Extensions map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('extensions', serializedExtensions); + } + var fragment = '', preFragment = chosenURI; + var fragmentStart = chosenURI.indexOf('#'); + if (fragmentStart !== -1) { + fragment = chosenURI.substr(fragmentStart); + preFragment = chosenURI.substr(0, fragmentStart); + } + var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; + var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; + return { newURI: newURI }; + } + var HttpLink = (function (_super) { + tslib_1.__extends(HttpLink, _super); + function HttpLink(opts) { + return _super.call(this, createHttpLink(opts).request) || this; + } + return HttpLink; + }(apolloLink.ApolloLink)); + + exports.HttpLink = HttpLink; + exports.createHttpLink = createHttpLink; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.umd.js.map b/node_modules/apollo-link-http/lib/bundle.umd.js.map new file mode 100644 index 000000000..d5d33d5ef --- /dev/null +++ b/node_modules/apollo-link-http/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.umd.js","sources":["../src/httpLink.ts"],"sourcesContent":["/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so it's already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we don't call next, the UI can only show networkError because AC didn't\n // get any graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\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 let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n"],"names":["checkFetcher","ApolloLink","selectURI","fromError","serializeFetchParameter","Observable","parseAndCheckHttpResponse","tslib_1.__extends"],"mappings":";;;;;;MAkCa,cAAc,GAAG,UAAC,WAAkC;MAAlC,4BAAA,EAAA,gBAAkC;MAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,uGAAiB,CACH;MAGhBA,iCAAY,CAAC,OAAO,CAAC,CAAC;MAKtB,IAAI,CAAC,OAAO,EAAE;UACZ,OAAO,GAAG,KAAK,CAAC;OACjB;MAED,IAAM,UAAU,GAAG;UACjB,IAAI,EAAE,EAAE,iBAAiB,mBAAA,EAAE;UAC3B,OAAO,EAAE,cAAc,CAAC,YAAY;UACpC,WAAW,EAAE,cAAc,CAAC,WAAW;UACvC,OAAO,EAAE,cAAc,CAAC,OAAO;OAChC,CAAC;MAEF,OAAO,IAAIC,qBAAU,CAAC,UAAA,SAAS;UAC7B,IAAI,SAAS,GAAGC,8BAAS,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;UAE1C,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;UAQvC,IAAM,sBAAsB,GAAG,EAAE,CAAC;UAClC,IAAI,OAAO,CAAC,eAAe,EAAE;cACrB,IAAA,4BAA2C,EAAzC,gBAAI,EAAE,oBAAO,CAA6B;cAClD,IAAI,MAAI,EAAE;kBACR,sBAAsB,CAAC,2BAA2B,CAAC,GAAG,MAAI,CAAC;eAC5D;cACD,IAAI,OAAO,EAAE;kBACX,sBAAsB,CAAC,8BAA8B,CAAC,GAAG,OAAO,CAAC;eAClE;WACF;UAED,IAAM,cAAc,wBAAQ,sBAAsB,EAAK,OAAO,CAAC,OAAO,CAAE,CAAC;UAEzE,IAAM,aAAa,GAAG;cACpB,IAAI,EAAE,OAAO,CAAC,IAAI;cAClB,OAAO,EAAE,OAAO,CAAC,YAAY;cAC7B,WAAW,EAAE,OAAO,CAAC,WAAW;cAChC,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/lib/httpLink.d.ts new file mode 100644 index 000000000..b10b38399 --- /dev/null +++ b/node_modules/apollo-link-http/lib/httpLink.d.ts @@ -0,0 +1,17 @@ +import { ApolloLink, RequestHandler } from 'apollo-link'; +import { HttpOptions, UriFunction as _UriFunction } from 'apollo-link-http-common'; +export declare namespace HttpLink { + interface UriFunction extends _UriFunction { + } + interface Options extends HttpOptions { + useGETForQueries?: boolean; + } +} +export import FetchOptions = HttpLink.Options; +export import UriFunction = HttpLink.UriFunction; +export declare const createHttpLink: (linkOptions?: FetchOptions) => ApolloLink; +export declare class HttpLink extends ApolloLink { + requester: RequestHandler; + constructor(opts?: HttpLink.Options); +} +//# sourceMappingURL=httpLink.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.d.ts.map b/node_modules/apollo-link-http/lib/httpLink.d.ts.map new file mode 100644 index 000000000..dd447739d --- /dev/null +++ b/node_modules/apollo-link-http/lib/httpLink.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"httpLink.d.ts","sourceRoot":"","sources":["src/httpLink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAc,cAAc,EAAa,MAAM,aAAa,CAAC;AAChF,OAAO,EASL,WAAW,EACX,WAAW,IAAI,YAAY,EAC5B,MAAM,yBAAyB,CAAC;AAGjC,yBAAiB,QAAQ,CAAC;IAExB,UAAiB,WAAY,SAAQ,YAAY;KAAG;IACpD,UAAiB,OAAQ,SAAQ,WAAW;QAM1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B;CACF;AAGD,MAAM,QAAQ,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;AAC9C,MAAM,QAAQ,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AAEjD,eAAO,MAAM,cAAc,4CA+J1B,CAAC;AA8DF,qBAAa,QAAS,SAAQ,UAAU;IAC/B,SAAS,EAAE,cAAc,CAAC;gBACrB,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO;CAGpC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.js b/node_modules/apollo-link-http/lib/httpLink.js new file mode 100644 index 000000000..af0708b30 --- /dev/null +++ b/node_modules/apollo-link-http/lib/httpLink.js @@ -0,0 +1,145 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +var apollo_link_http_common_1 = require("apollo-link-http-common"); +exports.createHttpLink = function (linkOptions) { + if (linkOptions === void 0) { linkOptions = {}; } + var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib_1.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); + apollo_link_http_common_1.checkFetcher(fetcher); + if (!fetcher) { + fetcher = fetch; + } + var linkConfig = { + http: { includeExtensions: includeExtensions }, + options: requestOptions.fetchOptions, + credentials: requestOptions.credentials, + headers: requestOptions.headers, + }; + return new apollo_link_1.ApolloLink(function (operation) { + var chosenURI = apollo_link_http_common_1.selectURI(operation, uri); + var context = operation.getContext(); + var clientAwarenessHeaders = {}; + if (context.clientAwareness) { + var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; + if (name_1) { + clientAwarenessHeaders['apollographql-client-name'] = name_1; + } + if (version) { + clientAwarenessHeaders['apollographql-client-version'] = version; + } + } + var contextHeaders = tslib_1.__assign({}, clientAwarenessHeaders, context.headers); + var contextConfig = { + http: context.http, + options: context.fetchOptions, + credentials: context.credentials, + headers: contextHeaders, + }; + var _b = apollo_link_http_common_1.selectHttpOptionsAndBody(operation, apollo_link_http_common_1.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; + var controller; + if (!options.signal) { + var _c = apollo_link_http_common_1.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; + controller = _controller; + if (controller) + options.signal = signal; + } + var definitionIsMutation = function (d) { + return d.kind === 'OperationDefinition' && d.operation === 'mutation'; + }; + if (useGETForQueries && + !operation.query.definitions.some(definitionIsMutation)) { + options.method = 'GET'; + } + if (options.method === 'GET') { + var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; + if (parseError) { + return apollo_link_1.fromError(parseError); + } + chosenURI = newURI; + } + else { + try { + options.body = apollo_link_http_common_1.serializeFetchParameter(body, 'Payload'); + } + catch (parseError) { + return apollo_link_1.fromError(parseError); + } + } + return new apollo_link_1.Observable(function (observer) { + fetcher(chosenURI, options) + .then(function (response) { + operation.setContext({ response: response }); + return response; + }) + .then(apollo_link_http_common_1.parseAndCheckHttpResponse(operation)) + .then(function (result) { + observer.next(result); + observer.complete(); + return result; + }) + .catch(function (err) { + if (err.name === 'AbortError') + return; + if (err.result && err.result.errors && err.result.data) { + observer.next(err.result); + } + observer.error(err); + }); + return function () { + if (controller) + controller.abort(); + }; + }); + }); +}; +function rewriteURIForGET(chosenURI, body) { + var queryParams = []; + var addQueryParam = function (key, value) { + queryParams.push(key + "=" + encodeURIComponent(value)); + }; + if ('query' in body) { + addQueryParam('query', body.query); + } + if (body.operationName) { + addQueryParam('operationName', body.operationName); + } + if (body.variables) { + var serializedVariables = void 0; + try { + serializedVariables = apollo_link_http_common_1.serializeFetchParameter(body.variables, 'Variables map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('variables', serializedVariables); + } + if (body.extensions) { + var serializedExtensions = void 0; + try { + serializedExtensions = apollo_link_http_common_1.serializeFetchParameter(body.extensions, 'Extensions map'); + } + catch (parseError) { + return { parseError: parseError }; + } + addQueryParam('extensions', serializedExtensions); + } + var fragment = '', preFragment = chosenURI; + var fragmentStart = chosenURI.indexOf('#'); + if (fragmentStart !== -1) { + fragment = chosenURI.substr(fragmentStart); + preFragment = chosenURI.substr(0, fragmentStart); + } + var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; + var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; + return { newURI: newURI }; +} +var HttpLink = (function (_super) { + tslib_1.__extends(HttpLink, _super); + function HttpLink(opts) { + return _super.call(this, exports.createHttpLink(opts).request) || this; + } + return HttpLink; +}(apollo_link_1.ApolloLink)); +exports.HttpLink = HttpLink; +//# sourceMappingURL=httpLink.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.js.map b/node_modules/apollo-link-http/lib/httpLink.js.map new file mode 100644 index 000000000..c598864db --- /dev/null +++ b/node_modules/apollo-link-http/lib/httpLink.js.map @@ -0,0 +1 @@ +{"version":3,"file":"httpLink.js","sourceRoot":"","sources":["../src/httpLink.ts"],"names":[],"mappings":";;;AAEA,2CAAgF;AAChF,mEAWiC;AAoBpB,QAAA,cAAc,GAAG,UAAC,WAAkC;IAAlC,4BAAA,EAAA,gBAAkC;IAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,uGAAiB,CACH;IAGhB,sCAAY,CAAC,OAAO,CAAC,CAAC;IAKtB,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,KAAK,CAAC;KACjB;IAED,IAAM,UAAU,GAAG;QACjB,IAAI,EAAE,EAAE,iBAAiB,mBAAA,EAAE;QAC3B,OAAO,EAAE,cAAc,CAAC,YAAY;QACpC,WAAW,EAAE,cAAc,CAAC,WAAW;QACvC,OAAO,EAAE,cAAc,CAAC,OAAO;KAChC,CAAC;IAEF,OAAO,IAAI,wBAAU,CAAC,UAAA,SAAS;QAC7B,IAAI,SAAS,GAAG,mCAAS,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1C,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;QAQvC,IAAM,sBAAsB,GAAG,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,eAAe,EAAE;YACrB,IAAA,4BAA2C,EAAzC,gBAAI,EAAE,oBAAO,CAA6B;YAClD,IAAI,MAAI,EAAE;gBACR,s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AAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACtE,IAAM,MAAM,GACV,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;AACpB,CAAC;AAED;IAA8B,oCAAU;IAEtC,kBAAY,IAAuB;eACjC,kBAAM,sBAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACrC,CAAC;IACH,eAAC;AAAD,CAAC,AALD,CAA8B,wBAAU,GAKvC;AALY,4BAAQ"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.d.ts b/node_modules/apollo-link-http/lib/index.d.ts new file mode 100644 index 000000000..bc56f35b4 --- /dev/null +++ b/node_modules/apollo-link-http/lib/index.d.ts @@ -0,0 +1,2 @@ +export * from './httpLink'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.d.ts.map b/node_modules/apollo-link-http/lib/index.d.ts.map new file mode 100644 index 000000000..99cf80213 --- /dev/null +++ b/node_modules/apollo-link-http/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.js b/node_modules/apollo-link-http/lib/index.js new file mode 100644 index 000000000..9aab4cfae --- /dev/null +++ b/node_modules/apollo-link-http/lib/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./httpLink"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.js.map b/node_modules/apollo-link-http/lib/index.js.map new file mode 100644 index 000000000..518010f0b --- /dev/null +++ b/node_modules/apollo-link-http/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/package.json b/node_modules/apollo-link-http/package.json new file mode 100644 index 000000000..4247da4ff --- /dev/null +++ b/node_modules/apollo-link-http/package.json @@ -0,0 +1,78 @@ +{ + "name": "apollo-link-http", + "version": "1.5.15", + "description": "HTTP transport layer for GraphQL", + "author": "Evans Hauser ", + "contributors": [ + "James Baxley ", + "Jonas Helfer ", + "jon wong ", + "Sashko Stubailo ", + "Stephen Kao " + ], + "license": "MIT", + "main": "./lib/index.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-link.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-link/issues" + }, + "homepage": "https://github.com/apollographql/apollo-link#readme", + "scripts": { + "build": "tsc && rollup -c", + "clean": "rimraf lib/* && rimraf coverage/*", + "coverage": "jest --coverage", + "filesize": "../../scripts/minify", + "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", + "prebuild": "npm run clean", + "prepare": "npm run build", + "test": "npm run lint && jest", + "watch": "tsc -w -p . & rollup -c -w" + }, + "dependencies": { + "apollo-link": "^1.2.12", + "apollo-link-http-common": "^0.2.14", + "tslib": "^1.9.3" + }, + "peerDependencies": { + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "devDependencies": { + "@types/graphql": "14.2.0", + "@types/jest": "24.0.14", + "apollo-fetch": "0.7.0", + "fetch-mock": "6.5.2", + "graphql": "14.3.1", + "graphql-tag": "2.10.1", + "jest": "24.8.0", + "object-to-querystring": "1.0.8", + "rimraf": "2.6.3", + "rollup": "1.15.4", + "ts-jest": "22.4.6", + "tslint": "5.17.0", + "typescript": "3.0.3" + }, + "jest": { + "transform": { + ".(ts|tsx)": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], + "testPathIgnorePatterns": [ + "/node_modules/", + "sharedHttpTests.ts" + ], + "testURL": "http://localhost" + }, + "gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" +} diff --git a/node_modules/apollo-link/CHANGELOG.md b/node_modules/apollo-link/CHANGELOG.md new file mode 100644 index 000000000..a97f05838 --- /dev/null +++ b/node_modules/apollo-link/CHANGELOG.md @@ -0,0 +1,57 @@ +# Change log + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). + +---- + +### 1.2.4 + +- No changes + +### 1.2.3 +- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
+ [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) + +### 1.2.2 +- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) +- export graphql types and add @types/graphql as a regular dependency [PR#576](https://github.com/apollographql/apollo-link/pull/576) +- moved @types/node to dev dependencies in package.josn to avoid collisions with other projects. [PR#540](https://github.com/apollographql/apollo-link/pull/540) + +### 1.2.1 +- update apollo link with zen-observable-ts to remove import issues [PR#515](https://github.com/apollographql/apollo-link/pull/515) + +### 1.2.0 +- Add `fromError` Observable helper +- change import method of zen-observable for rollup compat + +### 1.1.0 +- Expose `#execute` on ApolloLink as static + +### 1.0.7 +- Update to graphql@0.12 + +### 1.0.6 +- update rollup + +### 1.0.5 +- fix bug where context wasn't merged when setting it + +### 1.0.4 +- export link util helpers + +### 1.0.3 +- removed requiring query on initial execution check +- moved to move efficent rollup build + +### 1.0.1, 1.0.2 + +- preleases for dev tool integation + +### 0.8.0 +- added support for `extensions` on an operation + +### 0.7.0 +- new operation API and start of changelog diff --git a/node_modules/apollo-link/LICENSE b/node_modules/apollo-link/LICENSE new file mode 100644 index 000000000..07ea66258 --- /dev/null +++ b/node_modules/apollo-link/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - 2017 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/apollo-link/README.md b/node_modules/apollo-link/README.md new file mode 100644 index 000000000..0ca807f5b --- /dev/null +++ b/node_modules/apollo-link/README.md @@ -0,0 +1,69 @@ +# apollo-link + +## Purpose + +`apollo-link` is a standard interface for modifying control flow of GraphQL requests and fetching GraphQL results, designed to provide a simple GraphQL client that is capable of extensions. +The targeted use cases of `apollo-link` are highlighted below: + +* fetch queries directly without normalized cache +* network interface for Apollo Client +* network interface for Relay Modern +* fetcher for + +Apollo Link is the interface for creating new links in your application. + +The client sends a request as a method call to a link and can recieve one or more (in the case of subscriptions) responses from the server. The responses are returned using the Observer pattern. + +![Apollo Link Chain](https://cdn-images-1.medium.com/max/1600/1*62VLGUaU-9ULCoBCGvgdkQ.png) + +Results from the server can be provided by calling `next(result)` on the observer. In the case of a network/transport error (not a GraphQL Error) the `error(err)` method can be used to indicate a response will not be recieved. If multiple responses are not supported by the link, `complete()` should be called to inform the client no further data will be provided. + +In the case of an intermediate link, a second argument to `request(operation, forward)` is the link to `forward(operation)` to. `forward` returns an observable and it can be returned directly or subscribed to. + +```js +forward(operation).subscribe({ + next: result => { + handleTheResult(result) + }, + error: error => { + handleTheNetworkError(error) + }, +}); +``` + +## Implementing a basic custom transport + +```js +import { ApolloLink, Observable } from 'apollo-link'; + +export class CustomApolloLink extends ApolloLink { + request(operation /*, forward*/) { + //Whether no one is listening anymore + let unsubscribed = false; + + return new Observable(observer => { + somehowGetOperationToServer(operation, (error, result) => { + if (unsubscribed) return; + if (error) { + //Network error + observer.error(error); + } else { + observer.next(result); + observer.complete(); //If subscriptions not supported + } + }); + + function unsubscribe() { + unsubscribed = true; + } + + return unsubscribe; + }); + } +} +``` + +## Installation + +`npm install apollo-link --save` + diff --git a/node_modules/apollo-link/apollo-link-1.2.8.tgz b/node_modules/apollo-link/apollo-link-1.2.8.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d983bed6c9c16dc69627ec4d21959d106f403409 GIT binary patch literal 37346 zcmeF&WpEtLnlE@;vY45fnJgxYnVDrt7Bh2O%*@Qp%#y`qF*7qWw)*;g&&2GU6Fa+i zZfwMUIsK`lDl0R)Bcm$gSO1470{YY6AGC9yH;uKS#m6_NMIKN9;*lQFbo)>}1D;4c zp$u0bWgu$&TydTq={RdDcE+o)@ap^3);a&vjASzlvOH}~^75?ifyFwzsY15lS@5z(AJQb1g^O>ypj-fXTzFelSJ4Q_ArTzYSbYH|=|IybZ zdme6rXkx!b3Yb$qgc4)a%kS_#@;Adh3X}c%J=h3SL~~p-_RKgBt8=6FUnyC(;?4F? z6hzS?9Gyo||B0NtRB?fT*DdhG#F1rlb(wfep~Qx|4^k}{&AeXl6))TpodhPn59@aY zznIj=e7r7sThyjIU(_(`;M|Ufw~+NrJ`B(bJ%k{CBo%r=QLO&4ap~$?e1gONdk^R+ zQnK?T=uTw7itKclq~ zAmNk1+#|hhEGX3w@2E?t#%r)2<%LR>>sh?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87}`73An5HLpr%wXmfIZ<0PU5cG4+X;N*;_|;;2;2YNrv690;hz6C zHXEh>*Fr+}_y0^M0KozPWf2UPyx+qoD?sZ&-2Oct2t0@cK#tIsAmiSt{@#T|8|`LK zfMuInnPXd`%GCEda`7fDEet@KaPv}VXv#x`fr1Qga!nBWdZ%laMBf6Y8j|@M&%pu* zlUPAzxNC#ls1TDT%F6UR(-hKxEByK1!b}oe_;DLrc?W(TSkOZ8G*iWh#nuHqTv_Aa zTUw&B-jV`{LyFsDYPFVDjrr7&UT-vr+xh=N^B1FpY+N|)YV7E4dtpJ&d*K2 zpm-=CH2&i4vx$AhlvIf_1wonQYSdkmSgx#T%x(yIec-PGd4`O{OD#DRr*I03+XvjM z*8PHfo_+2r0VCQRK^i~!K>!kOT3+?e?b}^uS87X~dgFBE-|B14^`->g-Jv5Sg&hb2| z+cK8n62(3?q~pQl49L?}Vzf`5ry+MS;SUo09M)rS7hTCYkhaE*%J4Fu6P`~-T=d|h zqUk!j=dCa$aVvx$p0|hB;LTGu-ix=8jmY4oKDMn^qBx4D^lGK!zwu*y+3K32s2?l; ztI9H7c*p4}5tQs6mE#jA{eRGA^qC4^GbCFE__8z+7D*Xz1v}5z>T~I%K#ZP5eM%g`7FIKw;?&Hy36)XzwejZgGJI z%Ti(iP8zgm1H?`p`xCrp3LPTwgA@r_0=#;PonFa~_OlTZyNeYgX^$zUf`?smdY#c0 zukF5UbiG$h7AKlR8YQXnEfXg4TY-0pfTM=`pB>|P@WuqnZY;yi+)pC5|Mj(!|FD>l gvi}c7|7Lywe1pqs8Ol(GGJNsjzboH!UI2sy03el>F8}}l literal 0 HcmV?d00001 diff --git a/node_modules/apollo-link/lib/bundle.cjs.js b/node_modules/apollo-link/lib/bundle.cjs.js new file mode 100644 index 000000000..67ed9289b --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.cjs.js @@ -0,0 +1,212 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var Observable = _interopDefault(require('zen-observable-ts')); +var tsInvariant = require('ts-invariant'); +var tslib = require('tslib'); +var apolloUtilities = require('apollo-utilities'); + +function validateOperation(operation) { + var OPERATION_FIELDS = [ + 'query', + 'operationName', + 'variables', + 'extensions', + 'context', + ]; + for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { + var key = _a[_i]; + if (OPERATION_FIELDS.indexOf(key) < 0) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("illegal argument: " + key); + } + } + return operation; +} +var LinkError = (function (_super) { + tslib.__extends(LinkError, _super); + function LinkError(message, link) { + var _this = _super.call(this, message) || this; + _this.link = link; + return _this; + } + return LinkError; +}(Error)); +function isTerminating(link) { + return link.request.length <= 1; +} +function toPromise(observable) { + var completed = false; + return new Promise(function (resolve, reject) { + observable.subscribe({ + next: function (data) { + if (completed) { + process.env.NODE_ENV === "production" || tsInvariant.invariant.warn("Promise Wrapper does not support multiple results from Observable"); + } + else { + completed = true; + resolve(data); + } + }, + error: reject, + }); + }); +} +var makePromise = toPromise; +function fromPromise(promise) { + return new Observable(function (observer) { + promise + .then(function (value) { + observer.next(value); + observer.complete(); + }) + .catch(observer.error.bind(observer)); + }); +} +function fromError(errorValue) { + return new Observable(function (observer) { + observer.error(errorValue); + }); +} +function transformOperation(operation) { + var transformedOperation = { + variables: operation.variables || {}, + extensions: operation.extensions || {}, + operationName: operation.operationName, + query: operation.query, + }; + if (!transformedOperation.operationName) { + transformedOperation.operationName = + typeof transformedOperation.query !== 'string' + ? apolloUtilities.getOperationName(transformedOperation.query) + : ''; + } + return transformedOperation; +} +function createOperation(starting, operation) { + var context = tslib.__assign({}, starting); + var setContext = function (next) { + if (typeof next === 'function') { + context = tslib.__assign({}, context, next(context)); + } + else { + context = tslib.__assign({}, context, next); + } + }; + var getContext = function () { return (tslib.__assign({}, context)); }; + Object.defineProperty(operation, 'setContext', { + enumerable: false, + value: setContext, + }); + Object.defineProperty(operation, 'getContext', { + enumerable: false, + value: getContext, + }); + Object.defineProperty(operation, 'toKey', { + enumerable: false, + value: function () { return getKey(operation); }, + }); + return operation; +} +function getKey(operation) { + var query = operation.query, variables = operation.variables, operationName = operation.operationName; + return JSON.stringify([operationName, query, variables]); +} + +function passthrough(op, forward) { + return forward ? forward(op) : Observable.of(); +} +function toLink(handler) { + return typeof handler === 'function' ? new ApolloLink(handler) : handler; +} +function empty() { + return new ApolloLink(function () { return Observable.of(); }); +} +function from(links) { + if (links.length === 0) + return empty(); + return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); +} +function split(test, left, right) { + var leftLink = toLink(left); + var rightLink = toLink(right || new ApolloLink(passthrough)); + if (isTerminating(leftLink) && isTerminating(rightLink)) { + return new ApolloLink(function (operation) { + return test(operation) + ? leftLink.request(operation) || Observable.of() + : rightLink.request(operation) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return test(operation) + ? leftLink.request(operation, forward) || Observable.of() + : rightLink.request(operation, forward) || Observable.of(); + }); + } +} +var concat = function (first, second) { + var firstLink = toLink(first); + if (isTerminating(firstLink)) { + process.env.NODE_ENV === "production" || tsInvariant.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); + return firstLink; + } + var nextLink = toLink(second); + if (isTerminating(nextLink)) { + return new ApolloLink(function (operation) { + return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return (firstLink.request(operation, function (op) { + return nextLink.request(op, forward) || Observable.of(); + }) || Observable.of()); + }); + } +}; +var ApolloLink = (function () { + function ApolloLink(request) { + if (request) + this.request = request; + } + ApolloLink.prototype.split = function (test, left, right) { + return this.concat(split(test, left, right || new ApolloLink(passthrough))); + }; + ApolloLink.prototype.concat = function (next) { + return concat(this, next); + }; + ApolloLink.prototype.request = function (operation, forward) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError('request is not implemented'); + }; + ApolloLink.empty = empty; + ApolloLink.from = from; + ApolloLink.split = split; + ApolloLink.execute = execute; + return ApolloLink; +}()); +function execute(link, operation) { + return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); +} + +exports.Observable = Observable; +Object.defineProperty(exports, 'getOperationName', { + enumerable: true, + get: function () { + return apolloUtilities.getOperationName; + } +}); +exports.ApolloLink = ApolloLink; +exports.concat = concat; +exports.createOperation = createOperation; +exports.empty = empty; +exports.execute = execute; +exports.from = from; +exports.fromError = fromError; +exports.fromPromise = fromPromise; +exports.makePromise = makePromise; +exports.split = split; +exports.toPromise = toPromise; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link/lib/bundle.cjs.js.map b/node_modules/apollo-link/lib/bundle.cjs.js.map new file mode 100644 index 000000000..fe6ad1fad --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import Observable from 'zen-observable-ts';\nexport { default as Observable } from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { __extends, __assign } from 'tslib';\nimport { getOperationName } from 'apollo-utilities';\nexport { getOperationName } from 'apollo-utilities';\n\nfunction validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"illegal argument: \" + key);\n }\n }\n return operation;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nfunction toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\nvar makePromise = toPromise;\nfunction fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\nfunction fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\nfunction transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n return transformedOperation;\n}\nfunction createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign({}, context, next(context));\n }\n else {\n context = __assign({}, context, next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: function () { return getKey(operation); },\n });\n return operation;\n}\nfunction getKey(operation) {\n var query = operation.query, variables = operation.variables, operationName = operation.operationName;\n return JSON.stringify([operationName, query, variables]);\n}\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction empty() {\n return new ApolloLink(function () { return Observable.of(); });\n}\nfunction from(links) {\n if (links.length === 0)\n return empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n}\nfunction split(test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\nvar concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n process.env.NODE_ENV === \"production\" || invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n};\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(1) : new InvariantError('request is not implemented');\n };\n ApolloLink.empty = empty;\n ApolloLink.from = from;\n ApolloLink.split = split;\n ApolloLink.execute = execute;\n return ApolloLink;\n}());\nfunction execute(link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n}\n\nexport { ApolloLink, concat, createOperation, empty, execute, from, fromError, fromPromise, makePromise, split, toPromise };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["InvariantError","__extends","invariant","getOperationName","__assign"],"mappings":";;;;;;;;;;;AAOA,SAAS,iBAAiB,CAAC,SAAS,EAAE;IAClC,IAAI,gBAAg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;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/bundle.esm.js b/node_modules/apollo-link/lib/bundle.esm.js new file mode 100644 index 000000000..c73d7705f --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.esm.js @@ -0,0 +1,191 @@ +import Observable from 'zen-observable-ts'; +export { default as Observable } from 'zen-observable-ts'; +import { invariant, InvariantError } from 'ts-invariant'; +import { __extends, __assign } from 'tslib'; +import { getOperationName } from 'apollo-utilities'; +export { getOperationName } from 'apollo-utilities'; + +function validateOperation(operation) { + var OPERATION_FIELDS = [ + 'query', + 'operationName', + 'variables', + 'extensions', + 'context', + ]; + for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { + var key = _a[_i]; + if (OPERATION_FIELDS.indexOf(key) < 0) { + throw process.env.NODE_ENV === "production" ? new InvariantError(2) : new InvariantError("illegal argument: " + key); + } + } + return operation; +} +var LinkError = (function (_super) { + __extends(LinkError, _super); + function LinkError(message, link) { + var _this = _super.call(this, message) || this; + _this.link = link; + return _this; + } + return LinkError; +}(Error)); +function isTerminating(link) { + return link.request.length <= 1; +} +function toPromise(observable) { + var completed = false; + return new Promise(function (resolve, reject) { + observable.subscribe({ + next: function (data) { + if (completed) { + process.env.NODE_ENV === "production" || invariant.warn("Promise Wrapper does not support multiple results from Observable"); + } + else { + completed = true; + resolve(data); + } + }, + error: reject, + }); + }); +} +var makePromise = toPromise; +function fromPromise(promise) { + return new Observable(function (observer) { + promise + .then(function (value) { + observer.next(value); + observer.complete(); + }) + .catch(observer.error.bind(observer)); + }); +} +function fromError(errorValue) { + return new Observable(function (observer) { + observer.error(errorValue); + }); +} +function transformOperation(operation) { + var transformedOperation = { + variables: operation.variables || {}, + extensions: operation.extensions || {}, + operationName: operation.operationName, + query: operation.query, + }; + if (!transformedOperation.operationName) { + transformedOperation.operationName = + typeof transformedOperation.query !== 'string' + ? getOperationName(transformedOperation.query) + : ''; + } + return transformedOperation; +} +function createOperation(starting, operation) { + var context = __assign({}, starting); + var setContext = function (next) { + if (typeof next === 'function') { + context = __assign({}, context, next(context)); + } + else { + context = __assign({}, context, next); + } + }; + var getContext = function () { return (__assign({}, context)); }; + Object.defineProperty(operation, 'setContext', { + enumerable: false, + value: setContext, + }); + Object.defineProperty(operation, 'getContext', { + enumerable: false, + value: getContext, + }); + Object.defineProperty(operation, 'toKey', { + enumerable: false, + value: function () { return getKey(operation); }, + }); + return operation; +} +function getKey(operation) { + var query = operation.query, variables = operation.variables, operationName = operation.operationName; + return JSON.stringify([operationName, query, variables]); +} + +function passthrough(op, forward) { + return forward ? forward(op) : Observable.of(); +} +function toLink(handler) { + return typeof handler === 'function' ? new ApolloLink(handler) : handler; +} +function empty() { + return new ApolloLink(function () { return Observable.of(); }); +} +function from(links) { + if (links.length === 0) + return empty(); + return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); +} +function split(test, left, right) { + var leftLink = toLink(left); + var rightLink = toLink(right || new ApolloLink(passthrough)); + if (isTerminating(leftLink) && isTerminating(rightLink)) { + return new ApolloLink(function (operation) { + return test(operation) + ? leftLink.request(operation) || Observable.of() + : rightLink.request(operation) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return test(operation) + ? leftLink.request(operation, forward) || Observable.of() + : rightLink.request(operation, forward) || Observable.of(); + }); + } +} +var concat = function (first, second) { + var firstLink = toLink(first); + if (isTerminating(firstLink)) { + process.env.NODE_ENV === "production" || invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); + return firstLink; + } + var nextLink = toLink(second); + if (isTerminating(nextLink)) { + return new ApolloLink(function (operation) { + return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return (firstLink.request(operation, function (op) { + return nextLink.request(op, forward) || Observable.of(); + }) || Observable.of()); + }); + } +}; +var ApolloLink = (function () { + function ApolloLink(request) { + if (request) + this.request = request; + } + ApolloLink.prototype.split = function (test, left, right) { + return this.concat(split(test, left, right || new ApolloLink(passthrough))); + }; + ApolloLink.prototype.concat = function (next) { + return concat(this, next); + }; + ApolloLink.prototype.request = function (operation, forward) { + throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError('request is not implemented'); + }; + ApolloLink.empty = empty; + ApolloLink.from = from; + ApolloLink.split = split; + ApolloLink.execute = execute; + return ApolloLink; +}()); +function execute(link, operation) { + return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); +} + +export { ApolloLink, concat, createOperation, empty, execute, from, fromError, fromPromise, makePromise, split, toPromise }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link/lib/bundle.esm.js.map b/node_modules/apollo-link/lib/bundle.esm.js.map new file mode 100644 index 000000000..9aea52c12 --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/linkUtils.ts","../src/link.ts"],"sourcesContent":["import Observable from 'zen-observable-ts';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nimport { getOperationName } from 'apollo-utilities';\nimport { invariant, InvariantError } from 'ts-invariant';\nexport { getOperationName };\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX We're assuming here that query and variables will be serialized in\n // the same order, which might not always be true.\n const { query, variables, operationName } = operation;\n return JSON.stringify([operationName, query, variables]);\n}\n","import Observable from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\n\nexport function empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n}\n\nexport function from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return empty();\n return links.map(toLink).reduce((x, y) => x.concat(y));\n}\n\nexport function split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new InvariantError('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;SASgB,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM;SACP;KACF;IAED,OAAO,SAAS,CAAC;CAClB;AAED;IAA+BA,6BAAK;IAElC,mBAAY,OAAgB,EAAE,IAAiB;QAA/C,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;KAClB;IACH,gBAAC;CAND,CAA+B,KAAK,GAMnC;SAEe,aAAa,CAAC,IAAgB;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;CACjC;AAED,SAAgB,SAAS,CAAI,UAAyB;IACpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;QACpC,UAAU,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,UAAA,IAAI;gBACR,IAAI,SAAS,EAAE;oBACb;iBAGD;qBAAM;oBACL,SAAS,GAAG,IAAI,CAAC;oBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;aACF;YACD,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;KACJ,CAA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;IAEzB,QACE,IAAI,CAAC,OAAO,CACV,eAAe,CACb,SAAS,CAAC,OAAO,EACjB,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,UAAU,CAAC,EAAE,EAAE,EACpB;CACH;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/bundle.umd.js b/node_modules/apollo-link/lib/bundle.umd.js new file mode 100644 index 000000000..0e267fb79 --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.umd.js @@ -0,0 +1,213 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('zen-observable-ts'), require('ts-invariant'), require('tslib'), require('apollo-utilities')) : + typeof define === 'function' && define.amd ? define(['exports', 'zen-observable-ts', 'ts-invariant', 'tslib', 'apollo-utilities'], factory) : + (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.core = {}), global.apolloLink.zenObservable, global.invariant, global.tslib, global.apolloUtilities)); +}(this, function (exports, Observable, tsInvariant, tslib_1, apolloUtilities) { 'use strict'; + + Observable = Observable && Observable.hasOwnProperty('default') ? Observable['default'] : Observable; + + function validateOperation(operation) { + var OPERATION_FIELDS = [ + 'query', + 'operationName', + 'variables', + 'extensions', + 'context', + ]; + for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { + var key = _a[_i]; + if (OPERATION_FIELDS.indexOf(key) < 0) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("illegal argument: " + key); + } + } + return operation; + } + var LinkError = (function (_super) { + tslib_1.__extends(LinkError, _super); + function LinkError(message, link) { + var _this = _super.call(this, message) || this; + _this.link = link; + return _this; + } + return LinkError; + }(Error)); + function isTerminating(link) { + return link.request.length <= 1; + } + function toPromise(observable) { + var completed = false; + return new Promise(function (resolve, reject) { + observable.subscribe({ + next: function (data) { + if (completed) { + process.env.NODE_ENV === "production" || tsInvariant.invariant.warn("Promise Wrapper does not support multiple results from Observable"); + } + else { + completed = true; + resolve(data); + } + }, + error: reject, + }); + }); + } + var makePromise = toPromise; + function fromPromise(promise) { + return new Observable(function (observer) { + promise + .then(function (value) { + observer.next(value); + observer.complete(); + }) + .catch(observer.error.bind(observer)); + }); + } + function fromError(errorValue) { + return new Observable(function (observer) { + observer.error(errorValue); + }); + } + function transformOperation(operation) { + var transformedOperation = { + variables: operation.variables || {}, + extensions: operation.extensions || {}, + operationName: operation.operationName, + query: operation.query, + }; + if (!transformedOperation.operationName) { + transformedOperation.operationName = + typeof transformedOperation.query !== 'string' + ? apolloUtilities.getOperationName(transformedOperation.query) + : ''; + } + return transformedOperation; + } + function createOperation(starting, operation) { + var context = tslib_1.__assign({}, starting); + var setContext = function (next) { + if (typeof next === 'function') { + context = tslib_1.__assign({}, context, next(context)); + } + else { + context = tslib_1.__assign({}, context, next); + } + }; + var getContext = function () { return (tslib_1.__assign({}, context)); }; + Object.defineProperty(operation, 'setContext', { + enumerable: false, + value: setContext, + }); + Object.defineProperty(operation, 'getContext', { + enumerable: false, + value: getContext, + }); + Object.defineProperty(operation, 'toKey', { + enumerable: false, + value: function () { return getKey(operation); }, + }); + return operation; + } + function getKey(operation) { + var query = operation.query, variables = operation.variables, operationName = operation.operationName; + return JSON.stringify([operationName, query, variables]); + } + + function passthrough(op, forward) { + return forward ? forward(op) : Observable.of(); + } + function toLink(handler) { + return typeof handler === 'function' ? new ApolloLink(handler) : handler; + } + function empty() { + return new ApolloLink(function () { return Observable.of(); }); + } + function from(links) { + if (links.length === 0) + return empty(); + return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); + } + function split(test, left, right) { + var leftLink = toLink(left); + var rightLink = toLink(right || new ApolloLink(passthrough)); + if (isTerminating(leftLink) && isTerminating(rightLink)) { + return new ApolloLink(function (operation) { + return test(operation) + ? leftLink.request(operation) || Observable.of() + : rightLink.request(operation) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return test(operation) + ? leftLink.request(operation, forward) || Observable.of() + : rightLink.request(operation, forward) || Observable.of(); + }); + } + } + var concat = function (first, second) { + var firstLink = toLink(first); + if (isTerminating(firstLink)) { + process.env.NODE_ENV === "production" || tsInvariant.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); + return firstLink; + } + var nextLink = toLink(second); + if (isTerminating(nextLink)) { + return new ApolloLink(function (operation) { + return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return (firstLink.request(operation, function (op) { + return nextLink.request(op, forward) || Observable.of(); + }) || Observable.of()); + }); + } + }; + var ApolloLink = (function () { + function ApolloLink(request) { + if (request) + this.request = request; + } + ApolloLink.prototype.split = function (test, left, right) { + return this.concat(split(test, left, right || new ApolloLink(passthrough))); + }; + ApolloLink.prototype.concat = function (next) { + return concat(this, next); + }; + ApolloLink.prototype.request = function (operation, forward) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError('request is not implemented'); + }; + ApolloLink.empty = empty; + ApolloLink.from = from; + ApolloLink.split = split; + ApolloLink.execute = execute; + return ApolloLink; + }()); + function execute(link, operation) { + return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); + } + + exports.Observable = Observable; + Object.defineProperty(exports, 'getOperationName', { + enumerable: true, + get: function () { + return apolloUtilities.getOperationName; + } + }); + exports.ApolloLink = ApolloLink; + exports.concat = concat; + exports.createOperation = createOperation; + exports.empty = empty; + exports.execute = execute; + exports.from = from; + exports.fromError = fromError; + exports.fromPromise = fromPromise; + exports.makePromise = makePromise; + exports.split = split; + exports.toPromise = toPromise; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link/lib/bundle.umd.js.map b/node_modules/apollo-link/lib/bundle.umd.js.map new file mode 100644 index 000000000..12077511f --- /dev/null +++ b/node_modules/apollo-link/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.umd.js","sources":["../src/linkUtils.ts","../src/link.ts"],"sourcesContent":["import Observable from 'zen-observable-ts';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nimport { getOperationName } from 'apollo-utilities';\nimport { invariant, InvariantError } from 'ts-invariant';\nexport { getOperationName };\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX We're assuming here that query and variables will be serialized in\n // the same order, which might not always be true.\n const { query, variables, operationName } = operation;\n return JSON.stringify([operationName, query, variables]);\n}\n","import Observable from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\n\nexport function empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n}\n\nexport function from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return empty();\n return links.map(toLink).reduce((x, y) => x.concat(y));\n}\n\nexport function split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new InvariantError('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n"],"names":["tslib_1.__extends","getOperationName"],"mappings":";;;;;;;;WASgB,iBAAiB,CAAC,SAAyB;MACzD,IAAM,gBAAgB,GAAG;UACvB,OAAO;UACP,eAAe;UACf,WAAW;UACX,YAAY;UACZ,SAAS;OACV,CAAC;MACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;UAAnC,IAAI,GAAG,SAAA;UACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,C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E,EAAE,OAAO,CAAC,IAAI,UAAU,CAAC,EAAE,EAAE,CAAC;eACzD,CAAC,IAAI,UAAU,CAAC,EAAE,EAAE,EACrB;WACH,CAAC,CAAC;OACJ;EACH,CAAC,CAAC;AAEF;MAME,oBAAY,OAAwB;UAClC,IAAI,OAAO;cAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;OACrC;MAEM,0BAAK,GAAZ,UACE,IAAgC,EAChC,IAAiC,EACjC,KAAmC;UAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;OAC7E;MAEM,2BAAM,GAAb,UAAc,IAAiC;UAC7C,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;OAC3B;MAEM,4BAAO,GAAd,UACE,SAAoB,EACpB,OAAkB;UAElB,MAAM;OACP;MA1Ba,gBAAK,GAAG,KAAK,CAAC;MACd,eAAI,GAAG,IAAI,CAAC;MACZ,gBAAK,GAAG,KAAK,CAAC;MACd,kBAAO,GAAG,OAAO,CAAC;MAwBlC,iBAAC;GA5BD,IA4BC;WAEe,OAAO,CACrB,IAAgB,EAChB,SAAyB;MAEzB,QACE,IAAI,CAAC,OAAO,CACV,eAAe,CACb,SAAS,CAAC,OAAO,EACjB,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,UAAU,CAAC,EAAE,EAAE,EACpB;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.d.ts b/node_modules/apollo-link/lib/index.d.ts new file mode 100644 index 000000000..b0381ae2e --- /dev/null +++ b/node_modules/apollo-link/lib/index.d.ts @@ -0,0 +1,6 @@ +export * from './link'; +export { createOperation, makePromise, toPromise, fromPromise, fromError, getOperationName, } from './linkUtils'; +export * from './types'; +import Observable from 'zen-observable-ts'; +export { Observable }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.d.ts.map b/node_modules/apollo-link/lib/index.d.ts.map new file mode 100644 index 000000000..ae8e854ee --- /dev/null +++ b/node_modules/apollo-link/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,SAAS,CAAC;AAExB,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.js b/node_modules/apollo-link/lib/index.js new file mode 100644 index 000000000..7a4f2ae29 --- /dev/null +++ b/node_modules/apollo-link/lib/index.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./link"), exports); +var linkUtils_1 = require("./linkUtils"); +exports.createOperation = linkUtils_1.createOperation; +exports.makePromise = linkUtils_1.makePromise; +exports.toPromise = linkUtils_1.toPromise; +exports.fromPromise = linkUtils_1.fromPromise; +exports.fromError = linkUtils_1.fromError; +exports.getOperationName = linkUtils_1.getOperationName; +var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); +exports.Observable = zen_observable_ts_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.js.map b/node_modules/apollo-link/lib/index.js.map new file mode 100644 index 000000000..2a40f7d73 --- /dev/null +++ b/node_modules/apollo-link/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,yCAOqB;AANnB,sCAAA,eAAe,CAAA;AACf,kCAAA,WAAW,CAAA;AACX,gCAAA,SAAS,CAAA;AACT,kCAAA,WAAW,CAAA;AACX,gCAAA,SAAS,CAAA;AACT,uCAAA,gBAAgB,CAAA;AAIlB,gFAA2C;AAClC,qBADF,2BAAU,CACE"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.d.ts b/node_modules/apollo-link/lib/link.d.ts new file mode 100644 index 000000000..1ae24c3f9 --- /dev/null +++ b/node_modules/apollo-link/lib/link.d.ts @@ -0,0 +1,18 @@ +import Observable from 'zen-observable-ts'; +import { GraphQLRequest, NextLink, Operation, RequestHandler, FetchResult } from './types'; +export declare function empty(): ApolloLink; +export declare function from(links: ApolloLink[]): ApolloLink; +export declare function split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; +export declare const concat: (first: RequestHandler | ApolloLink, second: RequestHandler | ApolloLink) => ApolloLink; +export declare class ApolloLink { + static empty: typeof empty; + static from: typeof from; + static split: typeof split; + static execute: typeof execute; + constructor(request?: RequestHandler); + split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; + concat(next: ApolloLink | RequestHandler): ApolloLink; + request(operation: Operation, forward?: NextLink): Observable | null; +} +export declare function execute(link: ApolloLink, operation: GraphQLRequest): Observable; +//# sourceMappingURL=link.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.d.ts.map b/node_modules/apollo-link/lib/link.d.ts.map new file mode 100644 index 000000000..47cf776f9 --- /dev/null +++ b/node_modules/apollo-link/lib/link.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["src/link.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,SAAS,CAAC;AAkBjB,wBAAgB,KAAK,IAAI,UAAU,CAElC;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAGpD;AAED,wBAAgB,KAAK,CACnB,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,OAAO,EAChC,IAAI,EAAE,UAAU,GAAG,cAAc,EACjC,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAClC,UAAU,CAiBZ;AAGD,eAAO,MAAM,MAAM,yFAiClB,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAc,KAAK,eAAS;IAC5B,OAAc,IAAI,cAAQ;IAC1B,OAAc,KAAK,eAAS;IAC5B,OAAc,OAAO,iBAAW;gBAEpB,OAAO,CAAC,EAAE,cAAc;IAI7B,KAAK,CACV,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,OAAO,EAChC,IAAI,EAAE,UAAU,GAAG,cAAc,EACjC,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAClC,UAAU;IAIN,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU;IAIrD,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,cAAc,GACxB,UAAU,CAAC,WAAW,CAAC,CASzB"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.js b/node_modules/apollo-link/lib/link.js new file mode 100644 index 000000000..561886f18 --- /dev/null +++ b/node_modules/apollo-link/lib/link.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); +var ts_invariant_1 = require("ts-invariant"); +var linkUtils_1 = require("./linkUtils"); +function passthrough(op, forward) { + return forward ? forward(op) : zen_observable_ts_1.default.of(); +} +function toLink(handler) { + return typeof handler === 'function' ? new ApolloLink(handler) : handler; +} +function empty() { + return new ApolloLink(function () { return zen_observable_ts_1.default.of(); }); +} +exports.empty = empty; +function from(links) { + if (links.length === 0) + return empty(); + return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); +} +exports.from = from; +function split(test, left, right) { + var leftLink = toLink(left); + var rightLink = toLink(right || new ApolloLink(passthrough)); + if (linkUtils_1.isTerminating(leftLink) && linkUtils_1.isTerminating(rightLink)) { + return new ApolloLink(function (operation) { + return test(operation) + ? leftLink.request(operation) || zen_observable_ts_1.default.of() + : rightLink.request(operation) || zen_observable_ts_1.default.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return test(operation) + ? leftLink.request(operation, forward) || zen_observable_ts_1.default.of() + : rightLink.request(operation, forward) || zen_observable_ts_1.default.of(); + }); + } +} +exports.split = split; +exports.concat = function (first, second) { + var firstLink = toLink(first); + if (linkUtils_1.isTerminating(firstLink)) { + ts_invariant_1.invariant.warn(new linkUtils_1.LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); + return firstLink; + } + var nextLink = toLink(second); + if (linkUtils_1.isTerminating(nextLink)) { + return new ApolloLink(function (operation) { + return firstLink.request(operation, function (op) { return nextLink.request(op) || zen_observable_ts_1.default.of(); }) || zen_observable_ts_1.default.of(); + }); + } + else { + return new ApolloLink(function (operation, forward) { + return (firstLink.request(operation, function (op) { + return nextLink.request(op, forward) || zen_observable_ts_1.default.of(); + }) || zen_observable_ts_1.default.of()); + }); + } +}; +var ApolloLink = (function () { + function ApolloLink(request) { + if (request) + this.request = request; + } + ApolloLink.prototype.split = function (test, left, right) { + return this.concat(split(test, left, right || new ApolloLink(passthrough))); + }; + ApolloLink.prototype.concat = function (next) { + return exports.concat(this, next); + }; + ApolloLink.prototype.request = function (operation, forward) { + throw new ts_invariant_1.InvariantError('request is not implemented'); + }; + ApolloLink.empty = empty; + ApolloLink.from = from; + ApolloLink.split = split; + ApolloLink.execute = execute; + return ApolloLink; +}()); +exports.ApolloLink = ApolloLink; +function execute(link, operation) { + return (link.request(linkUtils_1.createOperation(operation.context, linkUtils_1.transformOperation(linkUtils_1.validateOperation(operation)))) || zen_observable_ts_1.default.of()); +} +exports.execute = execute; +//# sourceMappingURL=link.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.js.map b/node_modules/apollo-link/lib/link.js.map new file mode 100644 index 000000000..7e94f9766 --- /dev/null +++ b/node_modules/apollo-link/lib/link.js.map @@ -0,0 +1 @@ +{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":";;;AAAA,gFAA2C;AAC3C,6CAAyD;AAUzD,yCAMqB;AAErB,SAAS,WAAW,CAAC,EAAE,EAAE,OAAO;IAC9B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,2BAAU,CAAC,EAAE,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,OAAoC;IAClD,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3E,CAAC;AAED,SAAgB,KAAK;IACnB,OAAO,IAAI,UAAU,CAAC,cAAM,OAAA,2BAAU,CAAC,EAAE,EAAE,EAAf,CAAe,CAAC,CAAC;AAC/C,CAAC;AAFD,sBAEC;AAED,SAAgB,IAAI,CAAC,KAAmB;IACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC,CAAC;AACzD,CAAC;AAHD,oBAGC;AAED,SAAgB,KAAK,CACnB,IAAgC,EAChC,IAAiC,EACjC,KAA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AAO,CAAC;IAwBlC,iBAAC;CAAA,AA5BD,IA4BC;AA5BY,gCAAU;AA8BvB,SAAgB,OAAO,CACrB,IAAgB,EAChB,SAAyB;IAEzB,OAAO,CACL,IAAI,CAAC,OAAO,CACV,2BAAe,CACb,SAAS,CAAC,OAAO,EACjB,8BAAkB,CAAC,6BAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,2BAAU,CAAC,EAAE,EAAE,CACrB,CAAC;AACJ,CAAC;AAZD,0BAYC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.d.ts b/node_modules/apollo-link/lib/linkUtils.d.ts new file mode 100644 index 000000000..1e6a36a1a --- /dev/null +++ b/node_modules/apollo-link/lib/linkUtils.d.ts @@ -0,0 +1,19 @@ +import Observable from 'zen-observable-ts'; +import { GraphQLRequest, Operation } from './types'; +import { ApolloLink } from './link'; +import { getOperationName } from 'apollo-utilities'; +export { getOperationName }; +export declare function validateOperation(operation: GraphQLRequest): GraphQLRequest; +export declare class LinkError extends Error { + link: ApolloLink; + constructor(message?: string, link?: ApolloLink); +} +export declare function isTerminating(link: ApolloLink): boolean; +export declare function toPromise(observable: Observable): Promise; +export declare const makePromise: typeof toPromise; +export declare function fromPromise(promise: Promise): Observable; +export declare function fromError(errorValue: any): Observable; +export declare function transformOperation(operation: GraphQLRequest): GraphQLRequest; +export declare function createOperation(starting: any, operation: GraphQLRequest): Operation; +export declare function getKey(operation: GraphQLRequest): string; +//# sourceMappingURL=linkUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.d.ts.map b/node_modules/apollo-link/lib/linkUtils.d.ts.map new file mode 100644 index 000000000..39109a3b4 --- /dev/null +++ b/node_modules/apollo-link/lib/linkUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"linkUtils.d.ts","sourceRoot":"","sources":["src/linkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAe3E;AAED,qBAAa,SAAU,SAAQ,KAAK;IAC3B,IAAI,EAAE,UAAU,CAAC;gBACZ,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU;CAIhD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEvD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE;AAGD,eAAO,MAAM,WAAW,kBAAY,CAAC;AAErC,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAiB5E;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,cAAc,GACxB,SAAS,CA2BX;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,cAAc,UAK/C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.js b/node_modules/apollo-link/lib/linkUtils.js new file mode 100644 index 000000000..be68bd30e --- /dev/null +++ b/node_modules/apollo-link/lib/linkUtils.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); +var apollo_utilities_1 = require("apollo-utilities"); +exports.getOperationName = apollo_utilities_1.getOperationName; +var ts_invariant_1 = require("ts-invariant"); +function validateOperation(operation) { + var OPERATION_FIELDS = [ + 'query', + 'operationName', + 'variables', + 'extensions', + 'context', + ]; + for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { + var key = _a[_i]; + if (OPERATION_FIELDS.indexOf(key) < 0) { + throw new ts_invariant_1.InvariantError("illegal argument: " + key); + } + } + return operation; +} +exports.validateOperation = validateOperation; +var LinkError = (function (_super) { + tslib_1.__extends(LinkError, _super); + function LinkError(message, link) { + var _this = _super.call(this, message) || this; + _this.link = link; + return _this; + } + return LinkError; +}(Error)); +exports.LinkError = LinkError; +function isTerminating(link) { + return link.request.length <= 1; +} +exports.isTerminating = isTerminating; +function toPromise(observable) { + var completed = false; + return new Promise(function (resolve, reject) { + observable.subscribe({ + next: function (data) { + if (completed) { + ts_invariant_1.invariant.warn("Promise Wrapper does not support multiple results from Observable"); + } + else { + completed = true; + resolve(data); + } + }, + error: reject, + }); + }); +} +exports.toPromise = toPromise; +exports.makePromise = toPromise; +function fromPromise(promise) { + return new zen_observable_ts_1.default(function (observer) { + promise + .then(function (value) { + observer.next(value); + observer.complete(); + }) + .catch(observer.error.bind(observer)); + }); +} +exports.fromPromise = fromPromise; +function fromError(errorValue) { + return new zen_observable_ts_1.default(function (observer) { + observer.error(errorValue); + }); +} +exports.fromError = fromError; +function transformOperation(operation) { + var transformedOperation = { + variables: operation.variables || {}, + extensions: operation.extensions || {}, + operationName: operation.operationName, + query: operation.query, + }; + if (!transformedOperation.operationName) { + transformedOperation.operationName = + typeof transformedOperation.query !== 'string' + ? apollo_utilities_1.getOperationName(transformedOperation.query) + : ''; + } + return transformedOperation; +} +exports.transformOperation = transformOperation; +function createOperation(starting, operation) { + var context = tslib_1.__assign({}, starting); + var setContext = function (next) { + if (typeof next === 'function') { + context = tslib_1.__assign({}, context, next(context)); + } + else { + context = tslib_1.__assign({}, context, next); + } + }; + var getContext = function () { return (tslib_1.__assign({}, context)); }; + Object.defineProperty(operation, 'setContext', { + enumerable: false, + value: setContext, + }); + Object.defineProperty(operation, 'getContext', { + enumerable: false, + value: getContext, + }); + Object.defineProperty(operation, 'toKey', { + enumerable: false, + value: function () { return getKey(operation); }, + }); + return operation; +} +exports.createOperation = createOperation; +function getKey(operation) { + var query = operation.query, variables = operation.variables, operationName = operation.operationName; + return JSON.stringify([operationName, query, variables]); +} +exports.getKey = getKey; +//# sourceMappingURL=linkUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.js.map b/node_modules/apollo-link/lib/linkUtils.js.map new file mode 100644 index 000000000..aabc1507e --- /dev/null +++ b/node_modules/apollo-link/lib/linkUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"linkUtils.js","sourceRoot":"","sources":["../src/linkUtils.ts"],"names":[],"mappings":";;;AAAA,gFAA2C;AAK3C,qDAAoD;AAE3C,2BAFA,mCAAgB,CAEA;AADzB,6CAAyD;AAGzD,SAAgB,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,6BAAc,CAAC,uBAAqB,GAAK,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAfD,8CAeC;AAED;IAA+B,qCAAK;IAElC,mBAAY,OAAgB,EAAE,IAAiB;QAA/C,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;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AA,MAAM,CAAC,SAAS,CAAC,EAAjB,CAAiB;KAC/B,CAAC,CAAC;IAEH,OAAO,SAAsB,CAAC;AAChC,CAAC;AA9BD,0CA8BC;AAED,SAAgB,MAAM,CAAC,SAAyB;IAGtC,IAAA,uBAAK,EAAE,+BAAS,EAAE,uCAAa,CAAe;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3D,CAAC;AALD,wBAKC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.d.ts b/node_modules/apollo-link/lib/test-utils.d.ts new file mode 100644 index 000000000..22bdc7aa5 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils.d.ts @@ -0,0 +1,5 @@ +import MockLink from './test-utils/mockLink'; +import SetContextLink from './test-utils/setContext'; +export * from './test-utils/testingUtils'; +export { MockLink, SetContextLink }; +//# sourceMappingURL=test-utils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.d.ts.map b/node_modules/apollo-link/lib/test-utils.d.ts.map new file mode 100644 index 000000000..f337f9d2f --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["src/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.js b/node_modules/apollo-link/lib/test-utils.js new file mode 100644 index 000000000..feecc92e7 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var mockLink_1 = tslib_1.__importDefault(require("./test-utils/mockLink")); +exports.MockLink = mockLink_1.default; +var setContext_1 = tslib_1.__importDefault(require("./test-utils/setContext")); +exports.SetContextLink = setContext_1.default; +tslib_1.__exportStar(require("./test-utils/testingUtils"), exports); +//# sourceMappingURL=test-utils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.js.map b/node_modules/apollo-link/lib/test-utils.js.map new file mode 100644 index 000000000..ea03f9fc8 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":";;;AAAA,2EAA6C;AAIpC,mBAJF,kBAAQ,CAIE;AAHjB,+EAAqD;AAGlC,yBAHZ,oBAAc,CAGY;AAFjC,oEAA0C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts new file mode 100644 index 000000000..6fce8ea54 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts @@ -0,0 +1,8 @@ +import { Operation, RequestHandler, NextLink, FetchResult } from '../types'; +import Observable from 'zen-observable-ts'; +import { ApolloLink } from '../link'; +export default class MockLink extends ApolloLink { + constructor(handleRequest?: RequestHandler); + request(operation: Operation, forward?: NextLink): Observable | null; +} +//# sourceMappingURL=mockLink.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map new file mode 100644 index 000000000..91d303fca --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mockLink.d.ts","sourceRoot":"","sources":["../src/test-utils/mockLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;gBAClC,aAAa,GAAE,cAA2B;IAK/C,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.js b/node_modules/apollo-link/lib/test-utils/mockLink.js new file mode 100644 index 000000000..166c100dc --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/mockLink.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var link_1 = require("../link"); +var MockLink = (function (_super) { + tslib_1.__extends(MockLink, _super); + function MockLink(handleRequest) { + if (handleRequest === void 0) { handleRequest = function () { return null; }; } + var _this = _super.call(this) || this; + _this.request = handleRequest; + return _this; + } + MockLink.prototype.request = function (operation, forward) { + throw Error('should be overridden'); + }; + return MockLink; +}(link_1.ApolloLink)); +exports.default = MockLink; +//# sourceMappingURL=mockLink.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.js.map b/node_modules/apollo-link/lib/test-utils/mockLink.js.map new file mode 100644 index 000000000..24bed603d --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/mockLink.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mockLink.js","sourceRoot":"","sources":["../../src/test-utils/mockLink.ts"],"names":[],"mappings":";;;AAIA,gCAAqC;AAErC;IAAsC,oCAAU;IAC9C,kBAAY,aAA0C;QAA1C,8BAAA,EAAA,8BAAsC,OAAA,IAAI,EAAJ,CAAI;QAAtD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,OAAO,GAAG,aAAa,CAAC;;IAC/B,CAAC;IAEM,0BAAO,GAAd,UACE,SAAoB,EACpB,OAAkB;QAElB,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;IACH,eAAC;AAAD,CAAC,AAZD,CAAsC,iBAAU,GAY/C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.d.ts b/node_modules/apollo-link/lib/test-utils/setContext.d.ts new file mode 100644 index 000000000..0d0d0185a --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/setContext.d.ts @@ -0,0 +1,9 @@ +import { Operation, NextLink, FetchResult } from '../types'; +import Observable from 'zen-observable-ts'; +import { ApolloLink } from '../link'; +export default class SetContextLink extends ApolloLink { + private setContext; + constructor(setContext?: (context: Record) => Record); + request(operation: Operation, forward: NextLink): Observable; +} +//# sourceMappingURL=setContext.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map b/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map new file mode 100644 index 000000000..5ead8791f --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setContext.d.ts","sourceRoot":"","sources":["../src/test-utils/setContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IAElD,OAAO,CAAC,UAAU;gBAAV,UAAU,GAAE,CAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAU;IAK5B,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAAC,WAAW,CAAC;CAI3B"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.js b/node_modules/apollo-link/lib/test-utils/setContext.js new file mode 100644 index 000000000..0f382ecc5 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/setContext.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var link_1 = require("../link"); +var SetContextLink = (function (_super) { + tslib_1.__extends(SetContextLink, _super); + function SetContextLink(setContext) { + if (setContext === void 0) { setContext = function (c) { return c; }; } + var _this = _super.call(this) || this; + _this.setContext = setContext; + return _this; + } + SetContextLink.prototype.request = function (operation, forward) { + operation.setContext(this.setContext(operation.getContext())); + return forward(operation); + }; + return SetContextLink; +}(link_1.ApolloLink)); +exports.default = SetContextLink; +//# sourceMappingURL=setContext.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.js.map b/node_modules/apollo-link/lib/test-utils/setContext.js.map new file mode 100644 index 000000000..29d313a2a --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/setContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setContext.js","sourceRoot":"","sources":["../../src/test-utils/setContext.ts"],"names":[],"mappings":";;;AAIA,gCAAqC;AAErC;IAA4C,0CAAU;IACpD,wBACU,UAEyB;QAFzB,2BAAA,EAAA,uBAEmB,CAAC,IAAI,OAAA,CAAC,EAAD,CAAC;QAHnC,YAKE,iBAAO,SACR;QALS,gBAAU,GAAV,UAAU,CAEe;;IAGnC,CAAC;IAEM,gCAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IACH,qBAAC;AAAD,CAAC,AAhBD,CAA4C,iBAAU,GAgBrD"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts new file mode 100644 index 000000000..79542b663 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts @@ -0,0 +1,12 @@ +import { ApolloLink } from '../link'; +export declare function checkCalls(calls: any[], results: Array): void; +export interface TestResultType { + link: ApolloLink; + results?: any[]; + query?: string; + done?: () => void; + context?: any; + variables?: any; +} +export declare function testLinkResults(params: TestResultType): void; +//# sourceMappingURL=testingUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map new file mode 100644 index 000000000..0e0cfa649 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"testingUtils.d.ts","sourceRoot":"","sources":["../src/test-utils/testingUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,UAAU,EAAE,MAAM,SAAS,CAAC;AAU9C,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,QAGjE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,QAuBrD"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.js b/node_modules/apollo-link/lib/test-utils/testingUtils.js new file mode 100644 index 000000000..694489be0 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/testingUtils.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); +var link_1 = require("../link"); +var sampleQuery = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query SampleQuery {\n stub {\n id\n }\n }\n"], ["\n query SampleQuery {\n stub {\n id\n }\n }\n"]))); +function checkCalls(calls, results) { + if (calls === void 0) { calls = []; } + expect(calls.length).toBe(results.length); + calls.map(function (call, i) { return expect(call.data).toEqual(results[i]); }); +} +exports.checkCalls = checkCalls; +function testLinkResults(params) { + var link = params.link, context = params.context, variables = params.variables; + var results = params.results || []; + var query = params.query || sampleQuery; + var done = params.done || (function () { return void 0; }); + var spy = jest.fn(); + link_1.execute(link, { query: query, context: context, variables: variables }).subscribe({ + next: spy, + error: function (error) { + expect(error).toEqual(results.pop()); + checkCalls(spy.mock.calls[0], results); + if (done) { + done(); + } + }, + complete: function () { + checkCalls(spy.mock.calls[0], results); + if (done) { + done(); + } + }, + }); +} +exports.testLinkResults = testLinkResults; +var templateObject_1; +//# sourceMappingURL=testingUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.js.map b/node_modules/apollo-link/lib/test-utils/testingUtils.js.map new file mode 100644 index 000000000..94130d9f6 --- /dev/null +++ b/node_modules/apollo-link/lib/test-utils/testingUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"testingUtils.js","sourceRoot":"","sources":["../../src/test-utils/testingUtils.ts"],"names":[],"mappings":";;;AAAA,oEAA8B;AAC9B,gCAA8C;AAE9C,IAAM,WAAW,GAAG,qBAAG,wIAAA,6DAMtB,IAAA,CAAC;AAEF,SAAgB,UAAU,CAAI,KAAiB,EAAE,OAAiB;IAApC,sBAAA,EAAA,UAAiB;IAC7C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,CAAC,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAArC,CAAqC,CAAC,CAAC;AAChE,CAAC;AAHD,gCAGC;AAWD,SAAgB,eAAe,CAAC,MAAsB;IAC5C,IAAA,kBAAI,EAAE,wBAAO,EAAE,4BAAS,CAAY;IAC5C,IAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,WAAW,CAAC;IAC1C,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,cAAM,OAAA,KAAK,CAAC,EAAN,CAAM,CAAC,CAAC;IAE3C,IAAM,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACtB,cAAO,CAAC,IAAI,EAAE,EAAE,KAAK,OAAA,EAAE,OAAO,SAAA,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC,SAAS,CAAC;QACrD,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,UAAA,KAAK;YACV,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,EAAE;gBACR,IAAI,EAAE,CAAC;aACR;QACH,CAAC;QACD,QAAQ,EAAE;YACR,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,EAAE;gBACR,IAAI,EAAE,CAAC;aACR;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAvBD,0CAuBC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.d.ts b/node_modules/apollo-link/lib/types.d.ts new file mode 100644 index 000000000..c25a95ea1 --- /dev/null +++ b/node_modules/apollo-link/lib/types.d.ts @@ -0,0 +1,29 @@ +import Observable from 'zen-observable-ts'; +import { DocumentNode } from 'graphql/language/ast'; +import { ExecutionResult } from 'graphql/execution/execute'; +export { ExecutionResult, DocumentNode }; +export interface GraphQLRequest { + query: DocumentNode; + variables?: Record; + operationName?: string; + context?: Record; + extensions?: Record; +} +export interface Operation { + query: DocumentNode; + variables: Record; + operationName: string; + extensions: Record; + setContext: (context: Record) => Record; + getContext: () => Record; + toKey: () => string; +} +export declare type FetchResult, E = Record> = ExecutionResult & { + extensions?: E; + context?: C; +}; +export declare type NextLink = (operation: Operation) => Observable; +export declare type RequestHandler = (operation: Operation, forward?: NextLink) => Observable | null; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.d.ts.map b/node_modules/apollo-link/lib/types.d.ts.map new file mode 100644 index 000000000..b1c2cd2ed --- /dev/null +++ b/node_modules/apollo-link/lib/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClE,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB;AAED,oBAAY,WAAW,CACrB,KAAK,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC9B,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACrB,eAAe,CAAC,KAAK,CAAC,GAAG;IAC3B,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,oBAAY,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,UAAU,CAAC,WAAW,CAAC,CAAC;AACzE,oBAAY,cAAc,GAAG,CAC3B,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,KACf,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.js b/node_modules/apollo-link/lib/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/apollo-link/lib/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.js.map b/node_modules/apollo-link/lib/types.js.map new file mode 100644 index 000000000..c768b7900 --- /dev/null +++ b/node_modules/apollo-link/lib/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-link/package.json b/node_modules/apollo-link/package.json new file mode 100644 index 000000000..f37ca2763 --- /dev/null +++ b/node_modules/apollo-link/package.json @@ -0,0 +1,72 @@ +{ + "name": "apollo-link", + "version": "1.2.12", + "description": "Flexible, lightweight transport layer for GraphQL", + "author": "Evans Hauser ", + "contributors": [ + "James Baxley ", + "Jonas Helfer ", + "jon wong ", + "Sashko Stubailo " + ], + "license": "MIT", + "main": "./lib/index.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-link.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-link/issues" + }, + "homepage": "https://github.com/apollographql/apollo-link#readme", + "scripts": { + "build": "tsc && rollup -c", + "clean": "rimraf lib/* && rimraf coverage/*", + "coverage": "jest --coverage", + "filesize": "../../scripts/minify", + "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", + "prebuild": "npm run clean", + "prepare": "npm run build", + "test": "npm run lint && jest", + "watch": "tsc -w -p . & rollup -c -w" + }, + "dependencies": { + "apollo-utilities": "^1.3.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3", + "zen-observable-ts": "^0.8.19" + }, + "peerDependencies": { + "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0" + }, + "devDependencies": { + "@types/graphql": "14.2.0", + "@types/jest": "24.0.14", + "@types/node": "9.6.42", + "graphql": "14.3.1", + "graphql-tag": "2.10.1", + "jest": "24.8.0", + "rimraf": "2.6.3", + "rollup": "1.15.4", + "ts-jest": "22.4.6", + "tslint": "5.17.0", + "typescript": "3.0.3" + }, + "jest": { + "transform": { + ".(ts|tsx)": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], + "testURL": "http://localhost" + }, + "gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" +} diff --git a/node_modules/apollo-utilities/.flowconfig b/node_modules/apollo-utilities/.flowconfig new file mode 100644 index 000000000..ffa2101c8 --- /dev/null +++ b/node_modules/apollo-utilities/.flowconfig @@ -0,0 +1,8 @@ +[ignore] + +[include] + +[libs] + +[options] +suppress_comment= \\(.\\|\n\\)*\\$ExpectError diff --git a/node_modules/apollo-utilities/CHANGELOG.md b/node_modules/apollo-utilities/CHANGELOG.md new file mode 100644 index 000000000..2cabb6081 --- /dev/null +++ b/node_modules/apollo-utilities/CHANGELOG.md @@ -0,0 +1,106 @@ +# CHANGELOG + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). + +---- + +### 1.0.16 + +- Removed unnecessary whitespace from error message + [Issue #3398](https://github.com/apollographql/apollo-client/issues/3398) + [PR #3593](https://github.com/apollographql/apollo-client/pull/3593) + +### 1.0.15 + +- No changes + +### 1.0.14 + +- Store key names generated by `getStoreKeyName` now leverage a more + deterministic approach to handling JSON based strings. This prevents store + key names from differing when using `args` like + `{ prop1: 'value1', prop2: 'value2' }` and + `{ prop2: 'value2', prop1: 'value1' }`. + [PR #2869](https://github.com/apollographql/apollo-client/pull/2869) +- Avoid needless `hasOwnProperty` check in `deepFreeze`. + [PR #3545](https://github.com/apollographql/apollo-client/pull/3545) + +### 1.0.13 + +- Make `maybeDeepFreeze` a little more defensive, by always using + `Object.prototype.hasOwnProperty` (to avoid cases where the object being + frozen doesn't have its own `hasOwnProperty`). + [Issue #3426](https://github.com/apollographql/apollo-client/issues/3426) + [PR #3418](https://github.com/apollographql/apollo-client/pull/3418) +- Remove certain small internal caches to prevent memory leaks when using SSR. + [PR #3444](https://github.com/apollographql/apollo-client/pull/3444) + +### 1.0.12 + +- Not documented + +### 1.0.11 + +- `toIdValue` helper now takes an object with `id` and `typename` properties + as the preferred interface + [PR #3159](https://github.com/apollographql/apollo-client/pull/3159) +- Map coverage to original source +- Don't `deepFreeze` in development/test environments if ES6 symbols are + polyfilled + [PR #3082](https://github.com/apollographql/apollo-client/pull/3082) +- Added ability to include or ignore fragments in `getDirectivesFromDocument` + [PR #3010](https://github.com/apollographql/apollo-client/pull/3010) + +### 1.0.9 + +- Dependency updates +- Added getDirectivesFromDocument utility function + [PR #2974](https://github.com/apollographql/apollo-client/pull/2974) + +### 1.0.8 + +- Add client, rest, and export directives to list of known directives + [PR #2949](https://github.com/apollographql/apollo-client/pull/2949) + +### 1.0.7 + +- Fix typo in error message for invalid argument being passed to @skip or + @include directives + [PR #2867](https://github.com/apollographql/apollo-client/pull/2867) + +### 1.0.6 + +- Update `getStoreKeyName` to support custom directives + +### 1.0.5 + +- Package dependency updates + +### 1.0.4 + +- Package dependency updates + +### 1.0.3 + +- Package dependency updates + +### 1.0.2 + +- Improved rollup builds + +### 1.0.1 + +- Added config to remove selection set of directive matches test + +### 1.0.0 + +- Added utilities from hermes cache +- Added removeDirectivesFromDocument to allow cleaning of client only + directives +- Added hasDirectives to recurse the AST and return a boolean for an array of + directive names +- Improved performance of common store actions by memoizing addTypename and + removeConnectionDirective diff --git a/node_modules/apollo-utilities/LICENSE b/node_modules/apollo-utilities/LICENSE new file mode 100644 index 000000000..278ee9d8c --- /dev/null +++ b/node_modules/apollo-utilities/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/apollo-utilities/jest.config.js b/node_modules/apollo-utilities/jest.config.js new file mode 100644 index 000000000..48f0a891e --- /dev/null +++ b/node_modules/apollo-utilities/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../../config/jest.config.settings'), +}; diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.js b/node_modules/apollo-utilities/lib/bundle.cjs.js new file mode 100644 index 000000000..bf3d2b665 --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.cjs.js @@ -0,0 +1,1125 @@ +exports.__esModule = true; +exports.addTypenameToDocument = addTypenameToDocument; +exports.argumentsObjectFromField = argumentsObjectFromField; +exports.assign = assign; +exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; +exports.checkDocument = checkDocument; +exports.cloneDeep = cloneDeep; +exports.createFragmentMap = createFragmentMap; +exports.getDefaultValues = getDefaultValues; +exports.getDirectiveInfoFromField = getDirectiveInfoFromField; +exports.getDirectiveNames = getDirectiveNames; +exports.getDirectivesFromDocument = getDirectivesFromDocument; +exports.getEnv = getEnv; +exports.getFragmentDefinition = getFragmentDefinition; +exports.getFragmentDefinitions = getFragmentDefinitions; +exports.getFragmentQueryDocument = getFragmentQueryDocument; +exports.getInclusionDirectives = getInclusionDirectives; +exports.getMainDefinition = getMainDefinition; +exports.getMutationDefinition = getMutationDefinition; +exports.getOperationDefinition = getOperationDefinition; +exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; +exports.getOperationName = getOperationName; +exports.getQueryDefinition = getQueryDefinition; +exports.getStoreKeyName = getStoreKeyName; +exports.graphQLResultHasError = graphQLResultHasError; +exports.hasClientExports = hasClientExports; +exports.hasDirectives = hasDirectives; +exports.isDevelopment = isDevelopment; +exports.isEnv = isEnv; +exports.isField = isField; +exports.isIdValue = isIdValue; +exports.isInlineFragment = isInlineFragment; +exports.isJsonValue = isJsonValue; +exports.isNumberValue = isNumberValue; +exports.isProduction = isProduction; +exports.isScalarValue = isScalarValue; +exports.isTest = isTest; +exports.maybeDeepFreeze = maybeDeepFreeze; +exports.mergeDeep = mergeDeep; +exports.mergeDeepArray = mergeDeepArray; +exports.removeArgumentsFromDocument = removeArgumentsFromDocument; +exports.removeClientSetsFromDocument = removeClientSetsFromDocument; +exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; +exports.removeDirectivesFromDocument = removeDirectivesFromDocument; +exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; +exports.resultKeyNameFromField = resultKeyNameFromField; +exports.shouldInclude = shouldInclude; +exports.storeKeyNameFromField = storeKeyNameFromField; +exports.stripSymbols = stripSymbols; +exports.toIdValue = toIdValue; +exports.tryFunctionOrLogError = tryFunctionOrLogError; +exports.valueFromNode = valueFromNode; +exports.valueToObjectRepresentation = valueToObjectRepresentation; +exports.variablesInOperation = variablesInOperation; +exports.warnOnceInDevelopment = warnOnceInDevelopment; +exports.canUseWeakMap = exports.isEqual = void 0; + +var _visitor = require("graphql/language/visitor"); + +var _tsInvariant = require("ts-invariant"); + +var _tslib = require("tslib"); + +var _fastJsonStableStringify = _interopRequireDefault(require("fast-json-stable-stringify")); + +var _equality = require("@wry/equality"); + +exports.isEqual = _equality.equal; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function isScalarValue(value) { + return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; +} + +function isNumberValue(value) { + return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; +} + +function isStringValue(value) { + return value.kind === 'StringValue'; +} + +function isBooleanValue(value) { + return value.kind === 'BooleanValue'; +} + +function isIntValue(value) { + return value.kind === 'IntValue'; +} + +function isFloatValue(value) { + return value.kind === 'FloatValue'; +} + +function isVariable(value) { + return value.kind === 'Variable'; +} + +function isObjectValue(value) { + return value.kind === 'ObjectValue'; +} + +function isListValue(value) { + return value.kind === 'ListValue'; +} + +function isEnumValue(value) { + return value.kind === 'EnumValue'; +} + +function isNullValue(value) { + return value.kind === 'NullValue'; +} + +function valueToObjectRepresentation(argObj, name, value, variables) { + if (isIntValue(value) || isFloatValue(value)) { + argObj[name.value] = Number(value.value); + } else if (isBooleanValue(value) || isStringValue(value)) { + argObj[name.value] = value.value; + } else if (isObjectValue(value)) { + var nestedArgObj_1 = {}; + value.fields.map(function (obj) { + return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); + }); + argObj[name.value] = nestedArgObj_1; + } else if (isVariable(value)) { + var variableValue = (variables || {})[value.name.value]; + argObj[name.value] = variableValue; + } else if (isListValue(value)) { + argObj[name.value] = value.values.map(function (listValue) { + var nestedArgArrayObj = {}; + valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); + return nestedArgArrayObj[name.value]; + }); + } else if (isEnumValue(value)) { + argObj[name.value] = value.value; + } else if (isNullValue(value)) { + argObj[name.value] = null; + } else { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(17) : new _tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); + } +} + +function storeKeyNameFromField(field, variables) { + var directivesObj = null; + + if (field.directives) { + directivesObj = {}; + field.directives.forEach(function (directive) { + directivesObj[directive.name.value] = {}; + + if (directive.arguments) { + directive.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); + }); + } + }); + } + + var argObj = null; + + if (field.arguments && field.arguments.length) { + argObj = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(argObj, name, value, variables); + }); + } + + return getStoreKeyName(field.name.value, argObj, directivesObj); +} + +var KNOWN_DIRECTIVES = ['connection', 'include', 'skip', 'client', 'rest', 'export']; + +function getStoreKeyName(fieldName, args, directives) { + if (directives && directives['connection'] && directives['connection']['key']) { + if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { + var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; + filterKeys.sort(); + var queryArgs_1 = args; + var filteredArgs_1 = {}; + filterKeys.forEach(function (key) { + filteredArgs_1[key] = queryArgs_1[key]; + }); + return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; + } else { + return directives['connection']['key']; + } + } + + var completeFieldName = fieldName; + + if (args) { + var stringifiedArgs = (0, _fastJsonStableStringify.default)(args); + completeFieldName += "(" + stringifiedArgs + ")"; + } + + if (directives) { + Object.keys(directives).forEach(function (key) { + if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; + + if (directives[key] && Object.keys(directives[key]).length) { + completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; + } else { + completeFieldName += "@" + key; + } + }); + } + + return completeFieldName; +} + +function argumentsObjectFromField(field, variables) { + if (field.arguments && field.arguments.length) { + var argObj_1 = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(argObj_1, name, value, variables); + }); + return argObj_1; + } + + return null; +} + +function resultKeyNameFromField(field) { + return field.alias ? field.alias.value : field.name.value; +} + +function isField(selection) { + return selection.kind === 'Field'; +} + +function isInlineFragment(selection) { + return selection.kind === 'InlineFragment'; +} + +function isIdValue(idObject) { + return idObject && idObject.type === 'id' && typeof idObject.generated === 'boolean'; +} + +function toIdValue(idConfig, generated) { + if (generated === void 0) { + generated = false; + } + + return (0, _tslib.__assign)({ + type: 'id', + generated: generated + }, typeof idConfig === 'string' ? { + id: idConfig, + typename: undefined + } : idConfig); +} + +function isJsonValue(jsonObject) { + return jsonObject != null && typeof jsonObject === 'object' && jsonObject.type === 'json'; +} + +function defaultValueFromVariable(node) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(18) : new _tsInvariant.InvariantError("Variable nodes are not supported by valueFromNode"); +} + +function valueFromNode(node, onVariable) { + if (onVariable === void 0) { + onVariable = defaultValueFromVariable; + } + + switch (node.kind) { + case 'Variable': + return onVariable(node); + + case 'NullValue': + return null; + + case 'IntValue': + return parseInt(node.value, 10); + + case 'FloatValue': + return parseFloat(node.value); + + case 'ListValue': + return node.values.map(function (v) { + return valueFromNode(v, onVariable); + }); + + case 'ObjectValue': + { + var value = {}; + + for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { + var field = _a[_i]; + value[field.name.value] = valueFromNode(field.value, onVariable); + } + + return value; + } + + default: + return node.value; + } +} + +function getDirectiveInfoFromField(field, variables) { + if (field.directives && field.directives.length) { + var directiveObj_1 = {}; + field.directives.forEach(function (directive) { + directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); + }); + return directiveObj_1; + } + + return null; +} + +function shouldInclude(selection, variables) { + if (variables === void 0) { + variables = {}; + } + + return getInclusionDirectives(selection.directives).every(function (_a) { + var directive = _a.directive, + ifArgument = _a.ifArgument; + var evaledValue = false; + + if (ifArgument.value.kind === 'Variable') { + evaledValue = variables[ifArgument.value.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(evaledValue !== void 0, 3) : (0, _tsInvariant.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); + } else { + evaledValue = ifArgument.value.value; + } + + return directive.name.value === 'skip' ? !evaledValue : evaledValue; + }); +} + +function getDirectiveNames(doc) { + var names = []; + (0, _visitor.visit)(doc, { + Directive: function (node) { + names.push(node.name.value); + } + }); + return names; +} + +function hasDirectives(names, doc) { + return getDirectiveNames(doc).some(function (name) { + return names.indexOf(name) > -1; + }); +} + +function hasClientExports(document) { + return document && hasDirectives(['client'], document) && hasDirectives(['export'], document); +} + +function isInclusionDirective(_a) { + var value = _a.name.value; + return value === 'skip' || value === 'include'; +} + +function getInclusionDirectives(directives) { + return directives ? directives.filter(isInclusionDirective).map(function (directive) { + var directiveArguments = directive.arguments; + var directiveName = directive.name.value; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, 4) : (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); + var ifArgument = directiveArguments[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', 5) : (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); + var ifValue = ifArgument.value; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 6) : (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); + return { + directive: directive, + ifArgument: ifArgument + }; + }) : []; +} + +function getFragmentQueryDocument(document, fragmentName) { + var actualFragmentName = fragmentName; + var fragments = []; + document.definitions.forEach(function (definition) { + if (definition.kind === 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + } + + if (definition.kind === 'FragmentDefinition') { + fragments.push(definition); + } + }); + + if (typeof actualFragmentName === 'undefined') { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragments.length === 1, 2) : (0, _tsInvariant.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); + actualFragmentName = fragments[0].name.value; + } + + var query = (0, _tslib.__assign)({}, document, { + definitions: [{ + kind: 'OperationDefinition', + operation: 'query', + selectionSet: { + kind: 'SelectionSet', + selections: [{ + kind: 'FragmentSpread', + name: { + kind: 'Name', + value: actualFragmentName + } + }] + } + }].concat(document.definitions) + }); + return query; +} + +function assign(target) { + var sources = []; + + for (var _i = 1; _i < arguments.length; _i++) { + sources[_i - 1] = arguments[_i]; + } + + sources.forEach(function (source) { + if (typeof source === 'undefined' || source === null) { + return; + } + + Object.keys(source).forEach(function (key) { + target[key] = source[key]; + }); + }); + return target; +} + +function getMutationDefinition(doc) { + checkDocument(doc); + var mutationDef = doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.operation === 'mutation'; + })[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutationDef, 7) : (0, _tsInvariant.invariant)(mutationDef, 'Must contain a mutation definition.'); + return mutationDef; +} + +function checkDocument(doc) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', 8) : (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + var operations = doc.definitions.filter(function (d) { + return d.kind !== 'FragmentDefinition'; + }).map(function (definition) { + if (definition.kind !== 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(9) : new _tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); + } + + return definition; + }); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(operations.length <= 1, 10) : (0, _tsInvariant.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); + return doc; +} + +function getOperationDefinition(doc) { + checkDocument(doc); + return doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition'; + })[0]; +} + +function getOperationDefinitionOrDie(document) { + var def = getOperationDefinition(document); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(def, 11) : (0, _tsInvariant.invariant)(def, "GraphQL document is missing an operation"); + return def; +} + +function getOperationName(doc) { + return doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.name; + }).map(function (x) { + return x.name.value; + })[0] || null; +} + +function getFragmentDefinitions(doc) { + return doc.definitions.filter(function (definition) { + return definition.kind === 'FragmentDefinition'; + }); +} + +function getQueryDefinition(doc) { + var queryDef = getOperationDefinition(doc); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 12) : (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); + return queryDef; +} + +function getFragmentDefinition(doc) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.kind === 'Document', 13) : (0, _tsInvariant.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 14) : (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); + var fragmentDef = doc.definitions[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 15) : (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); + return fragmentDef; +} + +function getMainDefinition(queryDoc) { + checkDocument(queryDoc); + var fragmentDefinition; + + for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { + var definition = _a[_i]; + + if (definition.kind === 'OperationDefinition') { + var operation = definition.operation; + + if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { + return definition; + } + } + + if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { + fragmentDefinition = definition; + } + } + + if (fragmentDefinition) { + return fragmentDefinition; + } + + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(16) : new _tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); +} + +function createFragmentMap(fragments) { + if (fragments === void 0) { + fragments = []; + } + + var symTable = {}; + fragments.forEach(function (fragment) { + symTable[fragment.name.value] = fragment; + }); + return symTable; +} + +function getDefaultValues(definition) { + if (definition && definition.variableDefinitions && definition.variableDefinitions.length) { + var defaultValues = definition.variableDefinitions.filter(function (_a) { + var defaultValue = _a.defaultValue; + return defaultValue; + }).map(function (_a) { + var variable = _a.variable, + defaultValue = _a.defaultValue; + var defaultValueObj = {}; + valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); + return defaultValueObj; + }); + return assign.apply(void 0, [{}].concat(defaultValues)); + } + + return {}; +} + +function variablesInOperation(operation) { + var names = new Set(); + + if (operation.variableDefinitions) { + for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { + var definition = _a[_i]; + names.add(definition.variable.name.value); + } + } + + return names; +} + +function filterInPlace(array, test, context) { + var target = 0; + array.forEach(function (elem, i) { + if (test.call(this, elem, i, array)) { + array[target++] = elem; + } + }, context); + array.length = target; + return array; +} + +var TYPENAME_FIELD = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename' + } +}; + +function isEmpty(op, fragments) { + return op.selectionSet.selections.every(function (selection) { + return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); + }); +} + +function nullIfDocIsEmpty(doc) { + return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) ? null : doc; +} + +function getDirectiveMatcher(directives) { + return function directiveMatcher(directive) { + return directives.some(function (dir) { + return dir.name && dir.name === directive.name.value || dir.test && dir.test(directive); + }); + }; +} + +function removeDirectivesFromDocument(directives, doc) { + var variablesInUse = Object.create(null); + var variablesToRemove = []; + var fragmentSpreadsInUse = Object.create(null); + var fragmentSpreadsToRemove = []; + var modifiedDoc = nullIfDocIsEmpty((0, _visitor.visit)(doc, { + Variable: { + enter: function (node, _key, parent) { + if (parent.kind !== 'VariableDefinition') { + variablesInUse[node.name.value] = true; + } + } + }, + Field: { + enter: function (node) { + if (directives && node.directives) { + var shouldRemoveField = directives.some(function (directive) { + return directive.remove; + }); + + if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { + if (node.arguments) { + node.arguments.forEach(function (arg) { + if (arg.value.kind === 'Variable') { + variablesToRemove.push({ + name: arg.value.name.value + }); + } + }); + } + + if (node.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { + fragmentSpreadsToRemove.push({ + name: frag.name.value + }); + }); + } + + return null; + } + } + } + }, + FragmentSpread: { + enter: function (node) { + fragmentSpreadsInUse[node.name.value] = true; + } + }, + Directive: { + enter: function (node) { + if (getDirectiveMatcher(directives)(node)) { + return null; + } + } + } + })); + + if (modifiedDoc && filterInPlace(variablesToRemove, function (v) { + return !variablesInUse[v.name]; + }).length) { + modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); + } + + if (modifiedDoc && filterInPlace(fragmentSpreadsToRemove, function (fs) { + return !fragmentSpreadsInUse[fs.name]; + }).length) { + modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); + } + + return modifiedDoc; +} + +function addTypenameToDocument(doc) { + return (0, _visitor.visit)(checkDocument(doc), { + SelectionSet: { + enter: function (node, _key, parent) { + if (parent && parent.kind === 'OperationDefinition') { + return; + } + + var selections = node.selections; + + if (!selections) { + return; + } + + var skip = selections.some(function (selection) { + return isField(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0); + }); + + if (skip) { + return; + } + + var field = parent; + + if (isField(field) && field.directives && field.directives.some(function (d) { + return d.name.value === 'export'; + })) { + return; + } + + return (0, _tslib.__assign)({}, node, { + selections: selections.concat([TYPENAME_FIELD]) + }); + } + } + }); +} + +var connectionRemoveConfig = { + test: function (directive) { + var willRemove = directive.name.value === 'connection'; + + if (willRemove) { + if (!directive.arguments || !directive.arguments.some(function (arg) { + return arg.name.value === 'key'; + })) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); + } + } + + return willRemove; + } +}; + +function removeConnectionDirectiveFromDocument(doc) { + return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); +} + +function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { + if (nestedCheck === void 0) { + nestedCheck = true; + } + + return selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { + return hasDirectivesInSelection(directives, selection, nestedCheck); + }); +} + +function hasDirectivesInSelection(directives, selection, nestedCheck) { + if (nestedCheck === void 0) { + nestedCheck = true; + } + + if (!isField(selection)) { + return true; + } + + if (!selection.directives) { + return false; + } + + return selection.directives.some(getDirectiveMatcher(directives)) || nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck); +} + +function getDirectivesFromDocument(directives, doc) { + checkDocument(doc); + var parentPath; + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + SelectionSet: { + enter: function (node, _key, _parent, path) { + var currentPath = path.join('-'); + + if (!parentPath || currentPath === parentPath || !currentPath.startsWith(parentPath)) { + if (node.selections) { + var selectionsWithDirectives = node.selections.filter(function (selection) { + return hasDirectivesInSelection(directives, selection); + }); + + if (hasDirectivesInSelectionSet(directives, node, false)) { + parentPath = currentPath; + } + + return (0, _tslib.__assign)({}, node, { + selections: selectionsWithDirectives + }); + } else { + return null; + } + } + } + } + })); +} + +function getArgumentMatcher(config) { + return function argumentMatcher(argument) { + return config.some(function (aConfig) { + return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || aConfig.test && aConfig.test(argument)); + }); + }; +} + +function removeArgumentsFromDocument(config, doc) { + var argMatcher = getArgumentMatcher(config); + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + OperationDefinition: { + enter: function (node) { + return (0, _tslib.__assign)({}, node, { + variableDefinitions: node.variableDefinitions.filter(function (varDef) { + return !config.some(function (arg) { + return arg.name === varDef.variable.name.value; + }); + }) + }); + } + }, + Field: { + enter: function (node) { + var shouldRemoveField = config.some(function (argConfig) { + return argConfig.remove; + }); + + if (shouldRemoveField) { + var argMatchCount_1 = 0; + node.arguments.forEach(function (arg) { + if (argMatcher(arg)) { + argMatchCount_1 += 1; + } + }); + + if (argMatchCount_1 === 1) { + return null; + } + } + } + }, + Argument: { + enter: function (node) { + if (argMatcher(node)) { + return null; + } + } + } + })); +} + +function removeFragmentSpreadFromDocument(config, doc) { + function enter(node) { + if (config.some(function (def) { + return def.name === node.name.value; + })) { + return null; + } + } + + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + FragmentSpread: { + enter: enter + }, + FragmentDefinition: { + enter: enter + } + })); +} + +function getAllFragmentSpreadsFromSelectionSet(selectionSet) { + var allFragments = []; + selectionSet.selections.forEach(function (selection) { + if ((isField(selection) || isInlineFragment(selection)) && selection.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { + return allFragments.push(frag); + }); + } else if (selection.kind === 'FragmentSpread') { + allFragments.push(selection); + } + }); + return allFragments; +} + +function buildQueryFromSelectionSet(document) { + var definition = getMainDefinition(document); + var definitionOperation = definition.operation; + + if (definitionOperation === 'query') { + return document; + } + + var modifiedDoc = (0, _visitor.visit)(document, { + OperationDefinition: { + enter: function (node) { + return (0, _tslib.__assign)({}, node, { + operation: 'query' + }); + } + } + }); + return modifiedDoc; +} + +function removeClientSetsFromDocument(document) { + checkDocument(document); + var modifiedDoc = removeDirectivesFromDocument([{ + test: function (directive) { + return directive.name.value === 'client'; + }, + remove: true + }], document); + + if (modifiedDoc) { + modifiedDoc = (0, _visitor.visit)(modifiedDoc, { + FragmentDefinition: { + enter: function (node) { + if (node.selectionSet) { + var isTypenameOnly = node.selectionSet.selections.every(function (selection) { + return isField(selection) && selection.name.value === '__typename'; + }); + + if (isTypenameOnly) { + return null; + } + } + } + } + }); + } + + return modifiedDoc; +} + +var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); +exports.canUseWeakMap = canUseWeakMap; +var toString = Object.prototype.toString; + +function cloneDeep(value) { + return cloneDeepHelper(value, new Map()); +} + +function cloneDeepHelper(val, seen) { + switch (toString.call(val)) { + case "[object Array]": + { + if (seen.has(val)) return seen.get(val); + var copy_1 = val.slice(0); + seen.set(val, copy_1); + copy_1.forEach(function (child, i) { + copy_1[i] = cloneDeepHelper(child, seen); + }); + return copy_1; + } + + case "[object Object]": + { + if (seen.has(val)) return seen.get(val); + var copy_2 = Object.create(Object.getPrototypeOf(val)); + seen.set(val, copy_2); + Object.keys(val).forEach(function (key) { + copy_2[key] = cloneDeepHelper(val[key], seen); + }); + return copy_2; + } + + default: + return val; + } +} + +function getEnv() { + if (typeof process !== 'undefined' && process.env.NODE_ENV) { + return process.env.NODE_ENV; + } + + return 'development'; +} + +function isEnv(env) { + return getEnv() === env; +} + +function isProduction() { + return isEnv('production') === true; +} + +function isDevelopment() { + return isEnv('development') === true; +} + +function isTest() { + return isEnv('test') === true; +} + +function tryFunctionOrLogError(f) { + try { + return f(); + } catch (e) { + if (console.error) { + console.error(e); + } + } +} + +function graphQLResultHasError(result) { + return result.errors && result.errors.length; +} + +function deepFreeze(o) { + Object.freeze(o); + Object.getOwnPropertyNames(o).forEach(function (prop) { + if (o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { + deepFreeze(o[prop]); + } + }); + return o; +} + +function maybeDeepFreeze(obj) { + if (isDevelopment() || isTest()) { + var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; + + if (!symbolIsPolyfilled) { + return deepFreeze(obj); + } + } + + return obj; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function mergeDeep() { + var sources = []; + + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i] = arguments[_i]; + } + + return mergeDeepArray(sources); +} + +function mergeDeepArray(sources) { + var target = sources[0] || {}; + var count = sources.length; + + if (count > 1) { + var pastCopies = []; + target = shallowCopyForMerge(target, pastCopies); + + for (var i = 1; i < count; ++i) { + target = mergeHelper(target, sources[i], pastCopies); + } + } + + return target; +} + +function isObject(obj) { + return obj !== null && typeof obj === 'object'; +} + +function mergeHelper(target, source, pastCopies) { + if (isObject(source) && isObject(target)) { + if (Object.isExtensible && !Object.isExtensible(target)) { + target = shallowCopyForMerge(target, pastCopies); + } + + Object.keys(source).forEach(function (sourceKey) { + var sourceValue = source[sourceKey]; + + if (hasOwnProperty.call(target, sourceKey)) { + var targetValue = target[sourceKey]; + + if (sourceValue !== targetValue) { + target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); + } + } else { + target[sourceKey] = sourceValue; + } + }); + return target; + } + + return source; +} + +function shallowCopyForMerge(value, pastCopies) { + if (value !== null && typeof value === 'object' && pastCopies.indexOf(value) < 0) { + if (Array.isArray(value)) { + value = value.slice(0); + } else { + value = (0, _tslib.__assign)({ + __proto__: Object.getPrototypeOf(value) + }, value); + } + + pastCopies.push(value); + } + + return value; +} + +var haveWarned = Object.create({}); + +function warnOnceInDevelopment(msg, type) { + if (type === void 0) { + type = 'warn'; + } + + if (!isProduction() && !haveWarned[msg]) { + if (!isTest()) { + haveWarned[msg] = true; + } + + if (type === 'error') { + console.error(msg); + } else { + console.warn(msg); + } + } +} + +function stripSymbols(data) { + return JSON.parse(JSON.stringify(data)); +} diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.js.map b/node_modules/apollo-utilities/lib/bundle.cjs.js.map new file mode 100644 index 000000000..b2aeb7b1f --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAiDgB,a,CAAc,K,EAAgB;AAC5C,SAAO,CAAC,aAAD,EAAgB,cAAhB,EAAgC,WAAhC,EAA6C,OAA7C,CAAqD,KAAK,CAAC,IAA3D,IAAmE,CAAC,CAA3E;AACD;;AAID,SAAgB,aAAhB,CAA8B,KAA9B,EAA8C;AAC5C,SAAO,CAAC,UAAD,EAAa,YAAb,EAA2B,OAA3B,CAAmC,KAAK,CAAC,IAAzC,IAAiD,CAAC,CAAzD;AACD;;AAED,SAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,SAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,SAAS,cAAT,CAAwB,KAAxB,EAAwC;AACtC,SAAO,KAAK,CAAC,IA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d,CAAoB,CAApB,CAAT;AACD,KAFD,MAEO;AACL,MAAA,KAAK,GAAA,qBAAA;AACH,QAAA,SAAS,EAAE,MAAM,CAAC,cAAP,CAAsB,KAAtB;AADR,OAAA,EAEA,KAFA,CAAL;AAID;;AACD,IAAA,UAAU,CAAC,IAAX,CAAgB,KAAhB;AACD;;AACD,SAAO,KAAP;AACD;;AChHD,IAAM,UAAU,GAAG,MAAM,CAAC,MAAP,CAAc,EAAd,CAAnB;;AAUA,SAAgB,qBAAhB,CAAsC,GAAtC,EAAmD,IAAnD,EAAgE;AAAb,MAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAA,IAAA,IAAA,GAAA,MAAA;AAAa;;AAC9D,MAAI,CAAC,YAAY,EAAb,IAAmB,CAAC,UAAU,CAAC,GAAD,CAAlC,EAAyC;AACvC,QAAI,CAAC,MAAM,EAAX,EAAe;AACb,MAAA,UAAU,CAAC,GAAD,CAAV,GAAkB,IAAlB;AACD;;AACD,QAAI,IAAI,KAAK,OAAb,EAAsB;AACpB,MAAA,OAAO,CAAC,KAAR,CAAc,GAAd;AACD,KAFD,MAEO;AACL,MAAA,OAAO,CAAC,IAAR,CAAa,GAAb;AACD;AACF;AACF;;SCZe,Y,CAAgB,I,EAAO;AACrC,SAAO,IAAI,CAAC,KAAL,CAAW,IAAI,CAAC,SAAL,CAAe,IAAf,CAAX,CAAP;AACD,C","sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.min.js b/node_modules/apollo-utilities/lib/bundle.cjs.min.js new file mode 100644 index 000000000..85e7e124e --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.cjs.min.js @@ -0,0 +1 @@ +exports.__esModule=!0,exports.addTypenameToDocument=function(e){return(0,n.visit)(h(e),{SelectionSet:{enter:function(e,n,t){if(!t||"OperationDefinition"!==t.kind){var i=e.selections;if(i){var o=i.some(function(e){return l(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))});if(!o){var a=t;if(!(l(a)&&a.directives&&a.directives.some(function(e){return"export"===e.name.value})))return(0,r.__assign)({},e,{selections:i.concat([E])})}}}}}})},exports.argumentsObjectFromField=f,exports.assign=x,exports.buildQueryFromSelectionSet=function(e){if("query"===k(e).operation)return e;return(0,n.visit)(e,{OperationDefinition:{enter:function(e){return(0,r.__assign)({},e,{operation:"query"})}}})},exports.checkDocument=h,exports.cloneDeep=function(e){return function e(n,t){switch(A.call(n)){case"[object Array]":if(t.has(n))return t.get(n);var r=n.slice(0);return t.set(n,r),r.forEach(function(n,i){r[i]=e(n,t)}),r;case"[object Object]":if(t.has(n))return t.get(n);var i=Object.create(Object.getPrototypeOf(n));return t.set(n,i),Object.keys(n).forEach(function(r){i[r]=e(n[r],t)}),i;default:return n}}(e,new Map)},exports.createFragmentMap=O,exports.getDefaultValues=function(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var n=e.variableDefinitions.filter(function(e){var n=e.defaultValue;return n}).map(function(e){var n=e.variable,t=e.defaultValue,r={};return a(r,n.name,t),r});return x.apply(void 0,[{}].concat(n))}return{}},exports.getDirectiveInfoFromField=function(e,n){if(e.directives&&e.directives.length){var t={};return e.directives.forEach(function(e){t[e.name.value]=f(e,n)}),t}return null},exports.getDirectiveNames=m,exports.getDirectivesFromDocument=function(e,t){var i;return h(t),S((0,n.visit)(t,{SelectionSet:{enter:function(n,t,o,a){var u=a.join("-");if(!i||u===i||!u.startsWith(i)){if(n.selections){var c=n.selections.filter(function(n){return I(e,n)});return w(e,n,!1)&&(i=u),(0,r.__assign)({},n,{selections:c})}return null}}}}))},exports.getEnv=J,exports.getFragmentDefinition=D,exports.getFragmentDefinitions=b,exports.getFragmentQueryDocument=function(e,n){var i=n,o=[];e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new t.InvariantError(1);"FragmentDefinition"===e.kind&&o.push(e)}),void 0===i&&((0,t.invariant)(1===o.length,2),i=o[0].name.value);return(0,r.__assign)({},e,{definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:i}}]}}].concat(e.definitions)})},exports.getInclusionDirectives=g,exports.getMainDefinition=k,exports.getMutationDefinition=function(e){h(e);var n=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})[0];return(0,t.invariant)(n,7),n},exports.getOperationDefinition=y,exports.getOperationDefinitionOrDie=function(e){var n=y(e);return(0,t.invariant)(n,11),n},exports.getOperationName=function(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null},exports.getQueryDefinition=function(e){var n=y(e);return(0,t.invariant)(n&&"query"===n.operation,12),n},exports.getStoreKeyName=c,exports.graphQLResultHasError=function(e){return e.errors&&e.errors.length},exports.hasClientExports=function(e){return e&&p(["client"],e)&&p(["export"],e)},exports.hasDirectives=p,exports.isDevelopment=Q,exports.isEnv=P,exports.isField=l,exports.isIdValue=function(e){return e&&"id"===e.type&&"boolean"==typeof e.generated},exports.isInlineFragment=s,exports.isJsonValue=function(e){return null!=e&&"object"==typeof e&&"json"===e.type},exports.isNumberValue=function(e){return["IntValue","FloatValue"].indexOf(e.kind)>-1},exports.isProduction=L,exports.isScalarValue=function(e){return["StringValue","BooleanValue","EnumValue"].indexOf(e.kind)>-1},exports.isTest=T,exports.maybeDeepFreeze=function(e){if(Q()||T()){var n="function"==typeof Symbol&&"string"==typeof Symbol("");if(!n)return function e(n){Object.freeze(n);Object.getOwnPropertyNames(n).forEach(function(t){null===n[t]||"object"!=typeof n[t]&&"function"!=typeof n[t]||Object.isFrozen(n[t])||e(n[t])});return n}(e)}return e},exports.mergeDeep=function(){for(var e=[],n=0;n0){var r=t.connection.filter?t.connection.filter:[];r.sort();var o=n,a={};return r.forEach(function(e){a[e]=o[e]}),t.connection.key+"("+JSON.stringify(a)+")"}return t.connection.key}var c=e;if(n){var f=(0,i.default)(n);c+="("+f+")"}return t&&Object.keys(t).forEach(function(e){-1===u.indexOf(e)&&(t[e]&&Object.keys(t[e]).length?c+="@"+e+"("+JSON.stringify(t[e])+")":c+="@"+e)}),c}function f(e,n){if(e.arguments&&e.arguments.length){var t={};return e.arguments.forEach(function(e){var r=e.name,i=e.value;return a(t,r,i,n)}),t}return null}function l(e){return"Field"===e.kind}function s(e){return"InlineFragment"===e.kind}function v(e){throw new t.InvariantError(18)}function m(e){var t=[];return(0,n.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}function p(e,n){return m(n).some(function(n){return e.indexOf(n)>-1})}function d(e){var n=e.name.value;return"skip"===n||"include"===n}function g(e){return e?e.filter(d).map(function(e){var n=e.arguments;e.name.value;(0,t.invariant)(n&&1===n.length,4);var r=n[0];(0,t.invariant)(r.name&&"if"===r.name.value,5);var i=r.value;return(0,t.invariant)(i&&("Variable"===i.kind||"BooleanValue"===i.kind),6),{directive:e,ifArgument:r}}):[]}function x(e){for(var n=[],t=1;t1){var r=[];n=K(n,r);for(var i=1;i -1; +} +function isNumberValue(value) { + return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; +} +function isStringValue(value) { + return value.kind === 'StringValue'; +} +function isBooleanValue(value) { + return value.kind === 'BooleanValue'; +} +function isIntValue(value) { + return value.kind === 'IntValue'; +} +function isFloatValue(value) { + return value.kind === 'FloatValue'; +} +function isVariable(value) { + return value.kind === 'Variable'; +} +function isObjectValue(value) { + return value.kind === 'ObjectValue'; +} +function isListValue(value) { + return value.kind === 'ListValue'; +} +function isEnumValue(value) { + return value.kind === 'EnumValue'; +} +function isNullValue(value) { + return value.kind === 'NullValue'; +} +function valueToObjectRepresentation(argObj, name, value, variables) { + if (isIntValue(value) || isFloatValue(value)) { + argObj[name.value] = Number(value.value); + } + else if (isBooleanValue(value) || isStringValue(value)) { + argObj[name.value] = value.value; + } + else if (isObjectValue(value)) { + var nestedArgObj_1 = {}; + value.fields.map(function (obj) { + return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); + }); + argObj[name.value] = nestedArgObj_1; + } + else if (isVariable(value)) { + var variableValue = (variables || {})[value.name.value]; + argObj[name.value] = variableValue; + } + else if (isListValue(value)) { + argObj[name.value] = value.values.map(function (listValue) { + var nestedArgArrayObj = {}; + valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); + return nestedArgArrayObj[name.value]; + }); + } + else if (isEnumValue(value)) { + argObj[name.value] = value.value; + } + else if (isNullValue(value)) { + argObj[name.value] = null; + } + else { + throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + + 'is not supported. Use variables instead of inline arguments to ' + + 'overcome this limitation.'); + } +} +function storeKeyNameFromField(field, variables) { + var directivesObj = null; + if (field.directives) { + directivesObj = {}; + field.directives.forEach(function (directive) { + directivesObj[directive.name.value] = {}; + if (directive.arguments) { + directive.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); + }); + } + }); + } + var argObj = null; + if (field.arguments && field.arguments.length) { + argObj = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(argObj, name, value, variables); + }); + } + return getStoreKeyName(field.name.value, argObj, directivesObj); +} +var KNOWN_DIRECTIVES = [ + 'connection', + 'include', + 'skip', + 'client', + 'rest', + 'export', +]; +function getStoreKeyName(fieldName, args, directives) { + if (directives && + directives['connection'] && + directives['connection']['key']) { + if (directives['connection']['filter'] && + directives['connection']['filter'].length > 0) { + var filterKeys = directives['connection']['filter'] + ? directives['connection']['filter'] + : []; + filterKeys.sort(); + var queryArgs_1 = args; + var filteredArgs_1 = {}; + filterKeys.forEach(function (key) { + filteredArgs_1[key] = queryArgs_1[key]; + }); + return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; + } + else { + return directives['connection']['key']; + } + } + var completeFieldName = fieldName; + if (args) { + var stringifiedArgs = stringify(args); + completeFieldName += "(" + stringifiedArgs + ")"; + } + if (directives) { + Object.keys(directives).forEach(function (key) { + if (KNOWN_DIRECTIVES.indexOf(key) !== -1) + return; + if (directives[key] && Object.keys(directives[key]).length) { + completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; + } + else { + completeFieldName += "@" + key; + } + }); + } + return completeFieldName; +} +function argumentsObjectFromField(field, variables) { + if (field.arguments && field.arguments.length) { + var argObj_1 = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(argObj_1, name, value, variables); + }); + return argObj_1; + } + return null; +} +function resultKeyNameFromField(field) { + return field.alias ? field.alias.value : field.name.value; +} +function isField(selection) { + return selection.kind === 'Field'; +} +function isInlineFragment(selection) { + return selection.kind === 'InlineFragment'; +} +function isIdValue(idObject) { + return idObject && + idObject.type === 'id' && + typeof idObject.generated === 'boolean'; +} +function toIdValue(idConfig, generated) { + if (generated === void 0) { generated = false; } + return __assign({ type: 'id', generated: generated }, (typeof idConfig === 'string' + ? { id: idConfig, typename: undefined } + : idConfig)); +} +function isJsonValue(jsonObject) { + return (jsonObject != null && + typeof jsonObject === 'object' && + jsonObject.type === 'json'); +} +function defaultValueFromVariable(node) { + throw process.env.NODE_ENV === "production" ? new InvariantError(18) : new InvariantError("Variable nodes are not supported by valueFromNode"); +} +function valueFromNode(node, onVariable) { + if (onVariable === void 0) { onVariable = defaultValueFromVariable; } + switch (node.kind) { + case 'Variable': + return onVariable(node); + case 'NullValue': + return null; + case 'IntValue': + return parseInt(node.value, 10); + case 'FloatValue': + return parseFloat(node.value); + case 'ListValue': + return node.values.map(function (v) { return valueFromNode(v, onVariable); }); + case 'ObjectValue': { + var value = {}; + for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { + var field = _a[_i]; + value[field.name.value] = valueFromNode(field.value, onVariable); + } + return value; + } + default: + return node.value; + } +} + +function getDirectiveInfoFromField(field, variables) { + if (field.directives && field.directives.length) { + var directiveObj_1 = {}; + field.directives.forEach(function (directive) { + directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); + }); + return directiveObj_1; + } + return null; +} +function shouldInclude(selection, variables) { + if (variables === void 0) { variables = {}; } + return getInclusionDirectives(selection.directives).every(function (_a) { + var directive = _a.directive, ifArgument = _a.ifArgument; + var evaledValue = false; + if (ifArgument.value.kind === 'Variable') { + evaledValue = variables[ifArgument.value.name.value]; + process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 3) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); + } + else { + evaledValue = ifArgument.value.value; + } + return directive.name.value === 'skip' ? !evaledValue : evaledValue; + }); +} +function getDirectiveNames(doc) { + var names = []; + visit(doc, { + Directive: function (node) { + names.push(node.name.value); + }, + }); + return names; +} +function hasDirectives(names, doc) { + return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; }); +} +function hasClientExports(document) { + return (document && + hasDirectives(['client'], document) && + hasDirectives(['export'], document)); +} +function isInclusionDirective(_a) { + var value = _a.name.value; + return value === 'skip' || value === 'include'; +} +function getInclusionDirectives(directives) { + return directives ? directives.filter(isInclusionDirective).map(function (directive) { + var directiveArguments = directive.arguments; + var directiveName = directive.name.value; + process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 4) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); + var ifArgument = directiveArguments[0]; + process.env.NODE_ENV === "production" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 5) : invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); + var ifValue = ifArgument.value; + process.env.NODE_ENV === "production" ? invariant(ifValue && + (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 6) : invariant(ifValue && + (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); + return { directive: directive, ifArgument: ifArgument }; + }) : []; +} + +function getFragmentQueryDocument(document, fragmentName) { + var actualFragmentName = fragmentName; + var fragments = []; + document.definitions.forEach(function (definition) { + if (definition.kind === 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + } + if (definition.kind === 'FragmentDefinition') { + fragments.push(definition); + } + }); + if (typeof actualFragmentName === 'undefined') { + process.env.NODE_ENV === "production" ? invariant(fragments.length === 1, 2) : invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); + actualFragmentName = fragments[0].name.value; + } + var query = __assign({}, document, { definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { + kind: 'Name', + value: actualFragmentName, + }, + }, + ], + }, + } + ].concat(document.definitions) }); + return query; +} + +function assign(target) { + var sources = []; + for (var _i = 1; _i < arguments.length; _i++) { + sources[_i - 1] = arguments[_i]; + } + sources.forEach(function (source) { + if (typeof source === 'undefined' || source === null) { + return; + } + Object.keys(source).forEach(function (key) { + target[key] = source[key]; + }); + }); + return target; +} + +function getMutationDefinition(doc) { + checkDocument(doc); + var mutationDef = doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && + definition.operation === 'mutation'; + })[0]; + process.env.NODE_ENV === "production" ? invariant(mutationDef, 7) : invariant(mutationDef, 'Must contain a mutation definition.'); + return mutationDef; +} +function checkDocument(doc) { + process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 8) : invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + var operations = doc.definitions + .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) + .map(function (definition) { + if (definition.kind !== 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new InvariantError(9) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); + } + return definition; + }); + process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 10) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); + return doc; +} +function getOperationDefinition(doc) { + checkDocument(doc); + return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; +} +function getOperationDefinitionOrDie(document) { + var def = getOperationDefinition(document); + process.env.NODE_ENV === "production" ? invariant(def, 11) : invariant(def, "GraphQL document is missing an operation"); + return def; +} +function getOperationName(doc) { + return (doc.definitions + .filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.name; + }) + .map(function (x) { return x.name.value; })[0] || null); +} +function getFragmentDefinitions(doc) { + return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); +} +function getQueryDefinition(doc) { + var queryDef = getOperationDefinition(doc); + process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 12) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); + return queryDef; +} +function getFragmentDefinition(doc) { + process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 13) : invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + process.env.NODE_ENV === "production" ? invariant(doc.definitions.length <= 1, 14) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); + var fragmentDef = doc.definitions[0]; + process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 15) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); + return fragmentDef; +} +function getMainDefinition(queryDoc) { + checkDocument(queryDoc); + var fragmentDefinition; + for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { + var definition = _a[_i]; + if (definition.kind === 'OperationDefinition') { + var operation = definition.operation; + if (operation === 'query' || + operation === 'mutation' || + operation === 'subscription') { + return definition; + } + } + if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { + fragmentDefinition = definition; + } + } + if (fragmentDefinition) { + return fragmentDefinition; + } + throw process.env.NODE_ENV === "production" ? new InvariantError(16) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); +} +function createFragmentMap(fragments) { + if (fragments === void 0) { fragments = []; } + var symTable = {}; + fragments.forEach(function (fragment) { + symTable[fragment.name.value] = fragment; + }); + return symTable; +} +function getDefaultValues(definition) { + if (definition && + definition.variableDefinitions && + definition.variableDefinitions.length) { + var defaultValues = definition.variableDefinitions + .filter(function (_a) { + var defaultValue = _a.defaultValue; + return defaultValue; + }) + .map(function (_a) { + var variable = _a.variable, defaultValue = _a.defaultValue; + var defaultValueObj = {}; + valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); + return defaultValueObj; + }); + return assign.apply(void 0, [{}].concat(defaultValues)); + } + return {}; +} +function variablesInOperation(operation) { + var names = new Set(); + if (operation.variableDefinitions) { + for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { + var definition = _a[_i]; + names.add(definition.variable.name.value); + } + } + return names; +} + +function filterInPlace(array, test, context) { + var target = 0; + array.forEach(function (elem, i) { + if (test.call(this, elem, i, array)) { + array[target++] = elem; + } + }, context); + array.length = target; + return array; +} + +var TYPENAME_FIELD = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename', + }, +}; +function isEmpty(op, fragments) { + return op.selectionSet.selections.every(function (selection) { + return selection.kind === 'FragmentSpread' && + isEmpty(fragments[selection.name.value], fragments); + }); +} +function nullIfDocIsEmpty(doc) { + return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) + ? null + : doc; +} +function getDirectiveMatcher(directives) { + return function directiveMatcher(directive) { + return directives.some(function (dir) { + return (dir.name && dir.name === directive.name.value) || + (dir.test && dir.test(directive)); + }); + }; +} +function removeDirectivesFromDocument(directives, doc) { + var variablesInUse = Object.create(null); + var variablesToRemove = []; + var fragmentSpreadsInUse = Object.create(null); + var fragmentSpreadsToRemove = []; + var modifiedDoc = nullIfDocIsEmpty(visit(doc, { + Variable: { + enter: function (node, _key, parent) { + if (parent.kind !== 'VariableDefinition') { + variablesInUse[node.name.value] = true; + } + }, + }, + Field: { + enter: function (node) { + if (directives && node.directives) { + var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); + if (shouldRemoveField && + node.directives && + node.directives.some(getDirectiveMatcher(directives))) { + if (node.arguments) { + node.arguments.forEach(function (arg) { + if (arg.value.kind === 'Variable') { + variablesToRemove.push({ + name: arg.value.name.value, + }); + } + }); + } + if (node.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { + fragmentSpreadsToRemove.push({ + name: frag.name.value, + }); + }); + } + return null; + } + } + }, + }, + FragmentSpread: { + enter: function (node) { + fragmentSpreadsInUse[node.name.value] = true; + }, + }, + Directive: { + enter: function (node) { + if (getDirectiveMatcher(directives)(node)) { + return null; + } + }, + }, + })); + if (modifiedDoc && + filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) { + modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); + } + if (modifiedDoc && + filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; }) + .length) { + modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); + } + return modifiedDoc; +} +function addTypenameToDocument(doc) { + return visit(checkDocument(doc), { + SelectionSet: { + enter: function (node, _key, parent) { + if (parent && + parent.kind === 'OperationDefinition') { + return; + } + var selections = node.selections; + if (!selections) { + return; + } + var skip = selections.some(function (selection) { + return (isField(selection) && + (selection.name.value === '__typename' || + selection.name.value.lastIndexOf('__', 0) === 0)); + }); + if (skip) { + return; + } + var field = parent; + if (isField(field) && + field.directives && + field.directives.some(function (d) { return d.name.value === 'export'; })) { + return; + } + return __assign({}, node, { selections: selections.concat([TYPENAME_FIELD]) }); + }, + }, + }); +} +var connectionRemoveConfig = { + test: function (directive) { + var willRemove = directive.name.value === 'connection'; + if (willRemove) { + if (!directive.arguments || + !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { + process.env.NODE_ENV === "production" || invariant.warn('Removing an @connection directive even though it does not have a key. ' + + 'You may want to use the key parameter to specify a store key.'); + } + } + return willRemove; + }, +}; +function removeConnectionDirectiveFromDocument(doc) { + return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); +} +function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { + if (nestedCheck === void 0) { nestedCheck = true; } + return (selectionSet && + selectionSet.selections && + selectionSet.selections.some(function (selection) { + return hasDirectivesInSelection(directives, selection, nestedCheck); + })); +} +function hasDirectivesInSelection(directives, selection, nestedCheck) { + if (nestedCheck === void 0) { nestedCheck = true; } + if (!isField(selection)) { + return true; + } + if (!selection.directives) { + return false; + } + return (selection.directives.some(getDirectiveMatcher(directives)) || + (nestedCheck && + hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); +} +function getDirectivesFromDocument(directives, doc) { + checkDocument(doc); + var parentPath; + return nullIfDocIsEmpty(visit(doc, { + SelectionSet: { + enter: function (node, _key, _parent, path) { + var currentPath = path.join('-'); + if (!parentPath || + currentPath === parentPath || + !currentPath.startsWith(parentPath)) { + if (node.selections) { + var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); }); + if (hasDirectivesInSelectionSet(directives, node, false)) { + parentPath = currentPath; + } + return __assign({}, node, { selections: selectionsWithDirectives }); + } + else { + return null; + } + } + }, + }, + })); +} +function getArgumentMatcher(config) { + return function argumentMatcher(argument) { + return config.some(function (aConfig) { + return argument.value && + argument.value.kind === 'Variable' && + argument.value.name && + (aConfig.name === argument.value.name.value || + (aConfig.test && aConfig.test(argument))); + }); + }; +} +function removeArgumentsFromDocument(config, doc) { + var argMatcher = getArgumentMatcher(config); + return nullIfDocIsEmpty(visit(doc, { + OperationDefinition: { + enter: function (node) { + return __assign({}, node, { variableDefinitions: node.variableDefinitions.filter(function (varDef) { + return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); + }) }); + }, + }, + Field: { + enter: function (node) { + var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); + if (shouldRemoveField) { + var argMatchCount_1 = 0; + node.arguments.forEach(function (arg) { + if (argMatcher(arg)) { + argMatchCount_1 += 1; + } + }); + if (argMatchCount_1 === 1) { + return null; + } + } + }, + }, + Argument: { + enter: function (node) { + if (argMatcher(node)) { + return null; + } + }, + }, + })); +} +function removeFragmentSpreadFromDocument(config, doc) { + function enter(node) { + if (config.some(function (def) { return def.name === node.name.value; })) { + return null; + } + } + return nullIfDocIsEmpty(visit(doc, { + FragmentSpread: { enter: enter }, + FragmentDefinition: { enter: enter }, + })); +} +function getAllFragmentSpreadsFromSelectionSet(selectionSet) { + var allFragments = []; + selectionSet.selections.forEach(function (selection) { + if ((isField(selection) || isInlineFragment(selection)) && + selection.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); + } + else if (selection.kind === 'FragmentSpread') { + allFragments.push(selection); + } + }); + return allFragments; +} +function buildQueryFromSelectionSet(document) { + var definition = getMainDefinition(document); + var definitionOperation = definition.operation; + if (definitionOperation === 'query') { + return document; + } + var modifiedDoc = visit(document, { + OperationDefinition: { + enter: function (node) { + return __assign({}, node, { operation: 'query' }); + }, + }, + }); + return modifiedDoc; +} +function removeClientSetsFromDocument(document) { + checkDocument(document); + var modifiedDoc = removeDirectivesFromDocument([ + { + test: function (directive) { return directive.name.value === 'client'; }, + remove: true, + }, + ], document); + if (modifiedDoc) { + modifiedDoc = visit(modifiedDoc, { + FragmentDefinition: { + enter: function (node) { + if (node.selectionSet) { + var isTypenameOnly = node.selectionSet.selections.every(function (selection) { + return isField(selection) && selection.name.value === '__typename'; + }); + if (isTypenameOnly) { + return null; + } + } + }, + }, + }); + } + return modifiedDoc; +} + +var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && + navigator.product === 'ReactNative'); + +var toString = Object.prototype.toString; +function cloneDeep(value) { + return cloneDeepHelper(value, new Map()); +} +function cloneDeepHelper(val, seen) { + switch (toString.call(val)) { + case "[object Array]": { + if (seen.has(val)) + return seen.get(val); + var copy_1 = val.slice(0); + seen.set(val, copy_1); + copy_1.forEach(function (child, i) { + copy_1[i] = cloneDeepHelper(child, seen); + }); + return copy_1; + } + case "[object Object]": { + if (seen.has(val)) + return seen.get(val); + var copy_2 = Object.create(Object.getPrototypeOf(val)); + seen.set(val, copy_2); + Object.keys(val).forEach(function (key) { + copy_2[key] = cloneDeepHelper(val[key], seen); + }); + return copy_2; + } + default: + return val; + } +} + +function getEnv() { + if (typeof process !== 'undefined' && process.env.NODE_ENV) { + return process.env.NODE_ENV; + } + return 'development'; +} +function isEnv(env) { + return getEnv() === env; +} +function isProduction() { + return isEnv('production') === true; +} +function isDevelopment() { + return isEnv('development') === true; +} +function isTest() { + return isEnv('test') === true; +} + +function tryFunctionOrLogError(f) { + try { + return f(); + } + catch (e) { + if (console.error) { + console.error(e); + } + } +} +function graphQLResultHasError(result) { + return result.errors && result.errors.length; +} + +function deepFreeze(o) { + Object.freeze(o); + Object.getOwnPropertyNames(o).forEach(function (prop) { + if (o[prop] !== null && + (typeof o[prop] === 'object' || typeof o[prop] === 'function') && + !Object.isFrozen(o[prop])) { + deepFreeze(o[prop]); + } + }); + return o; +} +function maybeDeepFreeze(obj) { + if (isDevelopment() || isTest()) { + var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; + if (!symbolIsPolyfilled) { + return deepFreeze(obj); + } + } + return obj; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +function mergeDeep() { + var sources = []; + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i] = arguments[_i]; + } + return mergeDeepArray(sources); +} +function mergeDeepArray(sources) { + var target = sources[0] || {}; + var count = sources.length; + if (count > 1) { + var pastCopies = []; + target = shallowCopyForMerge(target, pastCopies); + for (var i = 1; i < count; ++i) { + target = mergeHelper(target, sources[i], pastCopies); + } + } + return target; +} +function isObject(obj) { + return obj !== null && typeof obj === 'object'; +} +function mergeHelper(target, source, pastCopies) { + if (isObject(source) && isObject(target)) { + if (Object.isExtensible && !Object.isExtensible(target)) { + target = shallowCopyForMerge(target, pastCopies); + } + Object.keys(source).forEach(function (sourceKey) { + var sourceValue = source[sourceKey]; + if (hasOwnProperty.call(target, sourceKey)) { + var targetValue = target[sourceKey]; + if (sourceValue !== targetValue) { + target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); + } + } + else { + target[sourceKey] = sourceValue; + } + }); + return target; + } + return source; +} +function shallowCopyForMerge(value, pastCopies) { + if (value !== null && + typeof value === 'object' && + pastCopies.indexOf(value) < 0) { + if (Array.isArray(value)) { + value = value.slice(0); + } + else { + value = __assign({ __proto__: Object.getPrototypeOf(value) }, value); + } + pastCopies.push(value); + } + return value; +} + +var haveWarned = Object.create({}); +function warnOnceInDevelopment(msg, type) { + if (type === void 0) { type = 'warn'; } + if (!isProduction() && !haveWarned[msg]) { + if (!isTest()) { + haveWarned[msg] = true; + } + if (type === 'error') { + console.error(msg); + } + else { + console.warn(msg); + } + } +} + +function stripSymbols(data) { + return JSON.parse(JSON.stringify(data)); +} + +export { addTypenameToDocument, argumentsObjectFromField, assign, buildQueryFromSelectionSet, canUseWeakMap, checkDocument, cloneDeep, createFragmentMap, getDefaultValues, getDirectiveInfoFromField, getDirectiveNames, getDirectivesFromDocument, getEnv, getFragmentDefinition, getFragmentDefinitions, getFragmentQueryDocument, getInclusionDirectives, getMainDefinition, getMutationDefinition, getOperationDefinition, getOperationDefinitionOrDie, getOperationName, getQueryDefinition, getStoreKeyName, graphQLResultHasError, hasClientExports, hasDirectives, isDevelopment, isEnv, isField, isIdValue, isInlineFragment, isJsonValue, isNumberValue, isProduction, isScalarValue, isTest, maybeDeepFreeze, mergeDeep, mergeDeepArray, removeArgumentsFromDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, removeDirectivesFromDocument, removeFragmentSpreadFromDocument, resultKeyNameFromField, shouldInclude, storeKeyNameFromField, stripSymbols, toIdValue, tryFunctionOrLogError, valueFromNode, valueToObjectRepresentation, variablesInOperation, warnOnceInDevelopment }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-utilities/lib/bundle.esm.js.map b/node_modules/apollo-utilities/lib/bundle.esm.js.map new file mode 100644 index 000000000..db085579d --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"],"names":[],"mappings":";;;;;;SAiDgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9E;AAID,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5D;AAED,SAAS,aAAa,CAAC,KAAgB;IACrC,OAAO,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC;CACrC;AAED,SAAS,cAAc,CAAC,KAAgB;IACtC,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;CACtC;AAED,SAAS,UAAU,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G,IAAI,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,OAAO,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;CACF;;SCZe,YAAY,CAAI,IAAO;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;CACzC;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/bundle.umd.js b/node_modules/apollo-utilities/lib/bundle.umd.js new file mode 100644 index 000000000..c3aefc84f --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.umd.js @@ -0,0 +1,1131 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "graphql/language/visitor", "ts-invariant", "tslib", "fast-json-stable-stringify", "@wry/equality"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("graphql/language/visitor"), require("ts-invariant"), require("tslib"), require("fast-json-stable-stringify"), require("@wry/equality")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.visitor, global.tsInvariant, global.tslib, global.fastJsonStableStringify, global.equality); + global.unknown = mod.exports; + } +})(this, function (_exports, _visitor, _tsInvariant, _tslib, _fastJsonStableStringify, _equality) { + + _exports.__esModule = true; + _exports.addTypenameToDocument = addTypenameToDocument; + _exports.argumentsObjectFromField = argumentsObjectFromField; + _exports.assign = assign; + _exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; + _exports.checkDocument = checkDocument; + _exports.cloneDeep = cloneDeep; + _exports.createFragmentMap = createFragmentMap; + _exports.getDefaultValues = getDefaultValues; + _exports.getDirectiveInfoFromField = getDirectiveInfoFromField; + _exports.getDirectiveNames = getDirectiveNames; + _exports.getDirectivesFromDocument = getDirectivesFromDocument; + _exports.getEnv = getEnv; + _exports.getFragmentDefinition = getFragmentDefinition; + _exports.getFragmentDefinitions = getFragmentDefinitions; + _exports.getFragmentQueryDocument = getFragmentQueryDocument; + _exports.getInclusionDirectives = getInclusionDirectives; + _exports.getMainDefinition = getMainDefinition; + _exports.getMutationDefinition = getMutationDefinition; + _exports.getOperationDefinition = getOperationDefinition; + _exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; + _exports.getOperationName = getOperationName; + _exports.getQueryDefinition = getQueryDefinition; + _exports.getStoreKeyName = getStoreKeyName; + _exports.graphQLResultHasError = graphQLResultHasError; + _exports.hasClientExports = hasClientExports; + _exports.hasDirectives = hasDirectives; + _exports.isDevelopment = isDevelopment; + _exports.isEnv = isEnv; + _exports.isField = isField; + _exports.isIdValue = isIdValue; + _exports.isInlineFragment = isInlineFragment; + _exports.isJsonValue = isJsonValue; + _exports.isNumberValue = isNumberValue; + _exports.isProduction = isProduction; + _exports.isScalarValue = isScalarValue; + _exports.isTest = isTest; + _exports.maybeDeepFreeze = maybeDeepFreeze; + _exports.mergeDeep = mergeDeep; + _exports.mergeDeepArray = mergeDeepArray; + _exports.removeArgumentsFromDocument = removeArgumentsFromDocument; + _exports.removeClientSetsFromDocument = removeClientSetsFromDocument; + _exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; + _exports.removeDirectivesFromDocument = removeDirectivesFromDocument; + _exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; + _exports.resultKeyNameFromField = resultKeyNameFromField; + _exports.shouldInclude = shouldInclude; + _exports.storeKeyNameFromField = storeKeyNameFromField; + _exports.stripSymbols = stripSymbols; + _exports.toIdValue = toIdValue; + _exports.tryFunctionOrLogError = tryFunctionOrLogError; + _exports.valueFromNode = valueFromNode; + _exports.valueToObjectRepresentation = valueToObjectRepresentation; + _exports.variablesInOperation = variablesInOperation; + _exports.warnOnceInDevelopment = warnOnceInDevelopment; + _exports.canUseWeakMap = _exports.isEqual = void 0; + _fastJsonStableStringify = _interopRequireDefault(_fastJsonStableStringify); + _exports.isEqual = _equality.equal; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function isScalarValue(value) { + return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; + } + + function isNumberValue(value) { + return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; + } + + function isStringValue(value) { + return value.kind === 'StringValue'; + } + + function isBooleanValue(value) { + return value.kind === 'BooleanValue'; + } + + function isIntValue(value) { + return value.kind === 'IntValue'; + } + + function isFloatValue(value) { + return value.kind === 'FloatValue'; + } + + function isVariable(value) { + return value.kind === 'Variable'; + } + + function isObjectValue(value) { + return value.kind === 'ObjectValue'; + } + + function isListValue(value) { + return value.kind === 'ListValue'; + } + + function isEnumValue(value) { + return value.kind === 'EnumValue'; + } + + function isNullValue(value) { + return value.kind === 'NullValue'; + } + + function valueToObjectRepresentation(argObj, name, value, variables) { + if (isIntValue(value) || isFloatValue(value)) { + argObj[name.value] = Number(value.value); + } else if (isBooleanValue(value) || isStringValue(value)) { + argObj[name.value] = value.value; + } else if (isObjectValue(value)) { + var nestedArgObj_1 = {}; + value.fields.map(function (obj) { + return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); + }); + argObj[name.value] = nestedArgObj_1; + } else if (isVariable(value)) { + var variableValue = (variables || {})[value.name.value]; + argObj[name.value] = variableValue; + } else if (isListValue(value)) { + argObj[name.value] = value.values.map(function (listValue) { + var nestedArgArrayObj = {}; + valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); + return nestedArgArrayObj[name.value]; + }); + } else if (isEnumValue(value)) { + argObj[name.value] = value.value; + } else if (isNullValue(value)) { + argObj[name.value] = null; + } else { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(17) : new _tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); + } + } + + function storeKeyNameFromField(field, variables) { + var directivesObj = null; + + if (field.directives) { + directivesObj = {}; + field.directives.forEach(function (directive) { + directivesObj[directive.name.value] = {}; + + if (directive.arguments) { + directive.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); + }); + } + }); + } + + var argObj = null; + + if (field.arguments && field.arguments.length) { + argObj = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(argObj, name, value, variables); + }); + } + + return getStoreKeyName(field.name.value, argObj, directivesObj); + } + + var KNOWN_DIRECTIVES = ['connection', 'include', 'skip', 'client', 'rest', 'export']; + + function getStoreKeyName(fieldName, args, directives) { + if (directives && directives['connection'] && directives['connection']['key']) { + if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { + var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; + filterKeys.sort(); + var queryArgs_1 = args; + var filteredArgs_1 = {}; + filterKeys.forEach(function (key) { + filteredArgs_1[key] = queryArgs_1[key]; + }); + return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; + } else { + return directives['connection']['key']; + } + } + + var completeFieldName = fieldName; + + if (args) { + var stringifiedArgs = (0, _fastJsonStableStringify.default)(args); + completeFieldName += "(" + stringifiedArgs + ")"; + } + + if (directives) { + Object.keys(directives).forEach(function (key) { + if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; + + if (directives[key] && Object.keys(directives[key]).length) { + completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; + } else { + completeFieldName += "@" + key; + } + }); + } + + return completeFieldName; + } + + function argumentsObjectFromField(field, variables) { + if (field.arguments && field.arguments.length) { + var argObj_1 = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, + value = _a.value; + return valueToObjectRepresentation(argObj_1, name, value, variables); + }); + return argObj_1; + } + + return null; + } + + function resultKeyNameFromField(field) { + return field.alias ? field.alias.value : field.name.value; + } + + function isField(selection) { + return selection.kind === 'Field'; + } + + function isInlineFragment(selection) { + return selection.kind === 'InlineFragment'; + } + + function isIdValue(idObject) { + return idObject && idObject.type === 'id' && typeof idObject.generated === 'boolean'; + } + + function toIdValue(idConfig, generated) { + if (generated === void 0) { + generated = false; + } + + return (0, _tslib.__assign)({ + type: 'id', + generated: generated + }, typeof idConfig === 'string' ? { + id: idConfig, + typename: undefined + } : idConfig); + } + + function isJsonValue(jsonObject) { + return jsonObject != null && typeof jsonObject === 'object' && jsonObject.type === 'json'; + } + + function defaultValueFromVariable(node) { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(18) : new _tsInvariant.InvariantError("Variable nodes are not supported by valueFromNode"); + } + + function valueFromNode(node, onVariable) { + if (onVariable === void 0) { + onVariable = defaultValueFromVariable; + } + + switch (node.kind) { + case 'Variable': + return onVariable(node); + + case 'NullValue': + return null; + + case 'IntValue': + return parseInt(node.value, 10); + + case 'FloatValue': + return parseFloat(node.value); + + case 'ListValue': + return node.values.map(function (v) { + return valueFromNode(v, onVariable); + }); + + case 'ObjectValue': + { + var value = {}; + + for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { + var field = _a[_i]; + value[field.name.value] = valueFromNode(field.value, onVariable); + } + + return value; + } + + default: + return node.value; + } + } + + function getDirectiveInfoFromField(field, variables) { + if (field.directives && field.directives.length) { + var directiveObj_1 = {}; + field.directives.forEach(function (directive) { + directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); + }); + return directiveObj_1; + } + + return null; + } + + function shouldInclude(selection, variables) { + if (variables === void 0) { + variables = {}; + } + + return getInclusionDirectives(selection.directives).every(function (_a) { + var directive = _a.directive, + ifArgument = _a.ifArgument; + var evaledValue = false; + + if (ifArgument.value.kind === 'Variable') { + evaledValue = variables[ifArgument.value.name.value]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(evaledValue !== void 0, 3) : (0, _tsInvariant.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); + } else { + evaledValue = ifArgument.value.value; + } + + return directive.name.value === 'skip' ? !evaledValue : evaledValue; + }); + } + + function getDirectiveNames(doc) { + var names = []; + (0, _visitor.visit)(doc, { + Directive: function (node) { + names.push(node.name.value); + } + }); + return names; + } + + function hasDirectives(names, doc) { + return getDirectiveNames(doc).some(function (name) { + return names.indexOf(name) > -1; + }); + } + + function hasClientExports(document) { + return document && hasDirectives(['client'], document) && hasDirectives(['export'], document); + } + + function isInclusionDirective(_a) { + var value = _a.name.value; + return value === 'skip' || value === 'include'; + } + + function getInclusionDirectives(directives) { + return directives ? directives.filter(isInclusionDirective).map(function (directive) { + var directiveArguments = directive.arguments; + var directiveName = directive.name.value; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, 4) : (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); + var ifArgument = directiveArguments[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', 5) : (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); + var ifValue = ifArgument.value; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 6) : (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); + return { + directive: directive, + ifArgument: ifArgument + }; + }) : []; + } + + function getFragmentQueryDocument(document, fragmentName) { + var actualFragmentName = fragmentName; + var fragments = []; + document.definitions.forEach(function (definition) { + if (definition.kind === 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + } + + if (definition.kind === 'FragmentDefinition') { + fragments.push(definition); + } + }); + + if (typeof actualFragmentName === 'undefined') { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragments.length === 1, 2) : (0, _tsInvariant.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); + actualFragmentName = fragments[0].name.value; + } + + var query = (0, _tslib.__assign)({}, document, { + definitions: [{ + kind: 'OperationDefinition', + operation: 'query', + selectionSet: { + kind: 'SelectionSet', + selections: [{ + kind: 'FragmentSpread', + name: { + kind: 'Name', + value: actualFragmentName + } + }] + } + }].concat(document.definitions) + }); + return query; + } + + function assign(target) { + var sources = []; + + for (var _i = 1; _i < arguments.length; _i++) { + sources[_i - 1] = arguments[_i]; + } + + sources.forEach(function (source) { + if (typeof source === 'undefined' || source === null) { + return; + } + + Object.keys(source).forEach(function (key) { + target[key] = source[key]; + }); + }); + return target; + } + + function getMutationDefinition(doc) { + checkDocument(doc); + var mutationDef = doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.operation === 'mutation'; + })[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutationDef, 7) : (0, _tsInvariant.invariant)(mutationDef, 'Must contain a mutation definition.'); + return mutationDef; + } + + function checkDocument(doc) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', 8) : (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + var operations = doc.definitions.filter(function (d) { + return d.kind !== 'FragmentDefinition'; + }).map(function (definition) { + if (definition.kind !== 'OperationDefinition') { + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(9) : new _tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); + } + + return definition; + }); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(operations.length <= 1, 10) : (0, _tsInvariant.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); + return doc; + } + + function getOperationDefinition(doc) { + checkDocument(doc); + return doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition'; + })[0]; + } + + function getOperationDefinitionOrDie(document) { + var def = getOperationDefinition(document); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(def, 11) : (0, _tsInvariant.invariant)(def, "GraphQL document is missing an operation"); + return def; + } + + function getOperationName(doc) { + return doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.name; + }).map(function (x) { + return x.name.value; + })[0] || null; + } + + function getFragmentDefinitions(doc) { + return doc.definitions.filter(function (definition) { + return definition.kind === 'FragmentDefinition'; + }); + } + + function getQueryDefinition(doc) { + var queryDef = getOperationDefinition(doc); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 12) : (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); + return queryDef; + } + + function getFragmentDefinition(doc) { + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.kind === 'Document', 13) : (0, _tsInvariant.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 14) : (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); + var fragmentDef = doc.definitions[0]; + process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 15) : (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); + return fragmentDef; + } + + function getMainDefinition(queryDoc) { + checkDocument(queryDoc); + var fragmentDefinition; + + for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { + var definition = _a[_i]; + + if (definition.kind === 'OperationDefinition') { + var operation = definition.operation; + + if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { + return definition; + } + } + + if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { + fragmentDefinition = definition; + } + } + + if (fragmentDefinition) { + return fragmentDefinition; + } + + throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(16) : new _tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); + } + + function createFragmentMap(fragments) { + if (fragments === void 0) { + fragments = []; + } + + var symTable = {}; + fragments.forEach(function (fragment) { + symTable[fragment.name.value] = fragment; + }); + return symTable; + } + + function getDefaultValues(definition) { + if (definition && definition.variableDefinitions && definition.variableDefinitions.length) { + var defaultValues = definition.variableDefinitions.filter(function (_a) { + var defaultValue = _a.defaultValue; + return defaultValue; + }).map(function (_a) { + var variable = _a.variable, + defaultValue = _a.defaultValue; + var defaultValueObj = {}; + valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); + return defaultValueObj; + }); + return assign.apply(void 0, [{}].concat(defaultValues)); + } + + return {}; + } + + function variablesInOperation(operation) { + var names = new Set(); + + if (operation.variableDefinitions) { + for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { + var definition = _a[_i]; + names.add(definition.variable.name.value); + } + } + + return names; + } + + function filterInPlace(array, test, context) { + var target = 0; + array.forEach(function (elem, i) { + if (test.call(this, elem, i, array)) { + array[target++] = elem; + } + }, context); + array.length = target; + return array; + } + + var TYPENAME_FIELD = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename' + } + }; + + function isEmpty(op, fragments) { + return op.selectionSet.selections.every(function (selection) { + return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); + }); + } + + function nullIfDocIsEmpty(doc) { + return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) ? null : doc; + } + + function getDirectiveMatcher(directives) { + return function directiveMatcher(directive) { + return directives.some(function (dir) { + return dir.name && dir.name === directive.name.value || dir.test && dir.test(directive); + }); + }; + } + + function removeDirectivesFromDocument(directives, doc) { + var variablesInUse = Object.create(null); + var variablesToRemove = []; + var fragmentSpreadsInUse = Object.create(null); + var fragmentSpreadsToRemove = []; + var modifiedDoc = nullIfDocIsEmpty((0, _visitor.visit)(doc, { + Variable: { + enter: function (node, _key, parent) { + if (parent.kind !== 'VariableDefinition') { + variablesInUse[node.name.value] = true; + } + } + }, + Field: { + enter: function (node) { + if (directives && node.directives) { + var shouldRemoveField = directives.some(function (directive) { + return directive.remove; + }); + + if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { + if (node.arguments) { + node.arguments.forEach(function (arg) { + if (arg.value.kind === 'Variable') { + variablesToRemove.push({ + name: arg.value.name.value + }); + } + }); + } + + if (node.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { + fragmentSpreadsToRemove.push({ + name: frag.name.value + }); + }); + } + + return null; + } + } + } + }, + FragmentSpread: { + enter: function (node) { + fragmentSpreadsInUse[node.name.value] = true; + } + }, + Directive: { + enter: function (node) { + if (getDirectiveMatcher(directives)(node)) { + return null; + } + } + } + })); + + if (modifiedDoc && filterInPlace(variablesToRemove, function (v) { + return !variablesInUse[v.name]; + }).length) { + modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); + } + + if (modifiedDoc && filterInPlace(fragmentSpreadsToRemove, function (fs) { + return !fragmentSpreadsInUse[fs.name]; + }).length) { + modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); + } + + return modifiedDoc; + } + + function addTypenameToDocument(doc) { + return (0, _visitor.visit)(checkDocument(doc), { + SelectionSet: { + enter: function (node, _key, parent) { + if (parent && parent.kind === 'OperationDefinition') { + return; + } + + var selections = node.selections; + + if (!selections) { + return; + } + + var skip = selections.some(function (selection) { + return isField(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0); + }); + + if (skip) { + return; + } + + var field = parent; + + if (isField(field) && field.directives && field.directives.some(function (d) { + return d.name.value === 'export'; + })) { + return; + } + + return (0, _tslib.__assign)({}, node, { + selections: selections.concat([TYPENAME_FIELD]) + }); + } + } + }); + } + + var connectionRemoveConfig = { + test: function (directive) { + var willRemove = directive.name.value === 'connection'; + + if (willRemove) { + if (!directive.arguments || !directive.arguments.some(function (arg) { + return arg.name.value === 'key'; + })) { + process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); + } + } + + return willRemove; + } + }; + + function removeConnectionDirectiveFromDocument(doc) { + return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); + } + + function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { + if (nestedCheck === void 0) { + nestedCheck = true; + } + + return selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { + return hasDirectivesInSelection(directives, selection, nestedCheck); + }); + } + + function hasDirectivesInSelection(directives, selection, nestedCheck) { + if (nestedCheck === void 0) { + nestedCheck = true; + } + + if (!isField(selection)) { + return true; + } + + if (!selection.directives) { + return false; + } + + return selection.directives.some(getDirectiveMatcher(directives)) || nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck); + } + + function getDirectivesFromDocument(directives, doc) { + checkDocument(doc); + var parentPath; + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + SelectionSet: { + enter: function (node, _key, _parent, path) { + var currentPath = path.join('-'); + + if (!parentPath || currentPath === parentPath || !currentPath.startsWith(parentPath)) { + if (node.selections) { + var selectionsWithDirectives = node.selections.filter(function (selection) { + return hasDirectivesInSelection(directives, selection); + }); + + if (hasDirectivesInSelectionSet(directives, node, false)) { + parentPath = currentPath; + } + + return (0, _tslib.__assign)({}, node, { + selections: selectionsWithDirectives + }); + } else { + return null; + } + } + } + } + })); + } + + function getArgumentMatcher(config) { + return function argumentMatcher(argument) { + return config.some(function (aConfig) { + return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || aConfig.test && aConfig.test(argument)); + }); + }; + } + + function removeArgumentsFromDocument(config, doc) { + var argMatcher = getArgumentMatcher(config); + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + OperationDefinition: { + enter: function (node) { + return (0, _tslib.__assign)({}, node, { + variableDefinitions: node.variableDefinitions.filter(function (varDef) { + return !config.some(function (arg) { + return arg.name === varDef.variable.name.value; + }); + }) + }); + } + }, + Field: { + enter: function (node) { + var shouldRemoveField = config.some(function (argConfig) { + return argConfig.remove; + }); + + if (shouldRemoveField) { + var argMatchCount_1 = 0; + node.arguments.forEach(function (arg) { + if (argMatcher(arg)) { + argMatchCount_1 += 1; + } + }); + + if (argMatchCount_1 === 1) { + return null; + } + } + } + }, + Argument: { + enter: function (node) { + if (argMatcher(node)) { + return null; + } + } + } + })); + } + + function removeFragmentSpreadFromDocument(config, doc) { + function enter(node) { + if (config.some(function (def) { + return def.name === node.name.value; + })) { + return null; + } + } + + return nullIfDocIsEmpty((0, _visitor.visit)(doc, { + FragmentSpread: { + enter: enter + }, + FragmentDefinition: { + enter: enter + } + })); + } + + function getAllFragmentSpreadsFromSelectionSet(selectionSet) { + var allFragments = []; + selectionSet.selections.forEach(function (selection) { + if ((isField(selection) || isInlineFragment(selection)) && selection.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { + return allFragments.push(frag); + }); + } else if (selection.kind === 'FragmentSpread') { + allFragments.push(selection); + } + }); + return allFragments; + } + + function buildQueryFromSelectionSet(document) { + var definition = getMainDefinition(document); + var definitionOperation = definition.operation; + + if (definitionOperation === 'query') { + return document; + } + + var modifiedDoc = (0, _visitor.visit)(document, { + OperationDefinition: { + enter: function (node) { + return (0, _tslib.__assign)({}, node, { + operation: 'query' + }); + } + } + }); + return modifiedDoc; + } + + function removeClientSetsFromDocument(document) { + checkDocument(document); + var modifiedDoc = removeDirectivesFromDocument([{ + test: function (directive) { + return directive.name.value === 'client'; + }, + remove: true + }], document); + + if (modifiedDoc) { + modifiedDoc = (0, _visitor.visit)(modifiedDoc, { + FragmentDefinition: { + enter: function (node) { + if (node.selectionSet) { + var isTypenameOnly = node.selectionSet.selections.every(function (selection) { + return isField(selection) && selection.name.value === '__typename'; + }); + + if (isTypenameOnly) { + return null; + } + } + } + } + }); + } + + return modifiedDoc; + } + + var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); + _exports.canUseWeakMap = canUseWeakMap; + var toString = Object.prototype.toString; + + function cloneDeep(value) { + return cloneDeepHelper(value, new Map()); + } + + function cloneDeepHelper(val, seen) { + switch (toString.call(val)) { + case "[object Array]": + { + if (seen.has(val)) return seen.get(val); + var copy_1 = val.slice(0); + seen.set(val, copy_1); + copy_1.forEach(function (child, i) { + copy_1[i] = cloneDeepHelper(child, seen); + }); + return copy_1; + } + + case "[object Object]": + { + if (seen.has(val)) return seen.get(val); + var copy_2 = Object.create(Object.getPrototypeOf(val)); + seen.set(val, copy_2); + Object.keys(val).forEach(function (key) { + copy_2[key] = cloneDeepHelper(val[key], seen); + }); + return copy_2; + } + + default: + return val; + } + } + + function getEnv() { + if (typeof process !== 'undefined' && process.env.NODE_ENV) { + return process.env.NODE_ENV; + } + + return 'development'; + } + + function isEnv(env) { + return getEnv() === env; + } + + function isProduction() { + return isEnv('production') === true; + } + + function isDevelopment() { + return isEnv('development') === true; + } + + function isTest() { + return isEnv('test') === true; + } + + function tryFunctionOrLogError(f) { + try { + return f(); + } catch (e) { + if (console.error) { + console.error(e); + } + } + } + + function graphQLResultHasError(result) { + return result.errors && result.errors.length; + } + + function deepFreeze(o) { + Object.freeze(o); + Object.getOwnPropertyNames(o).forEach(function (prop) { + if (o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { + deepFreeze(o[prop]); + } + }); + return o; + } + + function maybeDeepFreeze(obj) { + if (isDevelopment() || isTest()) { + var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; + + if (!symbolIsPolyfilled) { + return deepFreeze(obj); + } + } + + return obj; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function mergeDeep() { + var sources = []; + + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i] = arguments[_i]; + } + + return mergeDeepArray(sources); + } + + function mergeDeepArray(sources) { + var target = sources[0] || {}; + var count = sources.length; + + if (count > 1) { + var pastCopies = []; + target = shallowCopyForMerge(target, pastCopies); + + for (var i = 1; i < count; ++i) { + target = mergeHelper(target, sources[i], pastCopies); + } + } + + return target; + } + + function isObject(obj) { + return obj !== null && typeof obj === 'object'; + } + + function mergeHelper(target, source, pastCopies) { + if (isObject(source) && isObject(target)) { + if (Object.isExtensible && !Object.isExtensible(target)) { + target = shallowCopyForMerge(target, pastCopies); + } + + Object.keys(source).forEach(function (sourceKey) { + var sourceValue = source[sourceKey]; + + if (hasOwnProperty.call(target, sourceKey)) { + var targetValue = target[sourceKey]; + + if (sourceValue !== targetValue) { + target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); + } + } else { + target[sourceKey] = sourceValue; + } + }); + return target; + } + + return source; + } + + function shallowCopyForMerge(value, pastCopies) { + if (value !== null && typeof value === 'object' && pastCopies.indexOf(value) < 0) { + if (Array.isArray(value)) { + value = value.slice(0); + } else { + value = (0, _tslib.__assign)({ + __proto__: Object.getPrototypeOf(value) + }, value); + } + + pastCopies.push(value); + } + + return value; + } + + var haveWarned = Object.create({}); + + function warnOnceInDevelopment(msg, type) { + if (type === void 0) { + type = 'warn'; + } + + if (!isProduction() && !haveWarned[msg]) { + if (!isTest()) { + haveWarned[msg] = true; + } + + if (type === 'error') { + console.error(msg); + } else { + console.warn(msg); + } + } + } + + function stripSymbols(data) { + return JSON.parse(JSON.stringify(data)); + } + +}); diff --git a/node_modules/apollo-utilities/lib/bundle.umd.js.map b/node_modules/apollo-utilities/lib/bundle.umd.js.map new file mode 100644 index 000000000..ebf68896a --- /dev/null +++ b/node_modules/apollo-utilities/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAiDgB,a,CAAc,K,EAAgB;AAC5C,WAAO,CAAC,aAAD,EAAgB,cAAhB,EAAgC,WAAhC,EAA6C,OAA7C,CAAqD,KAAK,CAAC,IAA3D,IAAmE,CAAC,CAA3E;AACD;;AAID,WAAgB,aAAhB,CAA8B,KAA9B,EAA8C;AAC5C,WAAO,CAAC,UAAD,EAAa,YAAb,EAA2B,OAA3B,CAAmC,KAAK,CAAC,IAAzC,IAAiD,CAAC,CAAzD;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,WAAS,cAAT,CAAwB,KAAxB,EAAwC;AACtC,WAAO,KAAK,CAAC,IAAN,KAAe,cAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,YAAT,CAAsB,KAAtB,EAAsC;AACpC,WAAO,KAAK,CAAC,IAAN,KAAe,YAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,WAAS,WAAT,CAAqB,KAArB,EAAqC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AAA,CAAA,EAAA;AAAA,MAAA,IAAA,GAAA,MAAA;AAAa;;AAC9D,QAAI,CAAC,YAAY,EAAb,IAAmB,CAAC,UAAU,CAAC,GAAD,CAAlC,EAAyC;AACvC,UAAI,CAAC,MAAM,EAAX,EAAe;AACb,QAAA,UAAU,CAAC,GAAD,CAAV,GAAkB,IAAlB;AACD;;AACD,UAAI,IAAI,KAAK,OAAb,EAAsB;AACpB,QAAA,OAAO,CAAC,KAAR,CAAc,GAAd;AACD,OAFD,MAEO;AACL,QAAA,OAAO,CAAC,IAAR,CAAa,GAAb;AACD;AACF;AACF;;WCZe,Y,CAAgB,I,EAAO;AACrC,WAAO,IAAI,CAAC,KAAL,CAAW,IAAI,CAAC,SAAL,CAAe,IAAf,CAAX,CAAP;AACD,G","sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.d.ts b/node_modules/apollo-utilities/lib/directives.d.ts new file mode 100644 index 000000000..ea10f218a --- /dev/null +++ b/node_modules/apollo-utilities/lib/directives.d.ts @@ -0,0 +1,19 @@ +import { FieldNode, SelectionNode, DirectiveNode, DocumentNode, ArgumentNode } from 'graphql'; +export declare type DirectiveInfo = { + [fieldName: string]: { + [argName: string]: any; + }; +}; +export declare function getDirectiveInfoFromField(field: FieldNode, variables: Object): DirectiveInfo; +export declare function shouldInclude(selection: SelectionNode, variables?: { + [name: string]: any; +}): boolean; +export declare function getDirectiveNames(doc: DocumentNode): string[]; +export declare function hasDirectives(names: string[], doc: DocumentNode): boolean; +export declare function hasClientExports(document: DocumentNode): boolean; +export declare type InclusionDirectives = Array<{ + directive: DirectiveNode; + ifArgument: ArgumentNode; +}>; +export declare function getInclusionDirectives(directives: ReadonlyArray): InclusionDirectives; +//# sourceMappingURL=directives.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.d.ts.map b/node_modules/apollo-utilities/lib/directives.d.ts.map new file mode 100644 index 000000000..4da04b618 --- /dev/null +++ b/node_modules/apollo-utilities/lib/directives.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["src/directives.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,aAAa,EAGb,aAAa,EACb,YAAY,EACZ,YAAY,EAEb,MAAM,SAAS,CAAC;AAQjB,oBAAY,aAAa,GAAG;IAC1B,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACjD,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,GAChB,aAAa,CAYf;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,EACxB,SAAS,GAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAO,GACtC,OAAO,CAgBT;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,YAUlD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,YAAY,WAI/D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,WAMtD;AAED,oBAAY,mBAAmB,GAAG,KAAK,CAAC;IACtC,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC,CAAC;AAMH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,aAAa,CAAC,aAAa,CAAC,GACvC,mBAAmB,CA2BrB"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.js b/node_modules/apollo-utilities/lib/directives.js new file mode 100644 index 000000000..41a8a9d48 --- /dev/null +++ b/node_modules/apollo-utilities/lib/directives.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var visitor_1 = require("graphql/language/visitor"); +var ts_invariant_1 = require("ts-invariant"); +var storeUtils_1 = require("./storeUtils"); +function getDirectiveInfoFromField(field, variables) { + if (field.directives && field.directives.length) { + var directiveObj_1 = {}; + field.directives.forEach(function (directive) { + directiveObj_1[directive.name.value] = storeUtils_1.argumentsObjectFromField(directive, variables); + }); + return directiveObj_1; + } + return null; +} +exports.getDirectiveInfoFromField = getDirectiveInfoFromField; +function shouldInclude(selection, variables) { + if (variables === void 0) { variables = {}; } + return getInclusionDirectives(selection.directives).every(function (_a) { + var directive = _a.directive, ifArgument = _a.ifArgument; + var evaledValue = false; + if (ifArgument.value.kind === 'Variable') { + evaledValue = variables[ifArgument.value.name.value]; + ts_invariant_1.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); + } + else { + evaledValue = ifArgument.value.value; + } + return directive.name.value === 'skip' ? !evaledValue : evaledValue; + }); +} +exports.shouldInclude = shouldInclude; +function getDirectiveNames(doc) { + var names = []; + visitor_1.visit(doc, { + Directive: function (node) { + names.push(node.name.value); + }, + }); + return names; +} +exports.getDirectiveNames = getDirectiveNames; +function hasDirectives(names, doc) { + return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; }); +} +exports.hasDirectives = hasDirectives; +function hasClientExports(document) { + return (document && + hasDirectives(['client'], document) && + hasDirectives(['export'], document)); +} +exports.hasClientExports = hasClientExports; +function isInclusionDirective(_a) { + var value = _a.name.value; + return value === 'skip' || value === 'include'; +} +function getInclusionDirectives(directives) { + return directives ? directives.filter(isInclusionDirective).map(function (directive) { + var directiveArguments = directive.arguments; + var directiveName = directive.name.value; + ts_invariant_1.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); + var ifArgument = directiveArguments[0]; + ts_invariant_1.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); + var ifValue = ifArgument.value; + ts_invariant_1.invariant(ifValue && + (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); + return { directive: directive, ifArgument: ifArgument }; + }) : []; +} +exports.getInclusionDirectives = getInclusionDirectives; +//# sourceMappingURL=directives.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.js.map b/node_modules/apollo-utilities/lib/directives.js.map new file mode 100644 index 000000000..915e07f2e --- /dev/null +++ b/node_modules/apollo-utilities/lib/directives.js.map @@ -0,0 +1 @@ +{"version":3,"file":"directives.js","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":";;AAaA,oDAAiD;AAEjD,6CAAyC;AAEzC,2CAAwD;AAMxD,SAAgB,yBAAyB,CACvC,KAAgB,EAChB,SAAiB;IAEjB,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE;QAC/C,IAAM,cAAY,GAAkB,EAAE,CAAC;QACvC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAwB;YAChD,cAAY,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,qCAAwB,CAC3D,SAAS,EACT,SAAS,CACV,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,cAAY,CAAC;KACrB;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,8DAeC;AAED,SAAgB,aAAa,CAC3B,SAAwB,EACxB,SAAuC;IAAvC,0BAAA,EAAA,cAAuC;IAEvC,OAAO,sBAAsB,CAC3B,SAAS,CAAC,UAAU,CACrB,CAAC,KAAK,CAAC,UAAC,EAAyB;YAAvB,wBAAS,EAAE,0BAAU;QAC9B,IAAI,WAAW,GAAY,KAAK,CAAC;QACjC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;YACxC,WAAW,GAAG,SAAS,CAAE,UAAU,CAAC,KAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvE,wBAAS,CACP,WAAW,KAAK,KAAK,CAAC,EACtB,qCAAmC,SAAS,CAAC,IAAI,CAAC,KAAK,gBAAa,CACrE,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B,GAAG,SAAS,CAAC,SAAS,CAAC;QAC/C,IAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAE3C,wBAAS,CACP,kBAAkB,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,EACrD,4CAA0C,aAAa,gBAAa,CACrE,CAAC;QAEF,IAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACzC,wBAAS,CACP,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,EACjD,+BAA6B,aAAa,gBAAa,CACxD,CAAC;QAEF,IAAM,OAAO,GAAc,UAAU,CAAC,KAAK,CAAC;QAG5C,wBAAS,CACP,OAAO;YACL,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,EAClE,uBAAqB,aAAa,sDAAmD,CACtF,CAAC;QAEF,OAAO,EAAE,SAAS,WAAA,EAAE,UAAU,YAAA,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACV,CAAC;AA7BD,wDA6BC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.d.ts b/node_modules/apollo-utilities/lib/fragments.d.ts new file mode 100644 index 000000000..8b1f23124 --- /dev/null +++ b/node_modules/apollo-utilities/lib/fragments.d.ts @@ -0,0 +1,3 @@ +import { DocumentNode } from 'graphql'; +export declare function getFragmentQueryDocument(document: DocumentNode, fragmentName?: string): DocumentNode; +//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.d.ts.map b/node_modules/apollo-utilities/lib/fragments.d.ts.map new file mode 100644 index 000000000..cbff38a81 --- /dev/null +++ b/node_modules/apollo-utilities/lib/fragments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["src/fragments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,SAAS,CAAC;AAyB/D,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,YAAY,EACtB,YAAY,CAAC,EAAE,MAAM,GACpB,YAAY,CA+Dd"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.js b/node_modules/apollo-utilities/lib/fragments.js new file mode 100644 index 000000000..5dea28002 --- /dev/null +++ b/node_modules/apollo-utilities/lib/fragments.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var ts_invariant_1 = require("ts-invariant"); +function getFragmentQueryDocument(document, fragmentName) { + var actualFragmentName = fragmentName; + var fragments = []; + document.definitions.forEach(function (definition) { + if (definition.kind === 'OperationDefinition') { + throw new ts_invariant_1.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); + } + if (definition.kind === 'FragmentDefinition') { + fragments.push(definition); + } + }); + if (typeof actualFragmentName === 'undefined') { + ts_invariant_1.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); + actualFragmentName = fragments[0].name.value; + } + var query = tslib_1.__assign({}, document, { definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { + kind: 'Name', + value: actualFragmentName, + }, + }, + ], + }, + } + ].concat(document.definitions) }); + return query; +} +exports.getFragmentQueryDocument = getFragmentQueryDocument; +//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.js.map b/node_modules/apollo-utilities/lib/fragments.js.map new file mode 100644 index 000000000..35fe15d2f --- /dev/null +++ b/node_modules/apollo-utilities/lib/fragments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../src/fragments.ts"],"names":[],"mappings":";;;AACA,6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d.ts b/node_modules/apollo-utilities/lib/getFromAST.d.ts new file mode 100644 index 000000000..570503190 --- /dev/null +++ b/node_modules/apollo-utilities/lib/getFromAST.d.ts @@ -0,0 +1,20 @@ +import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode } from 'graphql'; +import { JsonValue } from './storeUtils'; +export declare function getMutationDefinition(doc: DocumentNode): OperationDefinitionNode; +export declare function checkDocument(doc: DocumentNode): DocumentNode; +export declare function getOperationDefinition(doc: DocumentNode): OperationDefinitionNode | undefined; +export declare function getOperationDefinitionOrDie(document: DocumentNode): OperationDefinitionNode; +export declare function getOperationName(doc: DocumentNode): string | null; +export declare function getFragmentDefinitions(doc: DocumentNode): FragmentDefinitionNode[]; +export declare function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode; +export declare function getFragmentDefinition(doc: DocumentNode): FragmentDefinitionNode; +export declare function getMainDefinition(queryDoc: DocumentNode): OperationDefinitionNode | FragmentDefinitionNode; +export interface FragmentMap { + [fragmentName: string]: FragmentDefinitionNode; +} +export declare function createFragmentMap(fragments?: FragmentDefinitionNode[]): FragmentMap; +export declare function getDefaultValues(definition: OperationDefinitionNode | undefined): { + [key: string]: JsonValue; +}; +export declare function variablesInOperation(operation: OperationDefinitionNode): Set; +//# sourceMappingURL=getFromAST.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.d.ts.map b/node_modules/apollo-utilities/lib/getFromAST.d.ts.map new file mode 100644 index 000000000..ef2f9946f --- /dev/null +++ b/node_modules/apollo-utilities/lib/getFromAST.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getFromAST.d.ts","sourceRoot":"","sources":["src/getFromAST.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAMjB,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,GAChB,uBAAuB,CAYzB;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,gBA0B9C;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,GAChB,uBAAuB,GAAG,SAAS,CAKrC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,YAAY,GACrB,uBAAuB,CAIzB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CASjE;AAGD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,GAChB,sBAAsB,EAAE,CAI1B;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,uBAAuB,CAS7E;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,GAChB,sBAAsB,CAoBxB;AAOD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,YAAY,GACrB,uBAAuB,GAAG,sBAAsB,CA8BlD;AAKD,MAAM,WAAW,WAAW;IAC1B,CAAC,YAAY,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAChD;AAID,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,sBAAsB,EAAO,GACvC,WAAW,CAOb;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,uBAAuB,GAAG,SAAS,GAC9C;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAyB9B;AAKD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,uBAAuB,GACjC,GAAG,CAAC,MAAM,CAAC,CASb"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.js b/node_modules/apollo-utilities/lib/getFromAST.js new file mode 100644 index 000000000..7f7a4af74 --- /dev/null +++ b/node_modules/apollo-utilities/lib/getFromAST.js @@ -0,0 +1,130 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ts_invariant_1 = require("ts-invariant"); +var assign_1 = require("./util/assign"); +var storeUtils_1 = require("./storeUtils"); +function getMutationDefinition(doc) { + checkDocument(doc); + var mutationDef = doc.definitions.filter(function (definition) { + return definition.kind === 'OperationDefinition' && + definition.operation === 'mutation'; + })[0]; + ts_invariant_1.invariant(mutationDef, 'Must contain a mutation definition.'); + return mutationDef; +} +exports.getMutationDefinition = getMutationDefinition; +function checkDocument(doc) { + ts_invariant_1.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + var operations = doc.definitions + .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) + .map(function (definition) { + if (definition.kind !== 'OperationDefinition') { + throw new ts_invariant_1.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); + } + return definition; + }); + ts_invariant_1.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); + return doc; +} +exports.checkDocument = checkDocument; +function getOperationDefinition(doc) { + checkDocument(doc); + return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; +} +exports.getOperationDefinition = getOperationDefinition; +function getOperationDefinitionOrDie(document) { + var def = getOperationDefinition(document); + ts_invariant_1.invariant(def, "GraphQL document is missing an operation"); + return def; +} +exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; +function getOperationName(doc) { + return (doc.definitions + .filter(function (definition) { + return definition.kind === 'OperationDefinition' && definition.name; + }) + .map(function (x) { return x.name.value; })[0] || null); +} +exports.getOperationName = getOperationName; +function getFragmentDefinitions(doc) { + return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); +} +exports.getFragmentDefinitions = getFragmentDefinitions; +function getQueryDefinition(doc) { + var queryDef = getOperationDefinition(doc); + ts_invariant_1.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); + return queryDef; +} +exports.getQueryDefinition = getQueryDefinition; +function getFragmentDefinition(doc) { + ts_invariant_1.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); + ts_invariant_1.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); + var fragmentDef = doc.definitions[0]; + ts_invariant_1.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); + return fragmentDef; +} +exports.getFragmentDefinition = getFragmentDefinition; +function getMainDefinition(queryDoc) { + checkDocument(queryDoc); + var fragmentDefinition; + for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { + var definition = _a[_i]; + if (definition.kind === 'OperationDefinition') { + var operation = definition.operation; + if (operation === 'query' || + operation === 'mutation' || + operation === 'subscription') { + return definition; + } + } + if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { + fragmentDefinition = definition; + } + } + if (fragmentDefinition) { + return fragmentDefinition; + } + throw new ts_invariant_1.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); +} +exports.getMainDefinition = getMainDefinition; +function createFragmentMap(fragments) { + if (fragments === void 0) { fragments = []; } + var symTable = {}; + fragments.forEach(function (fragment) { + symTable[fragment.name.value] = fragment; + }); + return symTable; +} +exports.createFragmentMap = createFragmentMap; +function getDefaultValues(definition) { + if (definition && + definition.variableDefinitions && + definition.variableDefinitions.length) { + var defaultValues = definition.variableDefinitions + .filter(function (_a) { + var defaultValue = _a.defaultValue; + return defaultValue; + }) + .map(function (_a) { + var variable = _a.variable, defaultValue = _a.defaultValue; + var defaultValueObj = {}; + storeUtils_1.valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); + return defaultValueObj; + }); + return assign_1.assign.apply(void 0, [{}].concat(defaultValues)); + } + return {}; +} +exports.getDefaultValues = getDefaultValues; +function variablesInOperation(operation) { + var names = new Set(); + if (operation.variableDefinitions) { + for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { + var definition = _a[_i]; + names.add(definition.variable.name.value); + } + } + return names; +} +exports.variablesInOperation = variablesInOperation; +//# sourceMappingURL=getFromAST.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.js.map b/node_modules/apollo-utilities/lib/getFromAST.js.map new file mode 100644 index 000000000..e15f38e29 --- /dev/null +++ b/node_modules/apollo-utilities/lib/getFromAST.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getFromAST.js","sourceRoot":"","sources":["../src/getFromAST.ts"],"names":[],"mappings":";;AAOA,6CAAyD;AAEzD,wCAAuC;AAEvC,2CAAsE;AAEtE,SAAgB,qBAAqB,CACnC,GAAiB;IAEjB,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnB,IAAI,WAAW,GAAmC,GAAG,CAAC,WAAW,CAAC,MAAM,CACtE,UAAA,UAAU;QACR,OAAA,UAAU,CAAC,IAAI,KAAK,qBAAqB;YACzC,UAAU,CAAC,SAAS,KAAK,UAAU;IADnC,CACmC,CACtC,CAAC,CAAC,CAA4B,CAAC;IAEhC,wBAAS,CAAC,WAAW,EAAE,qCAAqC,CAAC,CAAC;IAE9D,OAAO,WAAW,CAAC;AACrB,CAAC;AAdD,sDAcC;AAGD,SAAgB,aAAa,CAAC,GAAiB;IAC7C,wBAAS,CACP,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAC9B,0JAC2E,CAC5E,CAAC;IAEF,IAAM,UAAU,GAAG,GAAG,CAAC,WAAW;SAC/B,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,oBAAoB,EAA/B,CAA+B,CAAC;SAC5C,GAAG,CAAC,UAAA,UAAU;QACb,IAAI,UAAU,CAAC,IAAI,KAAK,qBAAqB,EAAE;YAC7C,MAAM,IAAI,6BAAc,CACtB,8DACE,UAAU,CAAC,IAAI,OACd,CACJ,CAAC;SACH;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;IAEL,wBAAS,CACP,UAAU,CAAC,MAAM,IAAI,CAAC,EACtB,0CAAwC,UAAU,CAAC,MAAM,gBAAa,CACvE,CAAC;IAE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C,OAAO,CAAC,UAAA,QAAQ;QACxB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,8CASC;AAED,SAAgB,gBAAgB,CAC9B,UAA+C;IAE/C,IACE,UAAU;QACV,UAAU,CAAC,mBAAmB;QAC9B,UAAU,CAAC,mBAAmB,CAAC,MAAM,EACrC;QACA,IAAM,aAAa,GAAG,UAAU,CAAC,mBAAmB;aACjD,MAAM,CAAC,UAAC,EAAgB;gBAAd,8BAAY;YAAO,OAAA,YAAY;QAAZ,CAAY,CAAC;aAC1C,GAAG,CACF,UAAC,EAA0B;gBAAxB,sBAAQ,EAAE,8BAAY;YACvB,IAAM,eAAe,GAAiC,EAAE,CAAC;YACzD,wCAA2B,CACzB,eAAe,EACf,QAAQ,CAAC,IAAI,EACb,YAAyB,CAC1B,CAAC;YAEF,OAAO,eAAe,CAAC;QACzB,CAAC,CACF,CAAC;QAEJ,OAAO,eAAM,gBAAC,EAAE,SAAK,aAAa,GAAE;KACrC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AA3BD,4CA2BC;AAKD,SAAgB,oBAAoB,CAClC,SAAkC;IAElC,IAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,IAAI,SAAS,CAAC,mBAAmB,EAAE;QACjC,KAAyB,UAA6B,EAA7B,KAAA,SAAS,CAAC,mBAAmB,EAA7B,cAA6B,EAA7B,IAA6B,EAAE;YAAnD,IAAM,UAAU,SAAA;YACnB,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3C;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAXD,oDAWC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.d.ts b/node_modules/apollo-utilities/lib/index.d.ts new file mode 100644 index 000000000..6e84d9df3 --- /dev/null +++ b/node_modules/apollo-utilities/lib/index.d.ts @@ -0,0 +1,17 @@ +export * from './directives'; +export * from './fragments'; +export * from './getFromAST'; +export * from './transform'; +export * from './storeUtils'; +export * from './util/assign'; +export * from './util/canUse'; +export * from './util/cloneDeep'; +export * from './util/environment'; +export * from './util/errorHandling'; +export * from './util/isEqual'; +export * from './util/maybeDeepFreeze'; +export * from './util/mergeDeep'; +export * from './util/warnOnce'; +export * from './util/stripSymbols'; +export * from './util/mergeDeep'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.d.ts.map b/node_modules/apollo-utilities/lib/index.d.ts.map new file mode 100644 index 000000000..65614a63e --- /dev/null +++ b/node_modules/apollo-utilities/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.js b/node_modules/apollo-utilities/lib/index.js new file mode 100644 index 000000000..0693303c1 --- /dev/null +++ b/node_modules/apollo-utilities/lib/index.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./directives"), exports); +tslib_1.__exportStar(require("./fragments"), exports); +tslib_1.__exportStar(require("./getFromAST"), exports); +tslib_1.__exportStar(require("./transform"), exports); +tslib_1.__exportStar(require("./storeUtils"), exports); +tslib_1.__exportStar(require("./util/assign"), exports); +tslib_1.__exportStar(require("./util/canUse"), exports); +tslib_1.__exportStar(require("./util/cloneDeep"), exports); +tslib_1.__exportStar(require("./util/environment"), exports); +tslib_1.__exportStar(require("./util/errorHandling"), exports); +tslib_1.__exportStar(require("./util/isEqual"), exports); +tslib_1.__exportStar(require("./util/maybeDeepFreeze"), exports); +tslib_1.__exportStar(require("./util/mergeDeep"), exports); +tslib_1.__exportStar(require("./util/warnOnce"), exports); +tslib_1.__exportStar(require("./util/stripSymbols"), exports); +tslib_1.__exportStar(require("./util/mergeDeep"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.js.map b/node_modules/apollo-utilities/lib/index.js.map new file mode 100644 index 000000000..3c41b7019 --- /dev/null +++ b/node_modules/apollo-utilities/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,uDAA6B;AAC7B,wDAA8B;AAC9B,wDAA8B;AAC9B,2DAAiC;AACjC,6DAAmC;AACnC,+DAAqC;AACrC,yDAA+B;AAC/B,iEAAuC;AACvC,2DAAiC;AACjC,0DAAgC;AAChC,8DAAoC;AACpC,2DAAiC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.d.ts b/node_modules/apollo-utilities/lib/storeUtils.d.ts new file mode 100644 index 000000000..4ac253c68 --- /dev/null +++ b/node_modules/apollo-utilities/lib/storeUtils.d.ts @@ -0,0 +1,39 @@ +import { DirectiveNode, FieldNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, EnumValueNode, VariableNode, InlineFragmentNode, ValueNode, SelectionNode, NameNode } from 'graphql'; +export interface IdValue { + type: 'id'; + id: string; + generated: boolean; + typename: string | undefined; +} +export interface JsonValue { + type: 'json'; + json: any; +} +export declare type ListValue = Array; +export declare type StoreValue = number | string | string[] | IdValue | ListValue | JsonValue | null | undefined | void | Object; +export declare type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode; +export declare function isScalarValue(value: ValueNode): value is ScalarValue; +export declare type NumberValue = IntValueNode | FloatValueNode; +export declare function isNumberValue(value: ValueNode): value is NumberValue; +export declare function valueToObjectRepresentation(argObj: any, name: NameNode, value: ValueNode, variables?: Object): void; +export declare function storeKeyNameFromField(field: FieldNode, variables?: Object): string; +export declare type Directives = { + [directiveName: string]: { + [argName: string]: any; + }; +}; +export declare function getStoreKeyName(fieldName: string, args?: Object, directives?: Directives): string; +export declare function argumentsObjectFromField(field: FieldNode | DirectiveNode, variables: Object): Object; +export declare function resultKeyNameFromField(field: FieldNode): string; +export declare function isField(selection: SelectionNode): selection is FieldNode; +export declare function isInlineFragment(selection: SelectionNode): selection is InlineFragmentNode; +export declare function isIdValue(idObject: StoreValue): idObject is IdValue; +export declare type IdConfig = { + id: string; + typename: string | undefined; +}; +export declare function toIdValue(idConfig: string | IdConfig, generated?: boolean): IdValue; +export declare function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue; +export declare type VariableValue = (node: VariableNode) => any; +export declare function valueFromNode(node: ValueNode, onVariable?: VariableValue): any; +//# sourceMappingURL=storeUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.d.ts.map b/node_modules/apollo-utilities/lib/storeUtils.d.ts.map new file mode 100644 index 000000000..531a96458 --- /dev/null +++ b/node_modules/apollo-utilities/lib/storeUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"storeUtils.d.ts","sourceRoot":"","sources":["src/storeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAGhB,aAAa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C,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,UAAU,GACtB,MAAM,CAmDR;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,GAAG,aAAa,EAChC,SAAS,EAAE,MAAM,GAChB,MAAM,CAUR;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAE/D;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,SAAS,IAAI,SAAS,CAExE;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,aAAa,GACvB,SAAS,IAAI,kBAAkB,CAEjC;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,IAAI,OAAO,CAInE;AAED,oBAAY,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAC3B,SAAS,UAAQ,GAChB,OAAO,CAQT;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,SAAS,CAM3E;AAMD,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC;AAKxD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,UAAU,GAAE,aAAwC,GACnD,GAAG,CAsBL"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.js b/node_modules/apollo-utilities/lib/storeUtils.js new file mode 100644 index 000000000..bf04bfb1b --- /dev/null +++ b/node_modules/apollo-utilities/lib/storeUtils.js @@ -0,0 +1,225 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var fast_json_stable_stringify_1 = tslib_1.__importDefault(require("fast-json-stable-stringify")); +var ts_invariant_1 = require("ts-invariant"); +function isScalarValue(value) { + return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; +} +exports.isScalarValue = isScalarValue; +function isNumberValue(value) { + return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; +} +exports.isNumberValue = isNumberValue; +function isStringValue(value) { + return value.kind === 'StringValue'; +} +function isBooleanValue(value) { + return value.kind === 'BooleanValue'; +} +function isIntValue(value) { + return value.kind === 'IntValue'; +} +function isFloatValue(value) { + return value.kind === 'FloatValue'; +} +function isVariable(value) { + return value.kind === 'Variable'; +} +function isObjectValue(value) { + return value.kind === 'ObjectValue'; +} +function isListValue(value) { + return value.kind === 'ListValue'; +} +function isEnumValue(value) { + return value.kind === 'EnumValue'; +} +function isNullValue(value) { + return value.kind === 'NullValue'; +} +function valueToObjectRepresentation(argObj, name, value, variables) { + if (isIntValue(value) || isFloatValue(value)) { + argObj[name.value] = Number(value.value); + } + else if (isBooleanValue(value) || isStringValue(value)) { + argObj[name.value] = value.value; + } + else if (isObjectValue(value)) { + var nestedArgObj_1 = {}; + value.fields.map(function (obj) { + return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); + }); + argObj[name.value] = nestedArgObj_1; + } + else if (isVariable(value)) { + var variableValue = (variables || {})[value.name.value]; + argObj[name.value] = variableValue; + } + else if (isListValue(value)) { + argObj[name.value] = value.values.map(function (listValue) { + var nestedArgArrayObj = {}; + valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); + return nestedArgArrayObj[name.value]; + }); + } + else if (isEnumValue(value)) { + argObj[name.value] = value.value; + } + else if (isNullValue(value)) { + argObj[name.value] = null; + } + else { + throw new ts_invariant_1.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + + 'is not supported. Use variables instead of inline arguments to ' + + 'overcome this limitation.'); + } +} +exports.valueToObjectRepresentation = valueToObjectRepresentation; +function storeKeyNameFromField(field, variables) { + var directivesObj = null; + if (field.directives) { + directivesObj = {}; + field.directives.forEach(function (directive) { + directivesObj[directive.name.value] = {}; + if (directive.arguments) { + directive.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); + }); + } + }); + } + var argObj = null; + if (field.arguments && field.arguments.length) { + argObj = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(argObj, name, value, variables); + }); + } + return getStoreKeyName(field.name.value, argObj, directivesObj); +} +exports.storeKeyNameFromField = storeKeyNameFromField; +var KNOWN_DIRECTIVES = [ + 'connection', + 'include', + 'skip', + 'client', + 'rest', + 'export', +]; +function getStoreKeyName(fieldName, args, directives) { + if (directives && + directives['connection'] && + directives['connection']['key']) { + if (directives['connection']['filter'] && + directives['connection']['filter'].length > 0) { + var filterKeys = directives['connection']['filter'] + ? directives['connection']['filter'] + : []; + filterKeys.sort(); + var queryArgs_1 = args; + var filteredArgs_1 = {}; + filterKeys.forEach(function (key) { + filteredArgs_1[key] = queryArgs_1[key]; + }); + return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; + } + else { + return directives['connection']['key']; + } + } + var completeFieldName = fieldName; + if (args) { + var stringifiedArgs = fast_json_stable_stringify_1.default(args); + completeFieldName += "(" + stringifiedArgs + ")"; + } + if (directives) { + Object.keys(directives).forEach(function (key) { + if (KNOWN_DIRECTIVES.indexOf(key) !== -1) + return; + if (directives[key] && Object.keys(directives[key]).length) { + completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; + } + else { + completeFieldName += "@" + key; + } + }); + } + return completeFieldName; +} +exports.getStoreKeyName = getStoreKeyName; +function argumentsObjectFromField(field, variables) { + if (field.arguments && field.arguments.length) { + var argObj_1 = {}; + field.arguments.forEach(function (_a) { + var name = _a.name, value = _a.value; + return valueToObjectRepresentation(argObj_1, name, value, variables); + }); + return argObj_1; + } + return null; +} +exports.argumentsObjectFromField = argumentsObjectFromField; +function resultKeyNameFromField(field) { + return field.alias ? field.alias.value : field.name.value; +} +exports.resultKeyNameFromField = resultKeyNameFromField; +function isField(selection) { + return selection.kind === 'Field'; +} +exports.isField = isField; +function isInlineFragment(selection) { + return selection.kind === 'InlineFragment'; +} +exports.isInlineFragment = isInlineFragment; +function isIdValue(idObject) { + return idObject && + idObject.type === 'id' && + typeof idObject.generated === 'boolean'; +} +exports.isIdValue = isIdValue; +function toIdValue(idConfig, generated) { + if (generated === void 0) { generated = false; } + return tslib_1.__assign({ type: 'id', generated: generated }, (typeof idConfig === 'string' + ? { id: idConfig, typename: undefined } + : idConfig)); +} +exports.toIdValue = toIdValue; +function isJsonValue(jsonObject) { + return (jsonObject != null && + typeof jsonObject === 'object' && + jsonObject.type === 'json'); +} +exports.isJsonValue = isJsonValue; +function defaultValueFromVariable(node) { + throw new ts_invariant_1.InvariantError("Variable nodes are not supported by valueFromNode"); +} +function valueFromNode(node, onVariable) { + if (onVariable === void 0) { onVariable = defaultValueFromVariable; } + switch (node.kind) { + case 'Variable': + return onVariable(node); + case 'NullValue': + return null; + case 'IntValue': + return parseInt(node.value, 10); + case 'FloatValue': + return parseFloat(node.value); + case 'ListValue': + return node.values.map(function (v) { return valueFromNode(v, onVariable); }); + case 'ObjectValue': { + var value = {}; + for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { + var field = _a[_i]; + value[field.name.value] = valueFromNode(field.value, onVariable); + } + return value; + } + default: + return node.value; + } +} +exports.valueFromNode = valueFromNode; +//# sourceMappingURL=storeUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.js.map b/node_modules/apollo-utilities/lib/storeUtils.js.map new file mode 100644 index 000000000..bb07be7f6 --- /dev/null +++ b/node_modules/apollo-utilities/lib/storeUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"storeUtils.js","sourceRoot":"","sources":["../src/storeUtils.ts"],"names":[],"mappings":";;;AAkBA,kGAAmD;AACnD,6CAA8C;AA8B9C,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,OAAO,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O,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,aAAa,CAAC,CAAC,EAAE,UAAU,CAAC,EAA5B,CAA4B,CAAC,CAAC;QAC5D,KAAK,aAAa,CAAC,CAAC;YAClB,IAAM,KAAK,GAA2B,EAAE,CAAC;YACzC,KAAoB,UAAW,EAAX,KAAA,IAAI,CAAC,MAAM,EAAX,cAAW,EAAX,IAAW,EAAE;gBAA5B,IAAM,KAAK,SAAA;gBACd,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;aAClE;YACD,OAAO,KAAK,CAAC;SACd;QACD;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;AACH,CAAC;AAzBD,sCAyBC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.d.ts b/node_modules/apollo-utilities/lib/transform.d.ts new file mode 100644 index 000000000..f359faf5b --- /dev/null +++ b/node_modules/apollo-utilities/lib/transform.d.ts @@ -0,0 +1,26 @@ +import { DocumentNode, DirectiveNode, FragmentDefinitionNode, ArgumentNode, FragmentSpreadNode, VariableDefinitionNode } from 'graphql'; +export declare type RemoveNodeConfig = { + name?: string; + test?: (node: N) => boolean; + remove?: boolean; +}; +export declare type GetNodeConfig = { + name?: string; + test?: (node: N) => boolean; +}; +export declare type RemoveDirectiveConfig = RemoveNodeConfig; +export declare type GetDirectiveConfig = GetNodeConfig; +export declare type RemoveArgumentsConfig = RemoveNodeConfig; +export declare type GetFragmentSpreadConfig = GetNodeConfig; +export declare type RemoveFragmentSpreadConfig = RemoveNodeConfig; +export declare type RemoveFragmentDefinitionConfig = RemoveNodeConfig; +export declare type RemoveVariableDefinitionConfig = RemoveNodeConfig; +export declare function removeDirectivesFromDocument(directives: RemoveDirectiveConfig[], doc: DocumentNode): DocumentNode | null; +export declare function addTypenameToDocument(doc: DocumentNode): DocumentNode; +export declare function removeConnectionDirectiveFromDocument(doc: DocumentNode): DocumentNode; +export declare function getDirectivesFromDocument(directives: GetDirectiveConfig[], doc: DocumentNode): DocumentNode; +export declare function removeArgumentsFromDocument(config: RemoveArgumentsConfig[], doc: DocumentNode): DocumentNode; +export declare function removeFragmentSpreadFromDocument(config: RemoveFragmentSpreadConfig[], doc: DocumentNode): DocumentNode; +export declare function buildQueryFromSelectionSet(document: DocumentNode): DocumentNode; +export declare function removeClientSetsFromDocument(document: DocumentNode): DocumentNode | null; +//# sourceMappingURL=transform.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.d.ts.map b/node_modules/apollo-utilities/lib/transform.d.ts.map new file mode 100644 index 000000000..5d6140bec --- /dev/null +++ b/node_modules/apollo-utilities/lib/transform.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKZ,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAgBjB,oBAAY,gBAAgB,CAAC,CAAC,IAAI;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,oBAAY,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CAC7B,CAAC;AAEF,oBAAY,qBAAqB,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACpE,oBAAY,kBAAkB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAC9D,oBAAY,qBAAqB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACnE,oBAAY,uBAAuB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AACxE,oBAAY,0BAA0B,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AAC9E,oBAAY,8BAA8B,GAAG,gBAAgB,CAC3D,sBAAsB,CACvB,CAAC;AACF,oBAAY,8BAA8B,GAAG,gBAAgB,CAC3D,sBAAsB,CACvB,CAAC;AA0CF,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,qBAAqB,EAAE,EACnC,GAAG,EAAE,YAAY,GAChB,YAAY,GAAG,IAAI,CAiHrB;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAkDrE;AAqBD,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,YAAY,gBAKtE;AAwCD,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,kBAAkB,EAAE,EAChC,GAAG,EAAE,YAAY,GAChB,YAAY,CAqCd;AAeD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,qBAAqB,EAAE,EAC/B,GAAG,EAAE,YAAY,GAChB,YAAY,CAgDd;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,0BAA0B,EAAE,EACpC,GAAG,EAAE,YAAY,GAChB,YAAY,CAed;AA0BD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,GACrB,YAAY,CAqBd;AAGD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,YAAY,GACrB,YAAY,GAAG,IAAI,CAoCrB"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.js b/node_modules/apollo-utilities/lib/transform.js new file mode 100644 index 000000000..b138f40cf --- /dev/null +++ b/node_modules/apollo-utilities/lib/transform.js @@ -0,0 +1,311 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var visitor_1 = require("graphql/language/visitor"); +var getFromAST_1 = require("./getFromAST"); +var filterInPlace_1 = require("./util/filterInPlace"); +var ts_invariant_1 = require("ts-invariant"); +var storeUtils_1 = require("./storeUtils"); +var TYPENAME_FIELD = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename', + }, +}; +function isEmpty(op, fragments) { + return op.selectionSet.selections.every(function (selection) { + return selection.kind === 'FragmentSpread' && + isEmpty(fragments[selection.name.value], fragments); + }); +} +function nullIfDocIsEmpty(doc) { + return isEmpty(getFromAST_1.getOperationDefinition(doc) || getFromAST_1.getFragmentDefinition(doc), getFromAST_1.createFragmentMap(getFromAST_1.getFragmentDefinitions(doc))) + ? null + : doc; +} +function getDirectiveMatcher(directives) { + return function directiveMatcher(directive) { + return directives.some(function (dir) { + return (dir.name && dir.name === directive.name.value) || + (dir.test && dir.test(directive)); + }); + }; +} +function removeDirectivesFromDocument(directives, doc) { + var variablesInUse = Object.create(null); + var variablesToRemove = []; + var fragmentSpreadsInUse = Object.create(null); + var fragmentSpreadsToRemove = []; + var modifiedDoc = nullIfDocIsEmpty(visitor_1.visit(doc, { + Variable: { + enter: function (node, _key, parent) { + if (parent.kind !== 'VariableDefinition') { + variablesInUse[node.name.value] = true; + } + }, + }, + Field: { + enter: function (node) { + if (directives && node.directives) { + var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); + if (shouldRemoveField && + node.directives && + node.directives.some(getDirectiveMatcher(directives))) { + if (node.arguments) { + node.arguments.forEach(function (arg) { + if (arg.value.kind === 'Variable') { + variablesToRemove.push({ + name: arg.value.name.value, + }); + } + }); + } + if (node.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { + fragmentSpreadsToRemove.push({ + name: frag.name.value, + }); + }); + } + return null; + } + } + }, + }, + FragmentSpread: { + enter: function (node) { + fragmentSpreadsInUse[node.name.value] = true; + }, + }, + Directive: { + enter: function (node) { + if (getDirectiveMatcher(directives)(node)) { + return null; + } + }, + }, + })); + if (modifiedDoc && + filterInPlace_1.filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) { + modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); + } + if (modifiedDoc && + filterInPlace_1.filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; }) + .length) { + modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); + } + return modifiedDoc; +} +exports.removeDirectivesFromDocument = removeDirectivesFromDocument; +function addTypenameToDocument(doc) { + return visitor_1.visit(getFromAST_1.checkDocument(doc), { + SelectionSet: { + enter: function (node, _key, parent) { + if (parent && + parent.kind === 'OperationDefinition') { + return; + } + var selections = node.selections; + if (!selections) { + return; + } + var skip = selections.some(function (selection) { + return (storeUtils_1.isField(selection) && + (selection.name.value === '__typename' || + selection.name.value.lastIndexOf('__', 0) === 0)); + }); + if (skip) { + return; + } + var field = parent; + if (storeUtils_1.isField(field) && + field.directives && + field.directives.some(function (d) { return d.name.value === 'export'; })) { + return; + } + return tslib_1.__assign({}, node, { selections: selections.concat([TYPENAME_FIELD]) }); + }, + }, + }); +} +exports.addTypenameToDocument = addTypenameToDocument; +var connectionRemoveConfig = { + test: function (directive) { + var willRemove = directive.name.value === 'connection'; + if (willRemove) { + if (!directive.arguments || + !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { + ts_invariant_1.invariant.warn('Removing an @connection directive even though it does not have a key. ' + + 'You may want to use the key parameter to specify a store key.'); + } + } + return willRemove; + }, +}; +function removeConnectionDirectiveFromDocument(doc) { + return removeDirectivesFromDocument([connectionRemoveConfig], getFromAST_1.checkDocument(doc)); +} +exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; +function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { + if (nestedCheck === void 0) { nestedCheck = true; } + return (selectionSet && + selectionSet.selections && + selectionSet.selections.some(function (selection) { + return hasDirectivesInSelection(directives, selection, nestedCheck); + })); +} +function hasDirectivesInSelection(directives, selection, nestedCheck) { + if (nestedCheck === void 0) { nestedCheck = true; } + if (!storeUtils_1.isField(selection)) { + return true; + } + if (!selection.directives) { + return false; + } + return (selection.directives.some(getDirectiveMatcher(directives)) || + (nestedCheck && + hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); +} +function getDirectivesFromDocument(directives, doc) { + getFromAST_1.checkDocument(doc); + var parentPath; + return nullIfDocIsEmpty(visitor_1.visit(doc, { + SelectionSet: { + enter: function (node, _key, _parent, path) { + var currentPath = path.join('-'); + if (!parentPath || + currentPath === parentPath || + !currentPath.startsWith(parentPath)) { + if (node.selections) { + var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); }); + if (hasDirectivesInSelectionSet(directives, node, false)) { + parentPath = currentPath; + } + return tslib_1.__assign({}, node, { selections: selectionsWithDirectives }); + } + else { + return null; + } + } + }, + }, + })); +} +exports.getDirectivesFromDocument = getDirectivesFromDocument; +function getArgumentMatcher(config) { + return function argumentMatcher(argument) { + return config.some(function (aConfig) { + return argument.value && + argument.value.kind === 'Variable' && + argument.value.name && + (aConfig.name === argument.value.name.value || + (aConfig.test && aConfig.test(argument))); + }); + }; +} +function removeArgumentsFromDocument(config, doc) { + var argMatcher = getArgumentMatcher(config); + return nullIfDocIsEmpty(visitor_1.visit(doc, { + OperationDefinition: { + enter: function (node) { + return tslib_1.__assign({}, node, { variableDefinitions: node.variableDefinitions.filter(function (varDef) { + return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); + }) }); + }, + }, + Field: { + enter: function (node) { + var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); + if (shouldRemoveField) { + var argMatchCount_1 = 0; + node.arguments.forEach(function (arg) { + if (argMatcher(arg)) { + argMatchCount_1 += 1; + } + }); + if (argMatchCount_1 === 1) { + return null; + } + } + }, + }, + Argument: { + enter: function (node) { + if (argMatcher(node)) { + return null; + } + }, + }, + })); +} +exports.removeArgumentsFromDocument = removeArgumentsFromDocument; +function removeFragmentSpreadFromDocument(config, doc) { + function enter(node) { + if (config.some(function (def) { return def.name === node.name.value; })) { + return null; + } + } + return nullIfDocIsEmpty(visitor_1.visit(doc, { + FragmentSpread: { enter: enter }, + FragmentDefinition: { enter: enter }, + })); +} +exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; +function getAllFragmentSpreadsFromSelectionSet(selectionSet) { + var allFragments = []; + selectionSet.selections.forEach(function (selection) { + if ((storeUtils_1.isField(selection) || storeUtils_1.isInlineFragment(selection)) && + selection.selectionSet) { + getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); + } + else if (selection.kind === 'FragmentSpread') { + allFragments.push(selection); + } + }); + return allFragments; +} +function buildQueryFromSelectionSet(document) { + var definition = getFromAST_1.getMainDefinition(document); + var definitionOperation = definition.operation; + if (definitionOperation === 'query') { + return document; + } + var modifiedDoc = visitor_1.visit(document, { + OperationDefinition: { + enter: function (node) { + return tslib_1.__assign({}, node, { operation: 'query' }); + }, + }, + }); + return modifiedDoc; +} +exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; +function removeClientSetsFromDocument(document) { + getFromAST_1.checkDocument(document); + var modifiedDoc = removeDirectivesFromDocument([ + { + test: function (directive) { return directive.name.value === 'client'; }, + remove: true, + }, + ], document); + if (modifiedDoc) { + modifiedDoc = visitor_1.visit(modifiedDoc, { + FragmentDefinition: { + enter: function (node) { + if (node.selectionSet) { + var isTypenameOnly = node.selectionSet.selections.every(function (selection) { + return storeUtils_1.isField(selection) && selection.name.value === '__typename'; + }); + if (isTypenameOnly) { + return null; + } + } + }, + }, + }); + } + return modifiedDoc; +} +exports.removeClientSetsFromDocument = removeClientSetsFromDocument; +//# sourceMappingURL=transform.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.js.map b/node_modules/apollo-utilities/lib/transform.js.map new file mode 100644 index 000000000..a62ff41f7 --- /dev/null +++ b/node_modules/apollo-utilities/lib/transform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;AAaA,oDAAiD;AAEjD,2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AC,KAAK,KAAK,QAAQ,EAAjC,CAAiC;YACrE,MAAM,EAAE,IAAI;SACb;KACF,EACD,QAAQ,CACT,CAAC;IAMF,IAAI,WAAW,EAAE;QACf,WAAW,GAAG,eAAK,CAAC,WAAW,EAAE;YAC/B,kBAAkB,EAAE;gBAClB,KAAK,YAAC,IAAI;oBACR,IAAI,IAAI,CAAC,YAAY,EAAE;wBACrB,IAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CACvD,UAAA,SAAS;4BACP,OAAA,oBAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY;wBAA3D,CAA2D,CAC9D,CAAC;wBACF,IAAI,cAAc,EAAE;4BAClB,OAAO,IAAI,CAAC;yBACb;qBACF;gBACH,CAAC;aACF;SACF,CAAC,CAAC;KACJ;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAtCD,oEAsCC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.d.ts b/node_modules/apollo-utilities/lib/util/assign.d.ts new file mode 100644 index 000000000..306bddf7a --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/assign.d.ts @@ -0,0 +1,6 @@ +export declare function assign(a: A, b: B): A & B; +export declare function assign(a: A, b: B, c: C): A & B & C; +export declare function assign(a: A, b: B, c: C, d: D): A & B & C & D; +export declare function assign(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; +export declare function assign(target: any, ...sources: Array): any; +//# sourceMappingURL=assign.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.d.ts.map b/node_modules/apollo-utilities/lib/util/assign.d.ts.map new file mode 100644 index 000000000..20e9dbff6 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/assign.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assign.d.ts","sourceRoot":"","sources":["../src/util/assign.ts"],"names":[],"mappings":"AAMA,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChD,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7D,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1E,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAClC,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,GACH,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.js b/node_modules/apollo-utilities/lib/util/assign.js new file mode 100644 index 000000000..78e390151 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/assign.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function assign(target) { + var sources = []; + for (var _i = 1; _i < arguments.length; _i++) { + sources[_i - 1] = arguments[_i]; + } + sources.forEach(function (source) { + if (typeof source === 'undefined' || source === null) { + return; + } + Object.keys(source).forEach(function (key) { + target[key] = source[key]; + }); + }); + return target; +} +exports.assign = assign; +//# sourceMappingURL=assign.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.js.map b/node_modules/apollo-utilities/lib/util/assign.js.map new file mode 100644 index 000000000..6a697cc96 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/assign.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assign.js","sourceRoot":"","sources":["../../src/util/assign.ts"],"names":[],"mappings":";;AAiBA,SAAgB,MAAM,CACpB,MAA8B;IAC9B,iBAAyC;SAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;QAAzC,gCAAyC;;IAEzC,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM;QACpB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,IAAI,EAAE;YACpD,OAAO;SACR;QACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,wBAaC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.d.ts b/node_modules/apollo-utilities/lib/util/canUse.d.ts new file mode 100644 index 000000000..53d76ab7f --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/canUse.d.ts @@ -0,0 +1,2 @@ +export declare const canUseWeakMap: boolean; +//# sourceMappingURL=canUse.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.d.ts.map b/node_modules/apollo-utilities/lib/util/canUse.d.ts.map new file mode 100644 index 000000000..74a2206a7 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/canUse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"canUse.d.ts","sourceRoot":"","sources":["../src/util/canUse.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,SAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.js b/node_modules/apollo-utilities/lib/util/canUse.js new file mode 100644 index 000000000..c8caab977 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/canUse.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && + navigator.product === 'ReactNative'); +//# sourceMappingURL=canUse.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.js.map b/node_modules/apollo-utilities/lib/util/canUse.js.map new file mode 100644 index 000000000..e0e5e566f --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/canUse.js.map @@ -0,0 +1 @@ +{"version":3,"file":"canUse.js","sourceRoot":"","sources":["../../src/util/canUse.ts"],"names":[],"mappings":";;AAAa,QAAA,aAAa,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,CAAC,CAC7D,OAAO,SAAS,KAAK,QAAQ;IAC7B,SAAS,CAAC,OAAO,KAAK,aAAa,CACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts new file mode 100644 index 000000000..61525aada --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts @@ -0,0 +1,2 @@ +export declare function cloneDeep(value: T): T; +//# sourceMappingURL=cloneDeep.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map new file mode 100644 index 000000000..a871948fe --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cloneDeep.d.ts","sourceRoot":"","sources":["../src/util/cloneDeep.ts"],"names":[],"mappings":"AAKA,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAExC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.js b/node_modules/apollo-utilities/lib/util/cloneDeep.js new file mode 100644 index 000000000..8fbfb3fe1 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/cloneDeep.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var toString = Object.prototype.toString; +function cloneDeep(value) { + return cloneDeepHelper(value, new Map()); +} +exports.cloneDeep = cloneDeep; +function cloneDeepHelper(val, seen) { + switch (toString.call(val)) { + case "[object Array]": { + if (seen.has(val)) + return seen.get(val); + var copy_1 = val.slice(0); + seen.set(val, copy_1); + copy_1.forEach(function (child, i) { + copy_1[i] = cloneDeepHelper(child, seen); + }); + return copy_1; + } + case "[object Object]": { + if (seen.has(val)) + return seen.get(val); + var copy_2 = Object.create(Object.getPrototypeOf(val)); + seen.set(val, copy_2); + Object.keys(val).forEach(function (key) { + copy_2[key] = cloneDeepHelper(val[key], seen); + }); + return copy_2; + } + default: + return val; + } +} +//# sourceMappingURL=cloneDeep.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.js.map b/node_modules/apollo-utilities/lib/util/cloneDeep.js.map new file mode 100644 index 000000000..36015d2d6 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/cloneDeep.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../src/util/cloneDeep.ts"],"names":[],"mappings":";;AAAQ,IAAA,oCAAQ,CAAsB;AAKtC,SAAgB,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC;AAFD,8BAEC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAmB;IACrD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBAC1B,MAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAE,GAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED;YACE,OAAO,GAAG,CAAC;KACZ;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.d.ts b/node_modules/apollo-utilities/lib/util/environment.d.ts new file mode 100644 index 000000000..3dac4c1b9 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/environment.d.ts @@ -0,0 +1,6 @@ +export declare function getEnv(): string | undefined; +export declare function isEnv(env: string): boolean; +export declare function isProduction(): boolean; +export declare function isDevelopment(): boolean; +export declare function isTest(): boolean; +//# sourceMappingURL=environment.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.d.ts.map b/node_modules/apollo-utilities/lib/util/environment.d.ts.map new file mode 100644 index 000000000..ac39af268 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/environment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/util/environment.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,IAAI,MAAM,GAAG,SAAS,CAO3C;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED,wBAAgB,MAAM,IAAI,OAAO,CAEhC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.js b/node_modules/apollo-utilities/lib/util/environment.js new file mode 100644 index 000000000..13f120efc --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/environment.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getEnv() { + if (typeof process !== 'undefined' && process.env.NODE_ENV) { + return process.env.NODE_ENV; + } + return 'development'; +} +exports.getEnv = getEnv; +function isEnv(env) { + return getEnv() === env; +} +exports.isEnv = isEnv; +function isProduction() { + return isEnv('production') === true; +} +exports.isProduction = isProduction; +function isDevelopment() { + return isEnv('development') === true; +} +exports.isDevelopment = isDevelopment; +function isTest() { + return isEnv('test') === true; +} +exports.isTest = isTest; +//# sourceMappingURL=environment.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.js.map b/node_modules/apollo-utilities/lib/util/environment.js.map new file mode 100644 index 000000000..d7b9e1aef --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/environment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/util/environment.ts"],"names":[],"mappings":";;AAAA,SAAgB,MAAM;IACpB,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QAC1D,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KAC7B;IAGD,OAAO,aAAa,CAAC;AACvB,CAAC;AAPD,wBAOC;AAED,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,MAAM,EAAE,KAAK,GAAG,CAAC;AAC1B,CAAC;AAFD,sBAEC;AAED,SAAgB,YAAY;IAC1B,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AACtC,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa;IAC3B,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAFD,sCAEC;AAED,SAAgB,MAAM;IACpB,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC;AAFD,wBAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts new file mode 100644 index 000000000..d1d25c330 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts @@ -0,0 +1,4 @@ +import { ExecutionResult } from 'graphql'; +export declare function tryFunctionOrLogError(f: Function): any; +export declare function graphQLResultHasError(result: ExecutionResult): number; +//# sourceMappingURL=errorHandling.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map new file mode 100644 index 000000000..6955d0165 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../src/util/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,QAAQ,OAQhD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,UAE5D"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.js b/node_modules/apollo-utilities/lib/util/errorHandling.js new file mode 100644 index 000000000..a9955e19d --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/errorHandling.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function tryFunctionOrLogError(f) { + try { + return f(); + } + catch (e) { + if (console.error) { + console.error(e); + } + } +} +exports.tryFunctionOrLogError = tryFunctionOrLogError; +function graphQLResultHasError(result) { + return result.errors && result.errors.length; +} +exports.graphQLResultHasError = graphQLResultHasError; +//# sourceMappingURL=errorHandling.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.js.map b/node_modules/apollo-utilities/lib/util/errorHandling.js.map new file mode 100644 index 000000000..52b9fb6b6 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/errorHandling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/util/errorHandling.ts"],"names":[],"mappings":";;AAEA,SAAgB,qBAAqB,CAAC,CAAW;IAC/C,IAAI;QACF,OAAO,CAAC,EAAE,CAAC;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClB;KACF;AACH,CAAC;AARD,sDAQC;AAED,SAAgB,qBAAqB,CAAC,MAAuB;IAC3D,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/C,CAAC;AAFD,sDAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts new file mode 100644 index 000000000..429feb861 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts @@ -0,0 +1,2 @@ +export declare function filterInPlace(array: T[], test: (elem: T) => boolean, context?: any): T[]; +//# sourceMappingURL=filterInPlace.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map new file mode 100644 index 000000000..c45757b74 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"filterInPlace.d.ts","sourceRoot":"","sources":["../src/util/filterInPlace.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,EAC1B,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,EAAE,CASL"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.js b/node_modules/apollo-utilities/lib/util/filterInPlace.js new file mode 100644 index 000000000..66b9dd6e1 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/filterInPlace.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function filterInPlace(array, test, context) { + var target = 0; + array.forEach(function (elem, i) { + if (test.call(this, elem, i, array)) { + array[target++] = elem; + } + }, context); + array.length = target; + return array; +} +exports.filterInPlace = filterInPlace; +//# sourceMappingURL=filterInPlace.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.js.map b/node_modules/apollo-utilities/lib/util/filterInPlace.js.map new file mode 100644 index 000000000..d0e2a7dc9 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/filterInPlace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"filterInPlace.js","sourceRoot":"","sources":["../../src/util/filterInPlace.ts"],"names":[],"mappings":";;AAAA,SAAgB,aAAa,CAC3B,KAAU,EACV,IAA0B,EAC1B,OAAa;IAEb,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;YACnC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;SACxB;IACH,CAAC,EAAE,OAAO,CAAC,CAAC;IACZ,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,sCAaC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.d.ts b/node_modules/apollo-utilities/lib/util/isEqual.d.ts new file mode 100644 index 000000000..fe0950675 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/isEqual.d.ts @@ -0,0 +1,2 @@ +export { equal as isEqual } from '@wry/equality'; +//# sourceMappingURL=isEqual.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map b/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map new file mode 100644 index 000000000..d2078c935 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../src/util/isEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.js b/node_modules/apollo-utilities/lib/util/isEqual.js new file mode 100644 index 000000000..f7d228c81 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/isEqual.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var equality_1 = require("@wry/equality"); +exports.isEqual = equality_1.equal; +//# sourceMappingURL=isEqual.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.js.map b/node_modules/apollo-utilities/lib/util/isEqual.js.map new file mode 100644 index 000000000..c6fe9ba5f --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/isEqual.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isEqual.js","sourceRoot":"","sources":["../../src/util/isEqual.ts"],"names":[],"mappings":";;AAAA,0CAAiD;AAAxC,6BAAA,KAAK,CAAW"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts new file mode 100644 index 000000000..e5c569eea --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts @@ -0,0 +1,2 @@ +export declare function maybeDeepFreeze(obj: any): any; +//# sourceMappingURL=maybeDeepFreeze.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map new file mode 100644 index 000000000..99cb3ef88 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../src/util/maybeDeepFreeze.ts"],"names":[],"mappings":"AAoBA,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,OAYvC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js new file mode 100644 index 000000000..2f7b836d6 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +function deepFreeze(o) { + Object.freeze(o); + Object.getOwnPropertyNames(o).forEach(function (prop) { + if (o[prop] !== null && + (typeof o[prop] === 'object' || typeof o[prop] === 'function') && + !Object.isFrozen(o[prop])) { + deepFreeze(o[prop]); + } + }); + return o; +} +function maybeDeepFreeze(obj) { + if (environment_1.isDevelopment() || environment_1.isTest()) { + var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; + if (!symbolIsPolyfilled) { + return deepFreeze(obj); + } + } + return obj; +} +exports.maybeDeepFreeze = maybeDeepFreeze; +//# sourceMappingURL=maybeDeepFreeze.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map new file mode 100644 index 000000000..ea62a05d1 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map @@ -0,0 +1 @@ +{"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../src/util/maybeDeepFreeze.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AAItD,SAAS,UAAU,CAAC,CAAM;IACxB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEjB,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;QACjD,IACE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI;YAChB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;YAC9D,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EACzB;YACA,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SACrB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAgB,eAAe,CAAC,GAAQ;IACtC,IAAI,2BAAa,EAAE,IAAI,oBAAM,EAAE,EAAE;QAG/B,IAAM,kBAAkB,GACtB,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC;QAEjE,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;SACxB;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAZD,0CAYC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts new file mode 100644 index 000000000..d3c18919c --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts @@ -0,0 +1,4 @@ +export declare type TupleToIntersection = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any; +export declare function mergeDeep(...sources: T): TupleToIntersection; +export declare function mergeDeepArray(sources: T[]): T; +//# sourceMappingURL=mergeDeep.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map new file mode 100644 index 000000000..d95732fca --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../src/util/mergeDeep.ts"],"names":[],"mappings":"AAgBA,oBAAY,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,IAC7C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GACvB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GACpC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACjD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC3E,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAElC,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EACvC,GAAG,OAAO,EAAE,CAAC,GACZ,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAQD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAWjD"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.js b/node_modules/apollo-utilities/lib/util/mergeDeep.js new file mode 100644 index 000000000..e4100a26e --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/mergeDeep.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var hasOwnProperty = Object.prototype.hasOwnProperty; +function mergeDeep() { + var sources = []; + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i] = arguments[_i]; + } + return mergeDeepArray(sources); +} +exports.mergeDeep = mergeDeep; +function mergeDeepArray(sources) { + var target = sources[0] || {}; + var count = sources.length; + if (count > 1) { + var pastCopies = []; + target = shallowCopyForMerge(target, pastCopies); + for (var i = 1; i < count; ++i) { + target = mergeHelper(target, sources[i], pastCopies); + } + } + return target; +} +exports.mergeDeepArray = mergeDeepArray; +function isObject(obj) { + return obj !== null && typeof obj === 'object'; +} +function mergeHelper(target, source, pastCopies) { + if (isObject(source) && isObject(target)) { + if (Object.isExtensible && !Object.isExtensible(target)) { + target = shallowCopyForMerge(target, pastCopies); + } + Object.keys(source).forEach(function (sourceKey) { + var sourceValue = source[sourceKey]; + if (hasOwnProperty.call(target, sourceKey)) { + var targetValue = target[sourceKey]; + if (sourceValue !== targetValue) { + target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); + } + } + else { + target[sourceKey] = sourceValue; + } + }); + return target; + } + return source; +} +function shallowCopyForMerge(value, pastCopies) { + if (value !== null && + typeof value === 'object' && + pastCopies.indexOf(value) < 0) { + if (Array.isArray(value)) { + value = value.slice(0); + } + else { + value = tslib_1.__assign({ __proto__: Object.getPrototypeOf(value) }, value); + } + pastCopies.push(value); + } + return value; +} +//# sourceMappingURL=mergeDeep.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.js.map b/node_modules/apollo-utilities/lib/util/mergeDeep.js.map new file mode 100644 index 000000000..20393f8f0 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/mergeDeep.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mergeDeep.js","sourceRoot":"","sources":["../../src/util/mergeDeep.ts"],"names":[],"mappings":";;;AAAQ,IAAA,gDAAc,CAAsB;AAwB5C,SAAgB,SAAS;IACvB,iBAAa;SAAb,UAAa,EAAb,qBAAa,EAAb,IAAa;QAAb,4BAAa;;IAEb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAJD,8BAIC;AAQD,SAAgB,cAAc,CAAI,OAAY;IAC5C,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAO,CAAC;IACnC,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAC7B,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,IAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,EAAE;YAC9B,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,U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AO,CAAC,KAAK,CAAC,EAAE;YACxB,KAAK,GAAI,KAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACjC;aAAM;YACL,KAAK,sBACH,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IACpC,KAAK,CACT,CAAC;SACH;QACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts new file mode 100644 index 000000000..48d2b7cb9 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts @@ -0,0 +1,2 @@ +export declare function stripSymbols(data: T): T; +//# sourceMappingURL=stripSymbols.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map new file mode 100644 index 000000000..9e0384d85 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stripSymbols.d.ts","sourceRoot":"","sources":["../src/util/stripSymbols.ts"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE1C"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.js b/node_modules/apollo-utilities/lib/util/stripSymbols.js new file mode 100644 index 000000000..bc978e58a --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/stripSymbols.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function stripSymbols(data) { + return JSON.parse(JSON.stringify(data)); +} +exports.stripSymbols = stripSymbols; +//# sourceMappingURL=stripSymbols.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.js.map b/node_modules/apollo-utilities/lib/util/stripSymbols.js.map new file mode 100644 index 000000000..3bbcc9c5d --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/stripSymbols.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stripSymbols.js","sourceRoot":"","sources":["../../src/util/stripSymbols.ts"],"names":[],"mappings":";;AAWA,SAAgB,YAAY,CAAI,IAAO;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts new file mode 100644 index 000000000..0b7c18977 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts @@ -0,0 +1,2 @@ +export declare function warnOnceInDevelopment(msg: string, type?: string): void; +//# sourceMappingURL=warnOnce.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map new file mode 100644 index 000000000..1b652a3c9 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"warnOnce.d.ts","sourceRoot":"","sources":["../src/util/warnOnce.ts"],"names":[],"mappings":"AAYA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAS,QAW/D"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.js b/node_modules/apollo-utilities/lib/util/warnOnce.js new file mode 100644 index 000000000..167ba8f06 --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/warnOnce.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var environment_1 = require("./environment"); +var haveWarned = Object.create({}); +function warnOnceInDevelopment(msg, type) { + if (type === void 0) { type = 'warn'; } + if (!environment_1.isProduction() && !haveWarned[msg]) { + if (!environment_1.isTest()) { + haveWarned[msg] = true; + } + if (type === 'error') { + console.error(msg); + } + else { + console.warn(msg); + } + } +} +exports.warnOnceInDevelopment = warnOnceInDevelopment; +//# sourceMappingURL=warnOnce.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.js.map b/node_modules/apollo-utilities/lib/util/warnOnce.js.map new file mode 100644 index 000000000..63d8e3d1e --- /dev/null +++ b/node_modules/apollo-utilities/lib/util/warnOnce.js.map @@ -0,0 +1 @@ +{"version":3,"file":"warnOnce.js","sourceRoot":"","sources":["../../src/util/warnOnce.ts"],"names":[],"mappings":";;AAAA,6CAAqD;AAErD,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAUrC,SAAgB,qBAAqB,CAAC,GAAW,EAAE,IAAa;IAAb,qBAAA,EAAA,aAAa;IAC9D,IAAI,CAAC,0BAAY,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACvC,IAAI,CAAC,oBAAM,EAAE,EAAE;YACb,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,OAAO,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;AACH,CAAC;AAXD,sDAWC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/package.json b/node_modules/apollo-utilities/package.json new file mode 100644 index 000000000..308618157 --- /dev/null +++ b/node_modules/apollo-utilities/package.json @@ -0,0 +1,48 @@ +{ + "name": "apollo-utilities", + "version": "1.3.2", + "description": "Utilities for working with GraphQL ASTs", + "author": "James Baxley ", + "contributors": [ + "James Baxley ", + "Jonas Helfer ", + "Sashko Stubailo ", + "James Burgess " + ], + "license": "MIT", + "main": "./lib/bundle.cjs.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-client.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-client/issues" + }, + "homepage": "https://github.com/apollographql/apollo-client#readme", + "scripts": { + "prepare": "npm run lint && npm run build", + "test": "tsc -p tsconfig.json --noEmit && jest", + "coverage": "jest --coverage", + "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts", + "prebuild": "npm run clean", + "build": "tsc -b .", + "postbuild": "npm run bundle", + "bundle": "../../node_modules/rollup/bin/rollup -c rollup.config.js", + "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", + "clean": "rm -rf coverage/* lib/*", + "prepublishOnly": "npm run clean && npm run build" + }, + "peerDependencies": { + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "dependencies": { + "@wry/equality": "^0.1.2", + "fast-json-stable-stringify": "^2.0.0", + "ts-invariant": "^0.4.0", + "tslib": "^1.9.3" + }, + "gitHead": "656fd9fbcf82df5cd6b9512e4c9b90b808e300ad" +} diff --git a/node_modules/apollo-utilities/src/__tests__/directives.ts b/node_modules/apollo-utilities/src/__tests__/directives.ts new file mode 100644 index 000000000..eea3500a7 --- /dev/null +++ b/node_modules/apollo-utilities/src/__tests__/directives.ts @@ -0,0 +1,274 @@ +import gql from 'graphql-tag'; +import { cloneDeep } from 'lodash'; + +import { shouldInclude, hasDirectives } from '../directives'; +import { getQueryDefinition } from '../getFromAST'; + +describe('hasDirective', () => { + it('should allow searching the ast for a directive', () => { + const query = gql` + query Simple { + field @live + } + `; + expect(hasDirectives(['live'], query)).toBe(true); + expect(hasDirectives(['defer'], query)).toBe(false); + }); + it('works for all operation types', () => { + const query = gql` + { + field @live { + subField { + hello @live + } + } + } + `; + + const mutation = gql` + mutation Directive { + mutate { + field { + subField { + hello @live + } + } + } + } + `; + + const subscription = gql` + subscription LiveDirective { + sub { + field { + subField { + hello @live + } + } + } + } + `; + + [query, mutation, subscription].forEach(x => { + expect(hasDirectives(['live'], x)).toBe(true); + expect(hasDirectives(['defer'], x)).toBe(false); + }); + }); + it('works for simple fragments', () => { + const query = gql` + query Simple { + ...fieldFragment + } + + fragment fieldFragment on Field { + foo @live + } + `; + expect(hasDirectives(['live'], query)).toBe(true); + expect(hasDirectives(['defer'], query)).toBe(false); + }); + it('works for nested fragments', () => { + const query = gql` + query Simple { + ...fieldFragment1 + } + + fragment fieldFragment1 on Field { + bar { + baz { + ...nestedFragment + } + } + } + + fragment nestedFragment on Field { + foo @live + } + `; + expect(hasDirectives(['live'], query)).toBe(true); + expect(hasDirectives(['defer'], query)).toBe(false); + }); +}); + +describe('shouldInclude', () => { + it('should should not include a skipped field', () => { + const query = gql` + query { + fortuneCookie @skip(if: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, {})).toBe(true); + }); + + it('should include an included field', () => { + const query = gql` + query { + fortuneCookie @include(if: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(shouldInclude(field, {})).toBe(true); + }); + + it('should not include a not include: false field', () => { + const query = gql` + query { + fortuneCookie @include(if: false) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, {})).toBe(true); + }); + + it('should include a skip: false field', () => { + const query = gql` + query { + fortuneCookie @skip(if: false) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(shouldInclude(field, {})).toBe(true); + }); + + it('should not include a field if skip: true and include: true', () => { + const query = gql` + query { + fortuneCookie @skip(if: true) @include(if: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, {})).toBe(true); + }); + + it('should not include a field if skip: true and include: false', () => { + const query = gql` + query { + fortuneCookie @skip(if: true) @include(if: false) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, {})).toBe(true); + }); + + it('should include a field if skip: false and include: true', () => { + const query = gql` + query { + fortuneCookie @skip(if: false) @include(if: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(shouldInclude(field, {})).toBe(true); + }); + + it('should not include a field if skip: false and include: false', () => { + const query = gql` + query { + fortuneCookie @skip(if: false) @include(if: false) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, {})).toBe(true); + }); + + it('should leave the original query unmodified', () => { + const query = gql` + query { + fortuneCookie @skip(if: false) @include(if: false) + } + `; + const queryClone = cloneDeep(query); + const field = getQueryDefinition(query).selectionSet.selections[0]; + shouldInclude(field, {}); + expect(query).toEqual(queryClone); + }); + + it('does not throw an error on an unsupported directive', () => { + const query = gql` + query { + fortuneCookie @dosomething(if: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + + expect(() => { + shouldInclude(field, {}); + }).not.toThrow(); + }); + + it('throws an error on an invalid argument for the skip directive', () => { + const query = gql` + query { + fortuneCookie @skip(nothing: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + + expect(() => { + shouldInclude(field, {}); + }).toThrow(); + }); + + it('throws an error on an invalid argument for the include directive', () => { + const query = gql` + query { + fortuneCookie @include(nothing: true) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + + expect(() => { + shouldInclude(field, {}); + }).toThrow(); + }); + + it('throws an error on an invalid variable name within a directive argument', () => { + const query = gql` + query { + fortuneCookie @include(if: $neverDefined) + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(() => { + shouldInclude(field, {}); + }).toThrow(); + }); + + it('evaluates variables on skip fields', () => { + const query = gql` + query($shouldSkip: Boolean) { + fortuneCookie @skip(if: $shouldSkip) + } + `; + const variables = { + shouldSkip: true, + }; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, variables)).toBe(true); + }); + + it('evaluates variables on include fields', () => { + const query = gql` + query($shouldSkip: Boolean) { + fortuneCookie @include(if: $shouldInclude) + } + `; + const variables = { + shouldInclude: false, + }; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(!shouldInclude(field, variables)).toBe(true); + }); + + it('throws an error if the value of the argument is not a variable or boolean', () => { + const query = gql` + query { + fortuneCookie @include(if: "string") + } + `; + const field = getQueryDefinition(query).selectionSet.selections[0]; + expect(() => { + shouldInclude(field, {}); + }).toThrow(); + }); +}); diff --git a/node_modules/apollo-utilities/src/__tests__/fragments.ts b/node_modules/apollo-utilities/src/__tests__/fragments.ts new file mode 100644 index 000000000..1c6cfa164 --- /dev/null +++ b/node_modules/apollo-utilities/src/__tests__/fragments.ts @@ -0,0 +1,327 @@ +import { print } from 'graphql/language/printer'; +import gql from 'graphql-tag'; +import { disableFragmentWarnings } from 'graphql-tag'; + +// Turn off warnings for repeated fragment names +disableFragmentWarnings(); + +import { getFragmentQueryDocument } from '../fragments'; + +describe('getFragmentQueryDocument', () => { + it('will throw an error if there is an operation', () => { + expect(() => + getFragmentQueryDocument( + gql` + { + a + b + c + } + `, + ), + ).toThrowError( + 'Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.', + ); + expect(() => + getFragmentQueryDocument( + gql` + query { + a + b + c + } + `, + ), + ).toThrowError( + 'Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.', + ); + expect(() => + getFragmentQueryDocument( + gql` + query Named { + a + b + c + } + `, + ), + ).toThrowError( + "Found a query operation named 'Named'. No operations are allowed when using a fragment as a query. Only fragments are allowed.", + ); + expect(() => + getFragmentQueryDocument( + gql` + mutation Named { + a + b + c + } + `, + ), + ).toThrowError( + "Found a mutation operation named 'Named'. No operations are allowed when using a fragment as a query. " + + 'Only fragments are allowed.', + ); + expect(() => + getFragmentQueryDocument( + gql` + subscription Named { + a + b + c + } + `, + ), + ).toThrowError( + "Found a subscription operation named 'Named'. No operations are allowed when using a fragment as a query. " + + 'Only fragments are allowed.', + ); + }); + + it('will throw an error if there is not exactly one fragment but no `fragmentName`', () => { + expect(() => { + getFragmentQueryDocument(gql` + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + } + `); + }).toThrowError( + 'Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', + ); + expect(() => { + getFragmentQueryDocument(gql` + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + } + + fragment baz on Baz { + g + h + i + } + `); + }).toThrowError( + 'Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', + ); + expect(() => { + getFragmentQueryDocument(gql` + scalar Foo + `); + }).toThrowError( + 'Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', + ); + }); + + it('will create a query document where the single fragment is spread in the root query', () => { + expect( + print( + getFragmentQueryDocument(gql` + fragment foo on Foo { + a + b + c + } + `), + ), + ).toEqual( + print(gql` + { + ...foo + } + + fragment foo on Foo { + a + b + c + } + `), + ); + }); + + it('will create a query document where the named fragment is spread in the root query', () => { + expect( + print( + getFragmentQueryDocument( + gql` + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `, + 'foo', + ), + ), + ).toEqual( + print(gql` + { + ...foo + } + + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `), + ); + expect( + print( + getFragmentQueryDocument( + gql` + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `, + 'bar', + ), + ), + ).toEqual( + print(gql` + { + ...bar + } + + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `), + ); + expect( + print( + getFragmentQueryDocument( + gql` + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `, + 'baz', + ), + ), + ).toEqual( + print(gql` + { + ...baz + } + + fragment foo on Foo { + a + b + c + } + + fragment bar on Bar { + d + e + f + ...foo + } + + fragment baz on Baz { + g + h + i + ...foo + ...bar + } + `), + ); + }); +}); diff --git a/node_modules/apollo-utilities/src/__tests__/getFromAST.ts b/node_modules/apollo-utilities/src/__tests__/getFromAST.ts new file mode 100644 index 000000000..a81a5f3ca --- /dev/null +++ b/node_modules/apollo-utilities/src/__tests__/getFromAST.ts @@ -0,0 +1,316 @@ +import { print } from 'graphql/language/printer'; +import gql from 'graphql-tag'; +import { FragmentDefinitionNode, OperationDefinitionNode } from 'graphql'; + +import { + checkDocument, + getFragmentDefinitions, + getQueryDefinition, + getMutationDefinition, + createFragmentMap, + FragmentMap, + getDefaultValues, + getOperationName, +} from '../getFromAST'; + +describe('AST utility functions', () => { + it('should correctly check a document for correctness', () => { + const multipleQueries = gql` + query { + author { + firstName + lastName + } + } + + query { + author { + address + } + } + `; + expect(() => { + checkDocument(multipleQueries); + }).toThrow(); + + const namedFragment = gql` + query { + author { + ...authorDetails + } + } + + fragment authorDetails on Author { + firstName + lastName + } + `; + expect(() => { + checkDocument(namedFragment); + }).not.toThrow(); + }); + + it('should get fragment definitions from a document containing a single fragment', () => { + const singleFragmentDefinition = gql` + query { + author { + ...authorDetails + } + } + + fragment authorDetails on Author { + firstName + lastName + } + `; + const expectedDoc = gql` + fragment authorDetails on Author { + firstName + lastName + } + `; + const expectedResult: FragmentDefinitionNode[] = [ + expectedDoc.definitions[0] as FragmentDefinitionNode, + ]; + const actualResult = getFragmentDefinitions(singleFragmentDefinition); + expect(actualResult.length).toEqual(expectedResult.length); + expect(print(actualResult[0])).toBe(print(expectedResult[0])); + }); + + it('should get fragment definitions from a document containing a multiple fragments', () => { + const multipleFragmentDefinitions = gql` + query { + author { + ...authorDetails + ...moreAuthorDetails + } + } + + fragment authorDetails on Author { + firstName + lastName + } + + fragment moreAuthorDetails on Author { + address + } + `; + const expectedDoc = gql` + fragment authorDetails on Author { + firstName + lastName + } + + fragment moreAuthorDetails on Author { + address + } + `; + const expectedResult: FragmentDefinitionNode[] = [ + expectedDoc.definitions[0] as FragmentDefinitionNode, + expectedDoc.definitions[1] as FragmentDefinitionNode, + ]; + const actualResult = getFragmentDefinitions(multipleFragmentDefinitions); + expect(actualResult.map(print)).toEqual(expectedResult.map(print)); + }); + + it('should get the correct query definition out of a query containing multiple fragments', () => { + const queryWithFragments = gql` + fragment authorDetails on Author { + firstName + lastName + } + + fragment moreAuthorDetails on Author { + address + } + + query { + author { + ...authorDetails + ...moreAuthorDetails + } + } + `; + const expectedDoc = gql` + query { + author { + ...authorDetails + ...moreAuthorDetails + } + } + `; + const expectedResult: OperationDefinitionNode = expectedDoc + .definitions[0] as OperationDefinitionNode; + const actualResult = getQueryDefinition(queryWithFragments); + + expect(print(actualResult)).toEqual(print(expectedResult)); + }); + + it('should throw if we try to get the query definition of a document with no query', () => { + const mutationWithFragments = gql` + fragment authorDetails on Author { + firstName + lastName + } + + mutation { + createAuthor(firstName: "John", lastName: "Smith") { + ...authorDetails + } + } + `; + expect(() => { + getQueryDefinition(mutationWithFragments); + }).toThrow(); + }); + + it('should get the correct mutation definition out of a mutation with multiple fragments', () => { + const mutationWithFragments = gql` + mutation { + createAuthor(firstName: "John", lastName: "Smith") { + ...authorDetails + } + } + + fragment authorDetails on Author { + firstName + lastName + } + `; + const expectedDoc = gql` + mutation { + createAuthor(firstName: "John", lastName: "Smith") { + ...authorDetails + } + } + `; + const expectedResult: OperationDefinitionNode = expectedDoc + .definitions[0] as OperationDefinitionNode; + const actualResult = getMutationDefinition(mutationWithFragments); + expect(print(actualResult)).toEqual(print(expectedResult)); + }); + + it('should create the fragment map correctly', () => { + const fragments = getFragmentDefinitions(gql` + fragment authorDetails on Author { + firstName + lastName + } + + fragment moreAuthorDetails on Author { + address + } + `); + const fragmentMap = createFragmentMap(fragments); + const expectedTable: FragmentMap = { + authorDetails: fragments[0], + moreAuthorDetails: fragments[1], + }; + expect(fragmentMap).toEqual(expectedTable); + }); + + it('should return an empty fragment map if passed undefined argument', () => { + expect(createFragmentMap(undefined)).toEqual({}); + }); + + it('should get the operation name out of a query', () => { + const query = gql` + query nameOfQuery { + fortuneCookie + } + `; + const operationName = getOperationName(query); + expect(operationName).toEqual('nameOfQuery'); + }); + + it('should get the operation name out of a mutation', () => { + const query = gql` + mutation nameOfMutation { + fortuneCookie + } + `; + const operationName = getOperationName(query); + expect(operationName).toEqual('nameOfMutation'); + }); + + it('should return null if the query does not have an operation name', () => { + const query = gql` + { + fortuneCookie + } + `; + const operationName = getOperationName(query); + expect(operationName).toEqual(null); + }); + + it('should throw if type definitions found in document', () => { + const queryWithTypeDefination = gql` + fragment authorDetails on Author { + firstName + lastName + } + + query($search: AuthorSearchInputType) { + author(search: $search) { + ...authorDetails + } + } + + input AuthorSearchInputType { + firstName: String + } + `; + expect(() => { + getQueryDefinition(queryWithTypeDefination); + }).toThrowError( + 'Schema type definitions not allowed in queries. Found: "InputObjectTypeDefinition"', + ); + }); + + describe('getDefaultValues', () => { + it('will create an empty variable object if no default values are provided', () => { + const basicQuery = gql` + query people($first: Int, $second: String) { + allPeople(first: $first) { + people { + name + } + } + } + `; + + expect(getDefaultValues(getQueryDefinition(basicQuery))).toEqual({}); + }); + + it('will create a variable object based on the definition node with default values', () => { + const basicQuery = gql` + query people($first: Int = 1, $second: String!) { + allPeople(first: $first) { + people { + name + } + } + } + `; + + const complexMutation = gql` + mutation complexStuff( + $test: Input = { key1: ["value", "value2"], key2: { key3: 4 } } + ) { + complexStuff(test: $test) { + people { + name + } + } + } + `; + + expect(getDefaultValues(getQueryDefinition(basicQuery))).toEqual({ + first: 1, + }); + expect(getDefaultValues(getMutationDefinition(complexMutation))).toEqual({ + test: { key1: ['value', 'value2'], key2: { key3: 4 } }, + }); + }); + }); +}); diff --git a/node_modules/apollo-utilities/src/__tests__/storeUtils.ts b/node_modules/apollo-utilities/src/__tests__/storeUtils.ts new file mode 100644 index 000000000..ba459432c --- /dev/null +++ b/node_modules/apollo-utilities/src/__tests__/storeUtils.ts @@ -0,0 +1,23 @@ +import { getStoreKeyName } from '../storeUtils'; + +describe('getStoreKeyName', () => { + it( + 'should return a deterministic version of the store key name no matter ' + + 'which order the args object properties are in', + () => { + const validStoreKeyName = + 'someField({"prop1":"value1","prop2":"value2"})'; + let generatedStoreKeyName = getStoreKeyName('someField', { + prop1: 'value1', + prop2: 'value2', + }); + expect(generatedStoreKeyName).toEqual(validStoreKeyName); + + generatedStoreKeyName = getStoreKeyName('someField', { + prop2: 'value2', + prop1: 'value1', + }); + expect(generatedStoreKeyName).toEqual(validStoreKeyName); + }, + ); +}); diff --git a/node_modules/apollo-utilities/src/__tests__/transform.ts b/node_modules/apollo-utilities/src/__tests__/transform.ts new file mode 100644 index 000000000..26835f4cc --- /dev/null +++ b/node_modules/apollo-utilities/src/__tests__/transform.ts @@ -0,0 +1,1242 @@ +import { print } from 'graphql/language/printer'; +import gql from 'graphql-tag'; +import { disableFragmentWarnings } from 'graphql-tag'; + +// Turn off warnings for repeated fragment names +disableFragmentWarnings(); + +import { + addTypenameToDocument, + removeDirectivesFromDocument, + getDirectivesFromDocument, + removeConnectionDirectiveFromDocument, + removeArgumentsFromDocument, + removeFragmentSpreadFromDocument, + removeClientSetsFromDocument, +} from '../transform'; +import { getQueryDefinition } from '../getFromAST'; + +describe('removeArgumentsFromDocument', () => { + it('should remove a single variable', () => { + const query = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) { + child + foo + } + network + } + `; + const expected = gql` + query Simple { + field { + child + foo + } + network + } + `; + const doc = removeArgumentsFromDocument([{ name: 'variable' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove a single variable and the field from the query', () => { + const query = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) { + child + foo + } + network + } + `; + const expected = gql` + query Simple { + network + } + `; + const doc = removeArgumentsFromDocument( + [{ name: 'variable', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); +}); +describe('removeFragmentSpreadFromDocument', () => { + it('should remove a named fragment spread', () => { + const query = gql` + query Simple { + ...FragmentSpread + property + ...ValidSpread + } + + fragment FragmentSpread on Thing { + foo + bar + baz + } + + fragment ValidSpread on Thing { + oof + rab + zab + } + `; + const expected = gql` + query Simple { + property + ...ValidSpread + } + + fragment ValidSpread on Thing { + oof + rab + zab + } + `; + const doc = removeFragmentSpreadFromDocument( + [{ name: 'FragmentSpread', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); +}); +describe('removeDirectivesFromDocument', () => { + it('should not remove unused variable definitions unless the field is removed', () => { + const query = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) @client + networkField + } + `; + + const expected = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) + networkField + } + `; + + const doc = removeDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove unused variable definitions associated with the removed directive', () => { + const query = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) @client + networkField + } + `; + + const expected = gql` + query Simple { + networkField + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'client', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should not remove used variable definitions', () => { + const query = gql` + query Simple($variable: String!) { + field(usingVariable: $variable) @client + networkField(usingVariable: $variable) + } + `; + + const expected = gql` + query Simple($variable: String!) { + networkField(usingVariable: $variable) + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'client', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove fragment spreads and definitions associated with the removed directive', () => { + const query = gql` + query Simple { + networkField + field @client { + ...ClientFragment + } + } + + fragment ClientFragment on Thing { + otherField + bar + } + `; + + const expected = gql` + query Simple { + networkField + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'client', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should not remove fragment spreads and definitions used without the removed directive', () => { + const query = gql` + query Simple { + networkField { + ...ClientFragment + } + field @client { + ...ClientFragment + } + } + + fragment ClientFragment on Thing { + otherField + bar + } + `; + + const expected = gql` + query Simple { + networkField { + ...ClientFragment + } + } + + fragment ClientFragment on Thing { + otherField + bar + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'client', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove a simple directive', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + field + } + `; + const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove a simple directive [test function]', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + field + } + `; + const test = ({ name: { value } }: { name: any }) => value === 'storage'; + const doc = removeDirectivesFromDocument([{ test }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove only the wanted directive', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + maybe @skip(if: false) + field + } + `; + const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove only the wanted directive [test function]', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + maybe @skip(if: false) + field + } + `; + const test = ({ name: { value } }: { name: any }) => value === 'storage'; + const doc = removeDirectivesFromDocument([{ test }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove multiple directives in the query', () => { + const query = gql` + query Simple { + field @storage(if: true) + other: field @storage + } + `; + + const expected = gql` + query Simple { + field + other: field + } + `; + const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove multiple directives of different kinds in the query', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + other: field @client + } + `; + + const expected = gql` + query Simple { + maybe @skip(if: false) + field + other: field + } + `; + const removed = [ + { name: 'storage' }, + { + test: (directive: any) => directive.name.value === 'client', + }, + ]; + const doc = removeDirectivesFromDocument(removed, query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove a simple directive and its field if needed', () => { + const query = gql` + query Simple { + field @storage(if: true) + keep + } + `; + + const expected = gql` + query Simple { + keep + } + `; + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove a simple directive [test function]', () => { + const query = gql` + query Simple { + field @storage(if: true) + keep + } + `; + + const expected = gql` + query Simple { + keep + } + `; + const test = ({ name: { value } }: { name: any }) => value === 'storage'; + const doc = removeDirectivesFromDocument([{ test, remove: true }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should return null if the query is no longer valid', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + + expect(doc).toBe(null); + }); + + it('should return null if the query is no longer valid [test function]', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const test = ({ name: { value } }: { name: any }) => value === 'storage'; + const doc = removeDirectivesFromDocument([{ test, remove: true }], query); + expect(doc).toBe(null); + }); + + it('should return null only if the query is not valid', () => { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + + expect(print(doc)).toBe(print(query)); + }); + + it('should return null only if the query is not valid through nested fragments', () => { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + ...inDirection + } + + fragment inDirection on Thing { + field @storage + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + + expect(doc).toBe(null); + }); + + it('should only remove values asked through nested fragments', () => { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + ...inDirection + } + + fragment inDirection on Thing { + field @storage + bar + } + `; + + const expectedQuery = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + ...inDirection + } + + fragment inDirection on Thing { + bar + } + `; + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + + expect(print(doc)).toBe(print(expectedQuery)); + }); + + it('should return null even through fragments if needed', () => { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field @storage + } + `; + + const doc = removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + query, + ); + + expect(doc).toBe(null); + }); + + it('should not throw in combination with addTypenameToDocument', () => { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + ...inDirection + } + + fragment inDirection on Thing { + field @storage + } + `; + + expect(() => { + removeDirectivesFromDocument( + [{ name: 'storage', remove: true }], + addTypenameToDocument(query), + ); + }).not.toThrow(); + }); +}); + +describe('query transforms', () => { + it('should correctly add typenames', () => { + let testQuery = gql` + query { + author { + name { + firstName + lastName + } + } + } + `; + const newQueryDoc = addTypenameToDocument(testQuery); + + const expectedQuery = gql` + query { + author { + name { + firstName + lastName + __typename + } + __typename + } + } + `; + const expectedQueryStr = print(expectedQuery); + + expect(print(newQueryDoc)).toBe(expectedQueryStr); + }); + + it('should not add duplicates', () => { + let testQuery = gql` + query { + author { + name { + firstName + lastName + __typename + } + } + } + `; + const newQueryDoc = addTypenameToDocument(testQuery); + + const expectedQuery = gql` + query { + author { + name { + firstName + lastName + __typename + } + __typename + } + } + `; + const expectedQueryStr = print(expectedQuery); + + expect(print(newQueryDoc)).toBe(expectedQueryStr); + }); + + it('should not screw up on a FragmentSpread within the query AST', () => { + const testQuery = gql` + query withFragments { + user(id: 4) { + friends(first: 10) { + ...friendFields + } + } + } + `; + const expectedQuery = getQueryDefinition(gql` + query withFragments { + user(id: 4) { + friends(first: 10) { + ...friendFields + __typename + } + __typename + } + } + `); + const modifiedQuery = addTypenameToDocument(testQuery); + expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); + }); + + it('should modify all definitions in a document', () => { + const testQuery = gql` + query withFragments { + user(id: 4) { + friends(first: 10) { + ...friendFields + } + } + } + + fragment friendFields on User { + firstName + lastName + } + `; + + const newQueryDoc = addTypenameToDocument(testQuery); + + const expectedQuery = gql` + query withFragments { + user(id: 4) { + friends(first: 10) { + ...friendFields + __typename + } + __typename + } + } + + fragment friendFields on User { + firstName + lastName + __typename + } + `; + + expect(print(expectedQuery)).toBe(print(newQueryDoc)); + }); + + it('should be able to apply a QueryTransformer correctly', () => { + const testQuery = gql` + query { + author { + firstName + lastName + } + } + `; + + const expectedQuery = getQueryDefinition(gql` + query { + author { + firstName + lastName + __typename + } + } + `); + + const modifiedQuery = addTypenameToDocument(testQuery); + expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); + }); + + it('should be able to apply a MutationTransformer correctly', () => { + const testQuery = gql` + mutation { + createAuthor(firstName: "John", lastName: "Smith") { + firstName + lastName + } + } + `; + const expectedQuery = gql` + mutation { + createAuthor(firstName: "John", lastName: "Smith") { + firstName + lastName + __typename + } + } + `; + + const modifiedQuery = addTypenameToDocument(testQuery); + expect(print(expectedQuery)).toBe(print(modifiedQuery)); + }); + + it('should add typename fields correctly on this one query', () => { + const testQuery = gql` + query Feed($type: FeedType!) { + # Eventually move this into a no fetch query right on the entry + # since we literally just need this info to determine whether to + # show upvote/downvote buttons + currentUser { + login + } + feed(type: $type) { + createdAt + score + commentCount + id + postedBy { + login + html_url + } + repository { + name + full_name + description + html_url + stargazers_count + open_issues_count + created_at + owner { + avatar_url + } + } + } + } + `; + const expectedQuery = getQueryDefinition(gql` + query Feed($type: FeedType!) { + currentUser { + login + __typename + } + feed(type: $type) { + createdAt + score + commentCount + id + postedBy { + login + html_url + __typename + } + repository { + name + full_name + description + html_url + stargazers_count + open_issues_count + created_at + owner { + avatar_url + __typename + } + __typename + } + __typename + } + } + `); + const modifiedQuery = addTypenameToDocument(testQuery); + expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); + }); + + it('should correctly remove connections', () => { + let testQuery = gql` + query { + author { + name @connection(key: "foo") { + firstName + lastName + } + } + } + `; + const newQueryDoc = removeConnectionDirectiveFromDocument(testQuery); + + const expectedQuery = gql` + query { + author { + name { + firstName + lastName + } + } + } + `; + const expectedQueryStr = print(expectedQuery); + + expect(expectedQueryStr).toBe(print(newQueryDoc)); + }); +}); + +describe('getDirectivesFromDocument', () => { + it('should get query with fields of storage directive ', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + } + `; + const doc = getDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with fields of storage directive [test function] ', () => { + const query = gql` + query Simple { + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + } + `; + const test = ({ name: { value } }: { name: any }) => value === 'storage'; + const doc = getDirectivesFromDocument([{ test }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should only get query with fields of storage directive ', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + } + `; + const doc = getDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should only get query with multiple fields of storage directive ', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + other @storage + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + other @storage + } + `; + const doc = getDirectivesFromDocument([{ name: 'storage' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with fields of both storage and client directives ', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + user @client + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + user @client + } + `; + const doc = getDirectivesFromDocument( + [{ name: 'storage' }, { name: 'client' }], + query, + ); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with different types of directive matchers ', () => { + const query = gql` + query Simple { + maybe @skip(if: false) + field @storage(if: true) + user @client + } + `; + + const expected = gql` + query Simple { + field @storage(if: true) + user @client + } + `; + const doc = getDirectivesFromDocument( + [ + { name: 'storage' }, + { test: directive => directive.name.value === 'client' }, + ], + query, + ); + + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with nested fields ', () => { + const query = gql` + query Simple { + user { + firstName @client + email + } + } + `; + + const expected = gql` + query Simple { + user { + firstName @client + } + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should include all the nested fields of field that has client directive ', () => { + const query = gql` + query Simple { + user @client { + firstName + email + } + } + `; + + const expected = gql` + query Simple { + user @client { + firstName + email + } + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should return null if the query is no longer valid', () => { + const query = gql` + query Simple { + field + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(null); + }); + + it('should get query with client fields in fragment', function() { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + other + } + `; + const expected = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with client fields in fragment with nested fields', function() { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + user { + firstName @client + lastName + } + } + `; + const expected = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + user { + firstName @client + } + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get query with client fields in multiple fragments', function() { + const query = gql` + query Simple { + ...fragmentSpread + ...anotherFragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + other + } + + fragment anotherFragmentSpread on AnotherThing { + user @client + product + } + `; + const expected = gql` + query Simple { + ...fragmentSpread + ...anotherFragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + } + + fragment anotherFragmentSpread on AnotherThing { + user @client + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it("should return null if fragment didn't have client fields", function() { + const query = gql` + query Simple { + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(null)); + }); + + it('should get query with client fields when both fields and fragements are mixed', function() { + const query = gql` + query Simple { + user @client + product @storage + order + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + other + } + `; + const expected = gql` + query Simple { + user @client + ...fragmentSpread + } + + fragment fragmentSpread on Thing { + field @client + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get mutation with client fields', () => { + const query = gql` + mutation { + login @client + } + `; + + const expected = gql` + mutation { + login @client + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should get mutation fields of client only', () => { + const query = gql` + mutation { + login @client + updateUser + } + `; + + const expected = gql` + mutation { + login @client + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query); + expect(print(doc)).toBe(print(expected)); + }); + + describe('includeAllFragments', () => { + it('= false: should remove the values without a client in fragment', () => { + const query = gql` + fragment client on ClientData { + hi @client + bye @storage + bar + } + + query Mixed { + foo @client { + ...client + } + bar { + baz + } + } + `; + + const expected = gql` + fragment client on ClientData { + hi @client + } + + query Mixed { + foo @client { + ...client + } + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query, false); + expect(print(doc)).toBe(print(expected)); + }); + + it('= true: should include the values without a client in fragment', () => { + const query = gql` + fragment client on ClientData { + hi @client + bye @storage + bar + } + + query Mixed { + foo @client { + ...client + } + bar { + baz + } + } + `; + + const expected = gql` + fragment client on ClientData { + hi @client + } + + query Mixed { + foo @client { + ...client + } + } + `; + const doc = getDirectivesFromDocument([{ name: 'client' }], query, true); + expect(print(doc)).toBe(print(expected)); + }); + }); +}); + +describe('removeClientSetsFromDocument', () => { + it('should remove @client fields from document', () => { + const query = gql` + query Author { + name + isLoggedIn @client + } + `; + + const expected = gql` + query Author { + name + } + `; + const doc = removeClientSetsFromDocument(query); + expect(print(doc)).toBe(print(expected)); + }); + + it('should remove @client fields from fragments', () => { + const query = gql` + fragment authorInfo on Author { + name + isLoggedIn @client + } + `; + + const expected = gql` + fragment authorInfo on Author { + name + } + `; + const doc = removeClientSetsFromDocument(query); + expect(print(doc)).toBe(print(expected)); + }); +}); diff --git a/node_modules/apollo-utilities/src/declarations.d.ts b/node_modules/apollo-utilities/src/declarations.d.ts new file mode 100644 index 000000000..695466556 --- /dev/null +++ b/node_modules/apollo-utilities/src/declarations.d.ts @@ -0,0 +1 @@ +declare module 'fast-json-stable-stringify'; diff --git a/node_modules/apollo-utilities/src/directives.ts b/node_modules/apollo-utilities/src/directives.ts new file mode 100644 index 000000000..84c14abae --- /dev/null +++ b/node_modules/apollo-utilities/src/directives.ts @@ -0,0 +1,127 @@ +// Provides the methods that allow QueryManager to handle the `skip` and +// `include` directives within GraphQL. +import { + FieldNode, + SelectionNode, + VariableNode, + BooleanValueNode, + DirectiveNode, + DocumentNode, + ArgumentNode, + ValueNode, +} from 'graphql'; + +import { visit } from 'graphql/language/visitor'; + +import { invariant } from 'ts-invariant'; + +import { argumentsObjectFromField } from './storeUtils'; + +export type DirectiveInfo = { + [fieldName: string]: { [argName: string]: any }; +}; + +export function getDirectiveInfoFromField( + field: FieldNode, + variables: Object, +): DirectiveInfo { + if (field.directives && field.directives.length) { + const directiveObj: DirectiveInfo = {}; + field.directives.forEach((directive: DirectiveNode) => { + directiveObj[directive.name.value] = argumentsObjectFromField( + directive, + variables, + ); + }); + return directiveObj; + } + return null; +} + +export function shouldInclude( + selection: SelectionNode, + variables: { [name: string]: any } = {}, +): boolean { + return getInclusionDirectives( + selection.directives, + ).every(({ directive, ifArgument }) => { + let evaledValue: boolean = false; + if (ifArgument.value.kind === 'Variable') { + evaledValue = variables[(ifArgument.value as VariableNode).name.value]; + invariant( + evaledValue !== void 0, + `Invalid variable referenced in @${directive.name.value} directive.`, + ); + } else { + evaledValue = (ifArgument.value as BooleanValueNode).value; + } + return directive.name.value === 'skip' ? !evaledValue : evaledValue; + }); +} + +export function getDirectiveNames(doc: DocumentNode) { + const names: string[] = []; + + visit(doc, { + Directive(node) { + names.push(node.name.value); + }, + }); + + return names; +} + +export function hasDirectives(names: string[], doc: DocumentNode) { + return getDirectiveNames(doc).some( + (name: string) => names.indexOf(name) > -1, + ); +} + +export function hasClientExports(document: DocumentNode) { + return ( + document && + hasDirectives(['client'], document) && + hasDirectives(['export'], document) + ); +} + +export type InclusionDirectives = Array<{ + directive: DirectiveNode; + ifArgument: ArgumentNode; +}>; + +function isInclusionDirective({ name: { value } }: DirectiveNode): boolean { + return value === 'skip' || value === 'include'; +} + +export function getInclusionDirectives( + directives: ReadonlyArray, +): InclusionDirectives { + return directives ? directives.filter(isInclusionDirective).map(directive => { + const directiveArguments = directive.arguments; + const directiveName = directive.name.value; + + invariant( + directiveArguments && directiveArguments.length === 1, + `Incorrect number of arguments for the @${directiveName} directive.`, + ); + + const ifArgument = directiveArguments[0]; + invariant( + ifArgument.name && ifArgument.name.value === 'if', + `Invalid argument for the @${directiveName} directive.`, + ); + + const ifValue: ValueNode = ifArgument.value; + + // means it has to be a variable value if this is a valid @skip or @include directive + invariant( + ifValue && + (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), + `Argument for the @${directiveName} directive must be a variable or a boolean value.`, + ); + + return { directive, ifArgument }; + }) : []; +} + diff --git a/node_modules/apollo-utilities/src/fragments.ts b/node_modules/apollo-utilities/src/fragments.ts new file mode 100644 index 000000000..f60c86a63 --- /dev/null +++ b/node_modules/apollo-utilities/src/fragments.ts @@ -0,0 +1,92 @@ +import { DocumentNode, FragmentDefinitionNode } from 'graphql'; +import { invariant, InvariantError } from 'ts-invariant'; + +/** + * Returns a query document which adds a single query operation that only + * spreads the target fragment inside of it. + * + * So for example a document of: + * + * ```graphql + * fragment foo on Foo { a b c } + * ``` + * + * Turns into: + * + * ```graphql + * { ...foo } + * + * fragment foo on Foo { a b c } + * ``` + * + * The target fragment will either be the only fragment in the document, or a + * fragment specified by the provided `fragmentName`. If there is more than one + * fragment, but a `fragmentName` was not defined then an error will be thrown. + */ +export function getFragmentQueryDocument( + document: DocumentNode, + fragmentName?: string, +): DocumentNode { + let actualFragmentName = fragmentName; + + // Build an array of all our fragment definitions that will be used for + // validations. We also do some validations on the other definitions in the + // document while building this list. + const fragments: Array = []; + document.definitions.forEach(definition => { + // Throw an error if we encounter an operation definition because we will + // define our own operation definition later on. + if (definition.kind === 'OperationDefinition') { + throw new InvariantError( + `Found a ${definition.operation} operation${ + definition.name ? ` named '${definition.name.value}'` : '' + }. ` + + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.', + ); + } + // Add our definition to the fragments array if it is a fragment + // definition. + if (definition.kind === 'FragmentDefinition') { + fragments.push(definition); + } + }); + + // If the user did not give us a fragment name then let us try to get a + // name from a single fragment in the definition. + if (typeof actualFragmentName === 'undefined') { + invariant( + fragments.length === 1, + `Found ${ + fragments.length + } fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`, + ); + actualFragmentName = fragments[0].name.value; + } + + // Generate a query document with an operation that simply spreads the + // fragment inside of it. + const query: DocumentNode = { + ...document, + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'FragmentSpread', + name: { + kind: 'Name', + value: actualFragmentName, + }, + }, + ], + }, + }, + ...document.definitions, + ], + }; + + return query; +} diff --git a/node_modules/apollo-utilities/src/getFromAST.ts b/node_modules/apollo-utilities/src/getFromAST.ts new file mode 100644 index 000000000..febe52604 --- /dev/null +++ b/node_modules/apollo-utilities/src/getFromAST.ts @@ -0,0 +1,233 @@ +import { + DocumentNode, + OperationDefinitionNode, + FragmentDefinitionNode, + ValueNode, +} from 'graphql'; + +import { invariant, InvariantError } from 'ts-invariant'; + +import { assign } from './util/assign'; + +import { valueToObjectRepresentation, JsonValue } from './storeUtils'; + +export function getMutationDefinition( + doc: DocumentNode, +): OperationDefinitionNode { + checkDocument(doc); + + let mutationDef: OperationDefinitionNode | null = doc.definitions.filter( + definition => + definition.kind === 'OperationDefinition' && + definition.operation === 'mutation', + )[0] as OperationDefinitionNode; + + invariant(mutationDef, 'Must contain a mutation definition.'); + + return mutationDef; +} + +// Checks the document for errors and throws an exception if there is an error. +export function checkDocument(doc: DocumentNode) { + invariant( + doc && doc.kind === 'Document', + `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \ +string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`, + ); + + const operations = doc.definitions + .filter(d => d.kind !== 'FragmentDefinition') + .map(definition => { + if (definition.kind !== 'OperationDefinition') { + throw new InvariantError( + `Schema type definitions not allowed in queries. Found: "${ + definition.kind + }"`, + ); + } + return definition; + }); + + invariant( + operations.length <= 1, + `Ambiguous GraphQL document: contains ${operations.length} operations`, + ); + + return doc; +} + +export function getOperationDefinition( + doc: DocumentNode, +): OperationDefinitionNode | undefined { + checkDocument(doc); + return doc.definitions.filter( + definition => definition.kind === 'OperationDefinition', + )[0] as OperationDefinitionNode; +} + +export function getOperationDefinitionOrDie( + document: DocumentNode, +): OperationDefinitionNode { + const def = getOperationDefinition(document); + invariant(def, `GraphQL document is missing an operation`); + return def; +} + +export function getOperationName(doc: DocumentNode): string | null { + return ( + doc.definitions + .filter( + definition => + definition.kind === 'OperationDefinition' && definition.name, + ) + .map((x: OperationDefinitionNode) => x.name.value)[0] || null + ); +} + +// Returns the FragmentDefinitions from a particular document as an array +export function getFragmentDefinitions( + doc: DocumentNode, +): FragmentDefinitionNode[] { + return doc.definitions.filter( + definition => definition.kind === 'FragmentDefinition', + ) as FragmentDefinitionNode[]; +} + +export function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode { + const queryDef = getOperationDefinition(doc) as OperationDefinitionNode; + + invariant( + queryDef && queryDef.operation === 'query', + 'Must contain a query definition.', + ); + + return queryDef; +} + +export function getFragmentDefinition( + doc: DocumentNode, +): FragmentDefinitionNode { + invariant( + doc.kind === 'Document', + `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \ +string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`, + ); + + invariant( + doc.definitions.length <= 1, + 'Fragment must have exactly one definition.', + ); + + const fragmentDef = doc.definitions[0] as FragmentDefinitionNode; + + invariant( + fragmentDef.kind === 'FragmentDefinition', + 'Must be a fragment definition.', + ); + + return fragmentDef as FragmentDefinitionNode; +} + +/** + * Returns the first operation definition found in this document. + * If no operation definition is found, the first fragment definition will be returned. + * If no definitions are found, an error will be thrown. + */ +export function getMainDefinition( + queryDoc: DocumentNode, +): OperationDefinitionNode | FragmentDefinitionNode { + checkDocument(queryDoc); + + let fragmentDefinition; + + for (let definition of queryDoc.definitions) { + if (definition.kind === 'OperationDefinition') { + const operation = (definition as OperationDefinitionNode).operation; + if ( + operation === 'query' || + operation === 'mutation' || + operation === 'subscription' + ) { + return definition as OperationDefinitionNode; + } + } + if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { + // we do this because we want to allow multiple fragment definitions + // to precede an operation definition. + fragmentDefinition = definition as FragmentDefinitionNode; + } + } + + if (fragmentDefinition) { + return fragmentDefinition; + } + + throw new InvariantError( + 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.', + ); +} + +/** + * This is an interface that describes a map from fragment names to fragment definitions. + */ +export interface FragmentMap { + [fragmentName: string]: FragmentDefinitionNode; +} + +// Utility function that takes a list of fragment definitions and makes a hash out of them +// that maps the name of the fragment to the fragment definition. +export function createFragmentMap( + fragments: FragmentDefinitionNode[] = [], +): FragmentMap { + const symTable: FragmentMap = {}; + fragments.forEach(fragment => { + symTable[fragment.name.value] = fragment; + }); + + return symTable; +} + +export function getDefaultValues( + definition: OperationDefinitionNode | undefined, +): { [key: string]: JsonValue } { + if ( + definition && + definition.variableDefinitions && + definition.variableDefinitions.length + ) { + const defaultValues = definition.variableDefinitions + .filter(({ defaultValue }) => defaultValue) + .map( + ({ variable, defaultValue }): { [key: string]: JsonValue } => { + const defaultValueObj: { [key: string]: JsonValue } = {}; + valueToObjectRepresentation( + defaultValueObj, + variable.name, + defaultValue as ValueNode, + ); + + return defaultValueObj; + }, + ); + + return assign({}, ...defaultValues); + } + + return {}; +} + +/** + * Returns the names of all variables declared by the operation. + */ +export function variablesInOperation( + operation: OperationDefinitionNode, +): Set { + const names = new Set(); + if (operation.variableDefinitions) { + for (const definition of operation.variableDefinitions) { + names.add(definition.variable.name.value); + } + } + + return names; +} diff --git a/node_modules/apollo-utilities/src/index.js.flow b/node_modules/apollo-utilities/src/index.js.flow new file mode 100644 index 000000000..a7fc594dc --- /dev/null +++ b/node_modules/apollo-utilities/src/index.js.flow @@ -0,0 +1,220 @@ +// @flow +import type { + DirectiveNode, + StringValueNode, + BooleanValueNode, + IntValueNode, + FloatValueNode, + EnumValueNode, + VariableNode, + FieldNode, + FragmentDefinitionNode, + OperationDefinitionNode, + SelectionNode, + DocumentNode, + DefinitionNode, + ValueNode, + NameNode, +} from 'graphql'; + +declare module 'apollo-utilities' { + // storeUtils + declare export interface IdValue { + type: 'id'; + id: string; + generated: boolean; + typename: string | void; + } + + declare export interface JsonValue { + type: 'json'; + json: any; + } + + declare export type ListValue = Array; + + declare export type StoreValue = + | number + | string + | Array + | IdValue + | ListValue + | JsonValue + | null + | void + | Object; + + declare export type ScalarValue = + | StringValueNode + | BooleanValueNode + | EnumValueNode; + + declare export type NumberValue = IntValueNode | FloatValueNode; + + declare type isValueFn = (value: ValueNode) => boolean; + + declare export type isScalarValue = isValueFn; + declare export type isNumberValue = isValueFn; + declare export type isStringValue = isValueFn; + declare export type isBooleanValue = isValueFn; + declare export type isIntValue = isValueFn; + declare export type isFloatValue = isValueFn; + declare export type isVariable = isValueFn; + declare export type isObjectValue = isValueFn; + declare export type isListValue = isValueFn; + declare export type isEnumValue = isValueFn; + + declare export function valueToObjectRepresentation( + argObj: any, + name: NameNode, + value: ValueNode, + variables?: Object, + ): any; + + declare export function storeKeyNameFromField( + field: FieldNode, + variables?: Object, + ): string; + + declare export type Directives = { + [directiveName: string]: { + [argName: string]: any, + }, + }; + + declare export function getStoreKeyName( + fieldName: string, + args?: Object, + directives?: Directives, + ): string; + + declare export function argumentsObjectFromField( + field: FieldNode | DirectiveNode, + variables: Object, + ): ?Object; + + declare export function resultKeyNameFromField(field: FieldNode): string; + + declare export function isField(selection: SelectionNode): boolean; + + declare export function isInlineFragment(selection: SelectionNode): boolean; + + declare export function isIdValue(idObject: StoreValue): boolean; + + declare export type IdConfig = { + id: string, + typename: string | void, + }; + + declare export function toIdValue( + id: string | IdConfig, + generated?: boolean, + ): IdValue; + + declare export function isJsonValue(jsonObject: StoreValue): boolean; + + declare export type VariableValue = (node: VariableNode) => any; + + declare export function valueFromNode( + node: ValueNode, + onVariable: VariableValue, + ): any; + + // getFromAST + declare export function getMutationDefinition( + doc: DocumentNode, + ): OperationDefinitionNode; + + declare export function checkDocument(doc: DocumentNode): void; + + declare export function getOperationDefinition( + doc: DocumentNode, + ): ?OperationDefinitionNode; + + declare export function getOperationDefinitionOrDie( + document: DocumentNode, + ): OperationDefinitionNode; + + declare export function getOperationName(doc: DocumentNode): ?string; + + declare export function getFragmentDefinitions( + doc: DocumentNode, + ): Array; + + declare export function getQueryDefinition( + doc: DocumentNode, + ): OperationDefinitionNode; + + declare export function getFragmentDefinition( + doc: DocumentNode, + ): FragmentDefinitionNode; + + declare export function getMainDefinition( + queryDoc: DocumentNode, + ): OperationDefinitionNode | FragmentDefinitionNode; + + declare export interface FragmentMap { + [fragmentName: string]: FragmentDefinitionNode; + } + + declare export function createFragmentMap( + fragments: Array, + ): FragmentMap; + + declare export function getDefaultValues( + definition: ?OperationDefinitionNode, + ): { [key: string]: JsonValue }; + + // fragments + declare export function getFragmentQueryDocument( + document: DocumentNode, + fragmentName?: string, + ): DocumentNode; + + declare export function variablesInOperation( + operation: OperationDefinitionNode, + ): Set; + + // directives + declare type DirectiveInfo = { + [fieldName: string]: { [argName: string]: any }, + }; + + declare export function getDirectiveInfoFromField( + field: FieldNode, + object: Object, + ): ?DirectiveInfo; + + declare export function shouldInclude( + selection: SelectionNode, + variables: { [name: string]: any }, + ): boolean; + + declare export function flattenSelections( + selection: SelectionNode, + ): Array; + + declare export function getDirectiveNames(doc: DocumentNode): Array; + + declare export function hasDirectives( + names: Array, + doc: DocumentNode, + ): boolean; + + // transform + declare export type RemoveDirectiveConfig = { + name?: string, + test?: (directive: DirectiveNode) => boolean, + }; + + declare export function removeDirectivesFromDocument( + directives: Array, + doc: DocumentNode, + ): DocumentNode; + + declare export function addTypenameToDocument(doc: DocumentNode): void; + + declare export function removeConnectionDirectiveFromDocument( + doc: DocumentNode, + ): DocumentNode; +} diff --git a/node_modules/apollo-utilities/src/index.ts b/node_modules/apollo-utilities/src/index.ts new file mode 100644 index 000000000..18b0a8150 --- /dev/null +++ b/node_modules/apollo-utilities/src/index.ts @@ -0,0 +1,16 @@ +export * from './directives'; +export * from './fragments'; +export * from './getFromAST'; +export * from './transform'; +export * from './storeUtils'; +export * from './util/assign'; +export * from './util/canUse'; +export * from './util/cloneDeep'; +export * from './util/environment'; +export * from './util/errorHandling'; +export * from './util/isEqual'; +export * from './util/maybeDeepFreeze'; +export * from './util/mergeDeep'; +export * from './util/warnOnce'; +export * from './util/stripSymbols'; +export * from './util/mergeDeep'; diff --git a/node_modules/apollo-utilities/src/storeUtils.ts b/node_modules/apollo-utilities/src/storeUtils.ts new file mode 100644 index 000000000..2bd1e53a6 --- /dev/null +++ b/node_modules/apollo-utilities/src/storeUtils.ts @@ -0,0 +1,340 @@ +import { + DirectiveNode, + FieldNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + ObjectValueNode, + ListValueNode, + EnumValueNode, + NullValueNode, + VariableNode, + InlineFragmentNode, + ValueNode, + SelectionNode, + NameNode, +} from 'graphql'; + +import stringify from 'fast-json-stable-stringify'; +import { InvariantError } from 'ts-invariant'; + +export interface IdValue { + type: 'id'; + id: string; + generated: boolean; + typename: string | undefined; +} + +export interface JsonValue { + type: 'json'; + json: any; +} + +export type ListValue = Array; + +export type StoreValue = + | number + | string + | string[] + | IdValue + | ListValue + | JsonValue + | null + | undefined + | void + | Object; + +export type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode; + +export function isScalarValue(value: ValueNode): value is ScalarValue { + return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; +} + +export type NumberValue = IntValueNode | FloatValueNode; + +export function isNumberValue(value: ValueNode): value is NumberValue { + return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; +} + +function isStringValue(value: ValueNode): value is StringValueNode { + return value.kind === 'StringValue'; +} + +function isBooleanValue(value: ValueNode): value is BooleanValueNode { + return value.kind === 'BooleanValue'; +} + +function isIntValue(value: ValueNode): value is IntValueNode { + return value.kind === 'IntValue'; +} + +function isFloatValue(value: ValueNode): value is FloatValueNode { + return value.kind === 'FloatValue'; +} + +function isVariable(value: ValueNode): value is VariableNode { + return value.kind === 'Variable'; +} + +function isObjectValue(value: ValueNode): value is ObjectValueNode { + return value.kind === 'ObjectValue'; +} + +function isListValue(value: ValueNode): value is ListValueNode { + return value.kind === 'ListValue'; +} + +function isEnumValue(value: ValueNode): value is EnumValueNode { + return value.kind === 'EnumValue'; +} + +function isNullValue(value: ValueNode): value is NullValueNode { + return value.kind === 'NullValue'; +} + +export function valueToObjectRepresentation( + argObj: any, + name: NameNode, + value: ValueNode, + variables?: Object, +) { + if (isIntValue(value) || isFloatValue(value)) { + argObj[name.value] = Number(value.value); + } else if (isBooleanValue(value) || isStringValue(value)) { + argObj[name.value] = value.value; + } else if (isObjectValue(value)) { + const nestedArgObj = {}; + value.fields.map(obj => + valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables), + ); + argObj[name.value] = nestedArgObj; + } else if (isVariable(value)) { + const variableValue = (variables || ({} as any))[value.name.value]; + argObj[name.value] = variableValue; + } else if (isListValue(value)) { + argObj[name.value] = value.values.map(listValue => { + const nestedArgArrayObj = {}; + valueToObjectRepresentation( + nestedArgArrayObj, + name, + listValue, + variables, + ); + return (nestedArgArrayObj as any)[name.value]; + }); + } else if (isEnumValue(value)) { + argObj[name.value] = (value as EnumValueNode).value; + } else if (isNullValue(value)) { + argObj[name.value] = null; + } else { + throw new InvariantError( + `The inline argument "${name.value}" of kind "${(value as any).kind}"` + + 'is not supported. Use variables instead of inline arguments to ' + + 'overcome this limitation.', + ); + } +} + +export function storeKeyNameFromField( + field: FieldNode, + variables?: Object, +): string { + let directivesObj: any = null; + if (field.directives) { + directivesObj = {}; + field.directives.forEach(directive => { + directivesObj[directive.name.value] = {}; + + if (directive.arguments) { + directive.arguments.forEach(({ name, value }) => + valueToObjectRepresentation( + directivesObj[directive.name.value], + name, + value, + variables, + ), + ); + } + }); + } + + let argObj: any = null; + if (field.arguments && field.arguments.length) { + argObj = {}; + field.arguments.forEach(({ name, value }) => + valueToObjectRepresentation(argObj, name, value, variables), + ); + } + + return getStoreKeyName(field.name.value, argObj, directivesObj); +} + +export type Directives = { + [directiveName: string]: { + [argName: string]: any; + }; +}; + +const KNOWN_DIRECTIVES: string[] = [ + 'connection', + 'include', + 'skip', + 'client', + 'rest', + 'export', +]; + +export function getStoreKeyName( + fieldName: string, + args?: Object, + directives?: Directives, +): string { + if ( + directives && + directives['connection'] && + directives['connection']['key'] + ) { + if ( + directives['connection']['filter'] && + (directives['connection']['filter'] as string[]).length > 0 + ) { + const filterKeys = directives['connection']['filter'] + ? (directives['connection']['filter'] as string[]) + : []; + filterKeys.sort(); + + const queryArgs = args as { [key: string]: any }; + const filteredArgs = {} as { [key: string]: any }; + filterKeys.forEach(key => { + filteredArgs[key] = queryArgs[key]; + }); + + return `${directives['connection']['key']}(${JSON.stringify( + filteredArgs, + )})`; + } else { + return directives['connection']['key']; + } + } + + let completeFieldName: string = fieldName; + + if (args) { + // We can't use `JSON.stringify` here since it's non-deterministic, + // and can lead to different store key names being created even though + // the `args` object used during creation has the same properties/values. + const stringifiedArgs: string = stringify(args); + completeFieldName += `(${stringifiedArgs})`; + } + + if (directives) { + Object.keys(directives).forEach(key => { + if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; + if (directives[key] && Object.keys(directives[key]).length) { + completeFieldName += `@${key}(${JSON.stringify(directives[key])})`; + } else { + completeFieldName += `@${key}`; + } + }); + } + + return completeFieldName; +} + +export function argumentsObjectFromField( + field: FieldNode | DirectiveNode, + variables: Object, +): Object { + if (field.arguments && field.arguments.length) { + const argObj: Object = {}; + field.arguments.forEach(({ name, value }) => + valueToObjectRepresentation(argObj, name, value, variables), + ); + return argObj; + } + + return null; +} + +export function resultKeyNameFromField(field: FieldNode): string { + return field.alias ? field.alias.value : field.name.value; +} + +export function isField(selection: SelectionNode): selection is FieldNode { + return selection.kind === 'Field'; +} + +export function isInlineFragment( + selection: SelectionNode, +): selection is InlineFragmentNode { + return selection.kind === 'InlineFragment'; +} + +export function isIdValue(idObject: StoreValue): idObject is IdValue { + return idObject && + (idObject as IdValue | JsonValue).type === 'id' && + typeof (idObject as IdValue).generated === 'boolean'; +} + +export type IdConfig = { + id: string; + typename: string | undefined; +}; + +export function toIdValue( + idConfig: string | IdConfig, + generated = false, +): IdValue { + return { + type: 'id', + generated, + ...(typeof idConfig === 'string' + ? { id: idConfig, typename: undefined } + : idConfig), + }; +} + +export function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue { + return ( + jsonObject != null && + typeof jsonObject === 'object' && + (jsonObject as IdValue | JsonValue).type === 'json' + ); +} + +function defaultValueFromVariable(node: VariableNode) { + throw new InvariantError(`Variable nodes are not supported by valueFromNode`); +} + +export type VariableValue = (node: VariableNode) => any; + +/** + * Evaluate a ValueNode and yield its value in its natural JS form. + */ +export function valueFromNode( + node: ValueNode, + onVariable: VariableValue = defaultValueFromVariable, +): any { + switch (node.kind) { + case 'Variable': + return onVariable(node); + case 'NullValue': + return null; + case 'IntValue': + return parseInt(node.value, 10); + case 'FloatValue': + return parseFloat(node.value); + case 'ListValue': + return node.values.map(v => valueFromNode(v, onVariable)); + case 'ObjectValue': { + const value: { [key: string]: any } = {}; + for (const field of node.fields) { + value[field.name.value] = valueFromNode(field.value, onVariable); + } + return value; + } + default: + return node.value; + } +} diff --git a/node_modules/apollo-utilities/src/transform.ts b/node_modules/apollo-utilities/src/transform.ts new file mode 100644 index 000000000..d77b8e54e --- /dev/null +++ b/node_modules/apollo-utilities/src/transform.ts @@ -0,0 +1,542 @@ +import { + DocumentNode, + SelectionNode, + SelectionSetNode, + OperationDefinitionNode, + FieldNode, + DirectiveNode, + FragmentDefinitionNode, + ArgumentNode, + FragmentSpreadNode, + VariableDefinitionNode, + VariableNode, +} from 'graphql'; +import { visit } from 'graphql/language/visitor'; + +import { + checkDocument, + getOperationDefinition, + getFragmentDefinition, + getFragmentDefinitions, + createFragmentMap, + FragmentMap, + getMainDefinition, +} from './getFromAST'; +import { filterInPlace } from './util/filterInPlace'; +import { invariant } from 'ts-invariant'; +import { isField, isInlineFragment } from './storeUtils'; + +export type RemoveNodeConfig = { + name?: string; + test?: (node: N) => boolean; + remove?: boolean; +}; + +export type GetNodeConfig = { + name?: string; + test?: (node: N) => boolean; +}; + +export type RemoveDirectiveConfig = RemoveNodeConfig; +export type GetDirectiveConfig = GetNodeConfig; +export type RemoveArgumentsConfig = RemoveNodeConfig; +export type GetFragmentSpreadConfig = GetNodeConfig; +export type RemoveFragmentSpreadConfig = RemoveNodeConfig; +export type RemoveFragmentDefinitionConfig = RemoveNodeConfig< + FragmentDefinitionNode +>; +export type RemoveVariableDefinitionConfig = RemoveNodeConfig< + VariableDefinitionNode +>; + +const TYPENAME_FIELD: FieldNode = { + kind: 'Field', + name: { + kind: 'Name', + value: '__typename', + }, +}; + +function isEmpty( + op: OperationDefinitionNode | FragmentDefinitionNode, + fragments: FragmentMap, +): boolean { + return op.selectionSet.selections.every( + selection => + selection.kind === 'FragmentSpread' && + isEmpty(fragments[selection.name.value], fragments), + ); +} + +function nullIfDocIsEmpty(doc: DocumentNode) { + return isEmpty( + getOperationDefinition(doc) || getFragmentDefinition(doc), + createFragmentMap(getFragmentDefinitions(doc)), + ) + ? null + : doc; +} + +function getDirectiveMatcher( + directives: (RemoveDirectiveConfig | GetDirectiveConfig)[], +) { + return function directiveMatcher(directive: DirectiveNode) { + return directives.some( + dir => + (dir.name && dir.name === directive.name.value) || + (dir.test && dir.test(directive)), + ); + }; +} + +export function removeDirectivesFromDocument( + directives: RemoveDirectiveConfig[], + doc: DocumentNode, +): DocumentNode | null { + const variablesInUse: Record = Object.create(null); + let variablesToRemove: RemoveArgumentsConfig[] = []; + + const fragmentSpreadsInUse: Record = Object.create(null); + let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = []; + + let modifiedDoc = nullIfDocIsEmpty( + visit(doc, { + Variable: { + enter(node, _key, parent) { + // Store each variable that's referenced as part of an argument + // (excluding operation definition variables), so we know which + // variables are being used. If we later want to remove a variable + // we'll fist check to see if it's being used, before continuing with + // the removal. + if ( + (parent as VariableDefinitionNode).kind !== 'VariableDefinition' + ) { + variablesInUse[node.name.value] = true; + } + }, + }, + + Field: { + enter(node) { + if (directives && node.directives) { + // If `remove` is set to true for a directive, and a directive match + // is found for a field, remove the field as well. + const shouldRemoveField = directives.some( + directive => directive.remove, + ); + + if ( + shouldRemoveField && + node.directives && + node.directives.some(getDirectiveMatcher(directives)) + ) { + if (node.arguments) { + // Store field argument variables so they can be removed + // from the operation definition. + node.arguments.forEach(arg => { + if (arg.value.kind === 'Variable') { + variablesToRemove.push({ + name: (arg.value as VariableNode).name.value, + }); + } + }); + } + + if (node.selectionSet) { + // Store fragment spread names so they can be removed from the + // docuemnt. + getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach( + frag => { + fragmentSpreadsToRemove.push({ + name: frag.name.value, + }); + }, + ); + } + + // Remove the field. + return null; + } + } + }, + }, + + FragmentSpread: { + enter(node) { + // Keep track of referenced fragment spreads. This is used to + // determine if top level fragment definitions should be removed. + fragmentSpreadsInUse[node.name.value] = true; + }, + }, + + Directive: { + enter(node) { + // If a matching directive is found, remove it. + if (getDirectiveMatcher(directives)(node)) { + return null; + } + }, + }, + }), + ); + + // If we've removed fields with arguments, make sure the associated + // variables are also removed from the rest of the document, as long as they + // aren't being used elsewhere. + if ( + modifiedDoc && + filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length + ) { + modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); + } + + // If we've removed selection sets with fragment spreads, make sure the + // associated fragment definitions are also removed from the rest of the + // document, as long as they aren't being used elsewhere. + if ( + modifiedDoc && + filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name]) + .length + ) { + modifiedDoc = removeFragmentSpreadFromDocument( + fragmentSpreadsToRemove, + modifiedDoc, + ); + } + + return modifiedDoc; +} + +export function addTypenameToDocument(doc: DocumentNode): DocumentNode { + return visit(checkDocument(doc), { + SelectionSet: { + enter(node, _key, parent) { + // Don't add __typename to OperationDefinitions. + if ( + parent && + (parent as OperationDefinitionNode).kind === 'OperationDefinition' + ) { + return; + } + + // No changes if no selections. + const { selections } = node; + if (!selections) { + return; + } + + // If selections already have a __typename, or are part of an + // introspection query, do nothing. + const skip = selections.some(selection => { + return ( + isField(selection) && + (selection.name.value === '__typename' || + selection.name.value.lastIndexOf('__', 0) === 0) + ); + }); + if (skip) { + return; + } + + // If this SelectionSet is @export-ed as an input variable, it should + // not have a __typename field (see issue #4691). + const field = parent as FieldNode; + if ( + isField(field) && + field.directives && + field.directives.some(d => d.name.value === 'export') + ) { + return; + } + + // Create and return a new SelectionSet with a __typename Field. + return { + ...node, + selections: [...selections, TYPENAME_FIELD], + }; + }, + }, + }); +} + +const connectionRemoveConfig = { + test: (directive: DirectiveNode) => { + const willRemove = directive.name.value === 'connection'; + if (willRemove) { + if ( + !directive.arguments || + !directive.arguments.some(arg => arg.name.value === 'key') + ) { + invariant.warn( + 'Removing an @connection directive even though it does not have a key. ' + + 'You may want to use the key parameter to specify a store key.', + ); + } + } + + return willRemove; + }, +}; + +export function removeConnectionDirectiveFromDocument(doc: DocumentNode) { + return removeDirectivesFromDocument( + [connectionRemoveConfig], + checkDocument(doc), + ); +} + +function hasDirectivesInSelectionSet( + directives: GetDirectiveConfig[], + selectionSet: SelectionSetNode, + nestedCheck = true, +): boolean { + return ( + selectionSet && + selectionSet.selections && + selectionSet.selections.some(selection => + hasDirectivesInSelection(directives, selection, nestedCheck), + ) + ); +} + +function hasDirectivesInSelection( + directives: GetDirectiveConfig[], + selection: SelectionNode, + nestedCheck = true, +): boolean { + if (!isField(selection)) { + return true; + } + + if (!selection.directives) { + return false; + } + + return ( + selection.directives.some(getDirectiveMatcher(directives)) || + (nestedCheck && + hasDirectivesInSelectionSet( + directives, + selection.selectionSet, + nestedCheck, + )) + ); +} + +export function getDirectivesFromDocument( + directives: GetDirectiveConfig[], + doc: DocumentNode, +): DocumentNode { + checkDocument(doc); + + let parentPath: string; + + return nullIfDocIsEmpty( + visit(doc, { + SelectionSet: { + enter(node, _key, _parent, path) { + const currentPath = path.join('-'); + + if ( + !parentPath || + currentPath === parentPath || + !currentPath.startsWith(parentPath) + ) { + if (node.selections) { + const selectionsWithDirectives = node.selections.filter( + selection => hasDirectivesInSelection(directives, selection), + ); + + if (hasDirectivesInSelectionSet(directives, node, false)) { + parentPath = currentPath; + } + + return { + ...node, + selections: selectionsWithDirectives, + }; + } else { + return null; + } + } + }, + }, + }), + ); +} + +function getArgumentMatcher(config: RemoveArgumentsConfig[]) { + return function argumentMatcher(argument: ArgumentNode) { + return config.some( + (aConfig: RemoveArgumentsConfig) => + argument.value && + argument.value.kind === 'Variable' && + argument.value.name && + (aConfig.name === argument.value.name.value || + (aConfig.test && aConfig.test(argument))), + ); + }; +} + +export function removeArgumentsFromDocument( + config: RemoveArgumentsConfig[], + doc: DocumentNode, +): DocumentNode { + const argMatcher = getArgumentMatcher(config); + + return nullIfDocIsEmpty( + visit(doc, { + OperationDefinition: { + enter(node) { + return { + ...node, + // Remove matching top level variables definitions. + variableDefinitions: node.variableDefinitions.filter( + varDef => + !config.some(arg => arg.name === varDef.variable.name.value), + ), + }; + }, + }, + + Field: { + enter(node) { + // If `remove` is set to true for an argument, and an argument match + // is found for a field, remove the field as well. + const shouldRemoveField = config.some(argConfig => argConfig.remove); + + if (shouldRemoveField) { + let argMatchCount = 0; + node.arguments.forEach(arg => { + if (argMatcher(arg)) { + argMatchCount += 1; + } + }); + if (argMatchCount === 1) { + return null; + } + } + }, + }, + + Argument: { + enter(node) { + // Remove all matching arguments. + if (argMatcher(node)) { + return null; + } + }, + }, + }), + ); +} + +export function removeFragmentSpreadFromDocument( + config: RemoveFragmentSpreadConfig[], + doc: DocumentNode, +): DocumentNode { + function enter( + node: FragmentSpreadNode | FragmentDefinitionNode, + ): null | void { + if (config.some(def => def.name === node.name.value)) { + return null; + } + } + + return nullIfDocIsEmpty( + visit(doc, { + FragmentSpread: { enter }, + FragmentDefinition: { enter }, + }), + ); +} + +function getAllFragmentSpreadsFromSelectionSet( + selectionSet: SelectionSetNode, +): FragmentSpreadNode[] { + const allFragments: FragmentSpreadNode[] = []; + + selectionSet.selections.forEach(selection => { + if ( + (isField(selection) || isInlineFragment(selection)) && + selection.selectionSet + ) { + getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach( + frag => allFragments.push(frag), + ); + } else if (selection.kind === 'FragmentSpread') { + allFragments.push(selection); + } + }); + + return allFragments; +} + +// If the incoming document is a query, return it as is. Otherwise, build a +// new document containing a query operation based on the selection set +// of the previous main operation. +export function buildQueryFromSelectionSet( + document: DocumentNode, +): DocumentNode { + const definition = getMainDefinition(document); + const definitionOperation = (definition).operation; + + if (definitionOperation === 'query') { + // Already a query, so return the existing document. + return document; + } + + // Build a new query using the selection set of the main operation. + const modifiedDoc = visit(document, { + OperationDefinition: { + enter(node) { + return { + ...node, + operation: 'query', + }; + }, + }, + }); + return modifiedDoc; +} + +// Remove fields / selection sets that include an @client directive. +export function removeClientSetsFromDocument( + document: DocumentNode, +): DocumentNode | null { + checkDocument(document); + + let modifiedDoc = removeDirectivesFromDocument( + [ + { + test: (directive: DirectiveNode) => directive.name.value === 'client', + remove: true, + }, + ], + document, + ); + + // After a fragment definition has had its @client related document + // sets removed, if the only field it has left is a __typename field, + // remove the entire fragment operation to prevent it from being fired + // on the server. + if (modifiedDoc) { + modifiedDoc = visit(modifiedDoc, { + FragmentDefinition: { + enter(node) { + if (node.selectionSet) { + const isTypenameOnly = node.selectionSet.selections.every( + selection => + isField(selection) && selection.name.value === '__typename', + ); + if (isTypenameOnly) { + return null; + } + } + }, + }, + }); + } + + return modifiedDoc; +} diff --git a/node_modules/apollo-utilities/src/util/__tests__/assign.ts b/node_modules/apollo-utilities/src/util/__tests__/assign.ts new file mode 100644 index 000000000..6d3ef045d --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/assign.ts @@ -0,0 +1,47 @@ +import { assign } from '../assign'; + +describe('assign', () => { + it('will merge many objects together', () => { + expect(assign({ a: 1 }, { b: 2 })).toEqual({ a: 1, b: 2 }); + expect(assign({ a: 1 }, { b: 2 }, { c: 3 })).toEqual({ + a: 1, + b: 2, + c: 3, + }); + expect(assign({ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 })).toEqual({ + a: 1, + b: 2, + c: 3, + d: 4, + }); + }); + + it('will merge many objects together shallowly', () => { + expect(assign({ x: { a: 1 } }, { x: { b: 2 } })).toEqual({ x: { b: 2 } }); + expect(assign({ x: { a: 1 } }, { x: { b: 2 } }, { x: { c: 3 } })).toEqual({ + x: { c: 3 }, + }); + expect( + assign( + { x: { a: 1 } }, + { x: { b: 2 } }, + { x: { c: 3 } }, + { x: { d: 4 } }, + ), + ).toEqual({ x: { d: 4 } }); + }); + + it('will mutate and return the source objects', () => { + const source1 = { a: 1 }; + const source2 = { a: 1 }; + const source3 = { a: 1 }; + + expect(assign(source1, { b: 2 })).toEqual(source1); + expect(assign(source2, { b: 2 }, { c: 3 })).toEqual(source2); + expect(assign(source3, { b: 2 }, { c: 3 }, { d: 4 })).toEqual(source3); + + expect(source1).toEqual({ a: 1, b: 2 }); + expect(source2).toEqual({ a: 1, b: 2, c: 3 }); + expect(source3).toEqual({ a: 1, b: 2, c: 3, d: 4 }); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts b/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts new file mode 100644 index 000000000..52b491b5d --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts @@ -0,0 +1,70 @@ +import { cloneDeep } from '../cloneDeep'; + +describe('cloneDeep', () => { + it('will clone primitive values', () => { + expect(cloneDeep(undefined)).toEqual(undefined); + expect(cloneDeep(null)).toEqual(null); + expect(cloneDeep(true)).toEqual(true); + expect(cloneDeep(false)).toEqual(false); + expect(cloneDeep(-1)).toEqual(-1); + expect(cloneDeep(+1)).toEqual(+1); + expect(cloneDeep(0.5)).toEqual(0.5); + expect(cloneDeep('hello')).toEqual('hello'); + expect(cloneDeep('world')).toEqual('world'); + }); + + it('will clone objects', () => { + const value1 = {}; + const value2 = { a: 1, b: 2, c: 3 }; + const value3 = { x: { a: 1, b: 2, c: 3 }, y: { a: 1, b: 2, c: 3 } }; + + const clonedValue1 = cloneDeep(value1); + const clonedValue2 = cloneDeep(value2); + const clonedValue3 = cloneDeep(value3); + + expect(clonedValue1).toEqual(value1); + expect(clonedValue2).toEqual(value2); + expect(clonedValue3).toEqual(value3); + + expect(clonedValue1).toEqual(value1); + expect(clonedValue2).toEqual(value2); + expect(clonedValue3).toEqual(value3); + expect(clonedValue3.x).toEqual(value3.x); + expect(clonedValue3.y).toEqual(value3.y); + }); + + it('will clone arrays', () => { + const value1: Array = []; + const value2 = [1, 2, 3]; + const value3 = [[1, 2, 3], [1, 2, 3]]; + + const clonedValue1 = cloneDeep(value1); + const clonedValue2 = cloneDeep(value2); + const clonedValue3 = cloneDeep(value3); + + expect(clonedValue1).toEqual(value1); + expect(clonedValue2).toEqual(value2); + expect(clonedValue3).toEqual(value3); + + expect(clonedValue1).toEqual(value1); + expect(clonedValue2).toEqual(value2); + expect(clonedValue3).toEqual(value3); + expect(clonedValue3[0]).toEqual(value3[0]); + expect(clonedValue3[1]).toEqual(value3[1]); + }); + + it('should not attempt to follow circular references', () => { + const someObject = { + prop1: 'value1', + anotherObject: null, + }; + const anotherObject = { + someObject, + }; + someObject.anotherObject = anotherObject; + let chk; + expect(() => { + chk = cloneDeep(someObject); + }).not.toThrow(); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/environment.ts b/node_modules/apollo-utilities/src/util/__tests__/environment.ts new file mode 100644 index 000000000..dcb71538b --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/environment.ts @@ -0,0 +1,70 @@ +import { isEnv, isProduction, isDevelopment, isTest } from '../environment'; + +describe('environment', () => { + let keepEnv: string | undefined; + + beforeEach(() => { + // save the NODE_ENV + keepEnv = process.env.NODE_ENV; + }); + + afterEach(() => { + // restore the NODE_ENV + process.env.NODE_ENV = keepEnv; + }); + + describe('isEnv', () => { + it(`should match when there's a value`, () => { + ['production', 'development', 'test'].forEach(env => { + process.env.NODE_ENV = env; + expect(isEnv(env)).toBe(true); + }); + }); + + it(`should treat no proces.env.NODE_ENV as it'd be in development`, () => { + delete process.env.NODE_ENV; + expect(isEnv('development')).toBe(true); + }); + }); + + describe('isProduction', () => { + it('should return true if in production', () => { + process.env.NODE_ENV = 'production'; + expect(isProduction()).toBe(true); + }); + + it('should return false if not in production', () => { + process.env.NODE_ENV = 'test'; + expect(!isProduction()).toBe(true); + }); + }); + + describe('isTest', () => { + it('should return true if in test', () => { + process.env.NODE_ENV = 'test'; + expect(isTest()).toBe(true); + }); + + it('should return true if not in test', () => { + process.env.NODE_ENV = 'development'; + expect(!isTest()).toBe(true); + }); + }); + + describe('isDevelopment', () => { + it('should return true if in development', () => { + process.env.NODE_ENV = 'development'; + expect(isDevelopment()).toBe(true); + }); + + it('should return true if not in development and environment is defined', () => { + process.env.NODE_ENV = 'test'; + expect(!isDevelopment()).toBe(true); + }); + + it('should make development as the default environment', () => { + delete process.env.NODE_ENV; + expect(isDevelopment()).toBe(true); + }); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts b/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts new file mode 100644 index 000000000..e621a8370 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts @@ -0,0 +1,174 @@ +import { isEqual } from '../isEqual'; + +describe('isEqual', () => { + it('should return true for equal primitive values', () => { + expect(isEqual(undefined, undefined)).toBe(true); + expect(isEqual(null, null)).toBe(true); + expect(isEqual(true, true)).toBe(true); + expect(isEqual(false, false)).toBe(true); + expect(isEqual(-1, -1)).toBe(true); + expect(isEqual(+1, +1)).toBe(true); + expect(isEqual(42, 42)).toBe(true); + expect(isEqual(0, 0)).toBe(true); + expect(isEqual(0.5, 0.5)).toBe(true); + expect(isEqual('hello', 'hello')).toBe(true); + expect(isEqual('world', 'world')).toBe(true); + }); + + it('should return false for not equal primitive values', () => { + expect(!isEqual(undefined, null)).toBe(true); + expect(!isEqual(null, undefined)).toBe(true); + expect(!isEqual(true, false)).toBe(true); + expect(!isEqual(false, true)).toBe(true); + expect(!isEqual(-1, +1)).toBe(true); + expect(!isEqual(+1, -1)).toBe(true); + expect(!isEqual(42, 42.00000000000001)).toBe(true); + expect(!isEqual(0, 0.5)).toBe(true); + expect(!isEqual('hello', 'world')).toBe(true); + expect(!isEqual('world', 'hello')).toBe(true); + }); + + it('should return false when comparing primitives with objects', () => { + expect(!isEqual({}, null)).toBe(true); + expect(!isEqual(null, {})).toBe(true); + expect(!isEqual({}, true)).toBe(true); + expect(!isEqual(true, {})).toBe(true); + expect(!isEqual({}, 42)).toBe(true); + expect(!isEqual(42, {})).toBe(true); + expect(!isEqual({}, 'hello')).toBe(true); + expect(!isEqual('hello', {})).toBe(true); + }); + + it('should correctly compare shallow objects', () => { + expect(isEqual({}, {})).toBe(true); + expect(isEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).toBe(true); + expect(!isEqual({ a: 1, b: 2, c: 3 }, { a: 3, b: 2, c: 1 })).toBe(true); + expect(!isEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 })).toBe(true); + expect(!isEqual({ a: 1, b: 2 }, { a: 1, b: 2, c: 3 })).toBe(true); + }); + + it('should correctly compare deep objects', () => { + expect(isEqual({ x: {} }, { x: {} })).toBe(true); + expect( + isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 1, b: 2, c: 3 } }), + ).toBe(true); + expect( + !isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 3, b: 2, c: 1 } }), + ).toBe(true); + expect(!isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 1, b: 2 } })).toBe( + true, + ); + expect(!isEqual({ x: { a: 1, b: 2 } }, { x: { a: 1, b: 2, c: 3 } })).toBe( + true, + ); + }); + + it('should correctly compare deep objects without object prototype ', () => { + // Solves https://github.com/apollographql/apollo-client/issues/2132 + const objNoProto = Object.create(null); + objNoProto.a = { b: 2, c: [3, 4] }; + objNoProto.e = Object.create(null); + objNoProto.e.f = 5; + expect(isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: { f: 5 } })).toBe( + true, + ); + expect(!isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: { f: 6 } })).toBe( + true, + ); + expect(!isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: null })).toBe( + true, + ); + expect(!isEqual(objNoProto, { a: { b: 2, c: [3] }, e: { f: 5 } })).toBe( + true, + ); + expect(!isEqual(objNoProto, null)).toBe(true); + }); + + it('should correctly handle modified prototypes', () => { + Array.prototype.foo = null; + expect(isEqual([1, 2, 3], [1, 2, 3])).toBe(true); + expect(!isEqual([1, 2, 3], [1, 2, 4])).toBe(true); + delete Array.prototype.foo; + }); + + describe('comparing objects with circular refs', () => { + // copied with slight modification from lodash test suite + it('should compare objects with circular references', () => { + const object1 = {}, + object2 = {}; + + object1.a = object1; + object2.a = object2; + + expect(isEqual(object1, object2)).toBe(true); + + object1.b = 0; + object2.b = Object(0); + + expect(isEqual(object1, object2)).toBe(true); + + object1.c = Object(1); + object2.c = Object(2); + + expect(isEqual(object1, object2)).toBe(false); + + object1 = { a: 1, b: 2, c: 3 }; + object1.b = object1; + object2 = { a: 1, b: { a: 1, b: 2, c: 3 }, c: 3 }; + + expect(isEqual(object1, object2)).toBe(false); + }); + + it('should have transitive equivalence for circular references of objects', () => { + const object1 = {}, + object2 = { a: object1 }, + object3 = { a: object2 }; + + object1.a = object1; + + expect(isEqual(object1, object2)).toBe(true); + expect(isEqual(object2, object3)).toBe(true); + expect(isEqual(object1, object3)).toBe(true); + }); + + it('should compare objects with multiple circular references', () => { + const array1 = [{}], + array2 = [{}]; + + (array1[0].a = array1).push(array1); + (array2[0].a = array2).push(array2); + + expect(isEqual(array1, array2)).toBe(true); + + array1[0].b = 0; + array2[0].b = Object(0); + + expect(isEqual(array1, array2)).toBe(true); + + array1[0].c = Object(1); + array2[0].c = Object(2); + + expect(isEqual(array1, array2)).toBe(false); + }); + + it('should compare objects with complex circular references', () => { + const object1 = { + foo: { b: { c: { d: {} } } }, + bar: { a: 2 }, + }; + + const object2 = { + foo: { b: { c: { d: {} } } }, + bar: { a: 2 }, + }; + + object1.foo.b.c.d = object1; + object1.bar.b = object1.foo.b; + + object2.foo.b.c.d = object2; + object2.bar.b = object2.foo.b; + + expect(isEqual(object1, object2)).toBe(true); + }); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts b/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts new file mode 100644 index 000000000..c33cc60ca --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts @@ -0,0 +1,17 @@ +import { maybeDeepFreeze } from '../maybeDeepFreeze'; + +describe('maybeDeepFreeze', () => { + it('should deep freeze', () => { + const foo: any = { bar: undefined }; + maybeDeepFreeze(foo); + expect(() => (foo.bar = 1)).toThrow(); + expect(foo.bar).toBeUndefined(); + }); + + it('should properly freeze objects without hasOwnProperty', () => { + const foo = Object.create(null); + foo.bar = undefined; + maybeDeepFreeze(foo); + expect(() => (foo.bar = 1)).toThrow(); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts b/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts new file mode 100644 index 000000000..137780690 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts @@ -0,0 +1,139 @@ +import { mergeDeep, mergeDeepArray } from '../mergeDeep'; + +describe('mergeDeep', function() { + it('should return an object if first argument falsy', function() { + expect(mergeDeep()).toEqual({}); + expect(mergeDeep(null)).toEqual({}); + expect(mergeDeep(null, { foo: 42 })).toEqual({ foo: 42 }); + }); + + it('should preserve identity for single arguments', function() { + const arg = Object.create(null); + expect(mergeDeep(arg)).toBe(arg); + }); + + it('should preserve identity when merging non-conflicting objects', function() { + const a = { a: { name: 'ay' } }; + const b = { b: { name: 'bee' } }; + const c = mergeDeep(a, b); + expect(c.a).toBe(a.a); + expect(c.b).toBe(b.b); + expect(c).toEqual({ + a: { name: 'ay' }, + b: { name: 'bee' }, + }); + }); + + it('should shallow-copy conflicting fields', function() { + const a = { conflict: { fromA: [1, 2, 3] } }; + const b = { conflict: { fromB: [4, 5] } }; + const c = mergeDeep(a, b); + expect(c.conflict).not.toBe(a.conflict); + expect(c.conflict).not.toBe(b.conflict); + expect(c.conflict.fromA).toBe(a.conflict.fromA); + expect(c.conflict.fromB).toBe(b.conflict.fromB); + expect(c).toEqual({ + conflict: { + fromA: [1, 2, 3], + fromB: [4, 5], + }, + }); + }); + + it('should resolve conflicts among more than two objects', function() { + const sources = []; + + for (let i = 0; i < 100; ++i) { + sources.push({ + ['unique' + i]: { value: i }, + conflict: { + ['from' + i]: { value: i }, + nested: { + ['nested' + i]: { value: i }, + }, + }, + }); + } + + const merged = mergeDeep(...sources); + + sources.forEach((source, i) => { + expect(merged['unique' + i].value).toBe(i); + expect(source['unique' + i]).toBe(merged['unique' + i]); + + expect(merged.conflict).not.toBe(source.conflict); + expect(merged.conflict['from' + i].value).toBe(i); + expect(merged.conflict['from' + i]).toBe(source.conflict['from' + i]); + + expect(merged.conflict.nested).not.toBe(source.conflict.nested); + expect(merged.conflict.nested['nested' + i].value).toBe(i); + expect(merged.conflict.nested['nested' + i]).toBe( + source.conflict.nested['nested' + i], + ); + }); + }); + + it('can merge array elements', function() { + const a = [{ a: 1 }, { a: 'ay' }, 'a']; + const b = [{ b: 2 }, { b: 'bee' }, 'b']; + const c = [{ c: 3 }, { c: 'cee' }, 'c']; + const d = { 1: { d: 'dee' } }; + + expect(mergeDeep(a, b, c, d)).toEqual([ + { a: 1, b: 2, c: 3 }, + { a: 'ay', b: 'bee', c: 'cee', d: 'dee' }, + 'c', + ]); + }); + + it('lets the last conflicting value win', function() { + expect(mergeDeep('a', 'b', 'c')).toBe('c'); + + expect( + mergeDeep( + { a: 'a', conflict: 1 }, + { b: 'b', conflict: 2 }, + { c: 'c', conflict: 3 }, + ), + ).toEqual({ + a: 'a', + b: 'b', + c: 'c', + conflict: 3, + }); + + expect(mergeDeep( + ['a', ['b', 'c'], 'd'], + [/*empty*/, ['B'], 'D'], + )).toEqual( + ['a', ['B', 'c'], 'D'], + ); + + expect(mergeDeep( + ['a', ['b', 'c'], 'd'], + ['A', [/*empty*/, 'C']], + )).toEqual( + ['A', ['b', 'C'], 'd'], + ); + }); + + it('mergeDeep returns the intersection of its argument types', function() { + const abc = mergeDeep({ str: "hi", a: 1 }, { a: 3, b: 2 }, { b: 1, c: 2 }); + // The point of this test is that the following lines type-check without + // resorting to any `any` loopholes: + expect(abc.str.slice(0)).toBe("hi"); + expect(abc.a * 2).toBe(6); + expect(abc.b - 0).toBe(1); + expect(abc.c / 2).toBe(1); + }); + + it('mergeDeepArray returns the supertype of its argument types', function() { + class F { + check() { return "ok" }; + } + const fs: F[] = [new F, new F, new F]; + // Although mergeDeepArray doesn't have the same tuple type awareness as + // mergeDeep, it does infer that F should be the return type here: + expect(mergeDeepArray(fs).check()).toBe("ok"); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts b/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts new file mode 100644 index 000000000..fd5594b89 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts @@ -0,0 +1,15 @@ +import { stripSymbols } from '../stripSymbols'; + +interface SymbolConstructor { + (description?: string | number): symbol; +} + +declare const Symbol: SymbolConstructor; + +describe('stripSymbols', () => { + it('should strip symbols (only)', () => { + const sym = Symbol('id'); + const data = { foo: 'bar', [sym]: 'ROOT_QUERY' }; + expect(stripSymbols(data)).toEqual({ foo: 'bar' }); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts b/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts new file mode 100644 index 000000000..35c87534e --- /dev/null +++ b/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts @@ -0,0 +1,61 @@ +import { warnOnceInDevelopment } from '../warnOnce'; + +let lastWarning: string | null; +let keepEnv: string | undefined; +let numCalls = 0; +let oldConsoleWarn: any; + +describe('warnOnce', () => { + beforeEach(() => { + keepEnv = process.env.NODE_ENV; + numCalls = 0; + lastWarning = null; + oldConsoleWarn = console.warn; + console.warn = (msg: any) => { + numCalls++; + lastWarning = msg; + }; + }); + afterEach(() => { + process.env.NODE_ENV = keepEnv; + console.warn = oldConsoleWarn; + }); + it('actually warns', () => { + process.env.NODE_ENV = 'development'; + warnOnceInDevelopment('hi'); + expect(lastWarning).toBe('hi'); + expect(numCalls).toEqual(1); + }); + + it('does not warn twice', () => { + process.env.NODE_ENV = 'development'; + warnOnceInDevelopment('ho'); + warnOnceInDevelopment('ho'); + expect(lastWarning).toEqual('ho'); + expect(numCalls).toEqual(1); + }); + + it('warns two different things once each', () => { + process.env.NODE_ENV = 'development'; + warnOnceInDevelopment('slow'); + expect(lastWarning).toEqual('slow'); + warnOnceInDevelopment('mo'); + expect(lastWarning).toEqual('mo'); + expect(numCalls).toEqual(2); + }); + + it('does not warn in production', () => { + process.env.NODE_ENV = 'production'; + warnOnceInDevelopment('lo'); + warnOnceInDevelopment('lo'); + expect(numCalls).toEqual(0); + }); + + it('warns many times in test', () => { + process.env.NODE_ENV = 'test'; + warnOnceInDevelopment('yo'); + warnOnceInDevelopment('yo'); + expect(lastWarning).toEqual('yo'); + expect(numCalls).toEqual(2); + }); +}); diff --git a/node_modules/apollo-utilities/src/util/assign.ts b/node_modules/apollo-utilities/src/util/assign.ts new file mode 100644 index 000000000..3a2243299 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/assign.ts @@ -0,0 +1,31 @@ +/** + * Adds the properties of one or more source objects to a target object. Works exactly like + * `Object.assign`, but as a utility to maintain support for IE 11. + * + * @see https://github.com/apollostack/apollo-client/pull/1009 + */ +export function assign(a: A, b: B): A & B; +export function assign(a: A, b: B, c: C): A & B & C; +export function assign(a: A, b: B, c: C, d: D): A & B & C & D; +export function assign( + a: A, + b: B, + c: C, + d: D, + e: E, +): A & B & C & D & E; +export function assign(target: any, ...sources: Array): any; +export function assign( + target: { [key: string]: any }, + ...sources: Array<{ [key: string]: any }> +): { [key: string]: any } { + sources.forEach(source => { + if (typeof source === 'undefined' || source === null) { + return; + } + Object.keys(source).forEach(key => { + target[key] = source[key]; + }); + }); + return target; +} diff --git a/node_modules/apollo-utilities/src/util/canUse.ts b/node_modules/apollo-utilities/src/util/canUse.ts new file mode 100644 index 000000000..d98586790 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/canUse.ts @@ -0,0 +1,4 @@ +export const canUseWeakMap = typeof WeakMap === 'function' && !( + typeof navigator === 'object' && + navigator.product === 'ReactNative' +); diff --git a/node_modules/apollo-utilities/src/util/cloneDeep.ts b/node_modules/apollo-utilities/src/util/cloneDeep.ts new file mode 100644 index 000000000..961b4a82a --- /dev/null +++ b/node_modules/apollo-utilities/src/util/cloneDeep.ts @@ -0,0 +1,37 @@ +const { toString } = Object.prototype; + +/** + * Deeply clones a value to create a new instance. + */ +export function cloneDeep(value: T): T { + return cloneDeepHelper(value, new Map()); +} + +function cloneDeepHelper(val: T, seen: Map): T { + switch (toString.call(val)) { + case "[object Array]": { + if (seen.has(val)) return seen.get(val); + const copy: T & any[] = (val as any).slice(0); + seen.set(val, copy); + copy.forEach(function (child, i) { + copy[i] = cloneDeepHelper(child, seen); + }); + return copy; + } + + case "[object Object]": { + if (seen.has(val)) return seen.get(val); + // High fidelity polyfills of Object.create and Object.getPrototypeOf are + // possible in all JS environments, so we will assume they exist/work. + const copy = Object.create(Object.getPrototypeOf(val)); + seen.set(val, copy); + Object.keys(val).forEach(key => { + copy[key] = cloneDeepHelper((val as any)[key], seen); + }); + return copy; + } + + default: + return val; + } +} diff --git a/node_modules/apollo-utilities/src/util/environment.ts b/node_modules/apollo-utilities/src/util/environment.ts new file mode 100644 index 000000000..f4ad04e14 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/environment.ts @@ -0,0 +1,24 @@ +export function getEnv(): string | undefined { + if (typeof process !== 'undefined' && process.env.NODE_ENV) { + return process.env.NODE_ENV; + } + + // default environment + return 'development'; +} + +export function isEnv(env: string): boolean { + return getEnv() === env; +} + +export function isProduction(): boolean { + return isEnv('production') === true; +} + +export function isDevelopment(): boolean { + return isEnv('development') === true; +} + +export function isTest(): boolean { + return isEnv('test') === true; +} diff --git a/node_modules/apollo-utilities/src/util/errorHandling.ts b/node_modules/apollo-utilities/src/util/errorHandling.ts new file mode 100644 index 000000000..25a16ca0f --- /dev/null +++ b/node_modules/apollo-utilities/src/util/errorHandling.ts @@ -0,0 +1,15 @@ +import { ExecutionResult } from 'graphql'; + +export function tryFunctionOrLogError(f: Function) { + try { + return f(); + } catch (e) { + if (console.error) { + console.error(e); + } + } +} + +export function graphQLResultHasError(result: ExecutionResult) { + return result.errors && result.errors.length; +} diff --git a/node_modules/apollo-utilities/src/util/filterInPlace.ts b/node_modules/apollo-utilities/src/util/filterInPlace.ts new file mode 100644 index 000000000..d5787caba --- /dev/null +++ b/node_modules/apollo-utilities/src/util/filterInPlace.ts @@ -0,0 +1,14 @@ +export function filterInPlace( + array: T[], + test: (elem: T) => boolean, + context?: any, +): T[] { + let target = 0; + array.forEach(function (elem, i) { + if (test.call(this, elem, i, array)) { + array[target++] = elem; + } + }, context); + array.length = target; + return array; +} diff --git a/node_modules/apollo-utilities/src/util/isEqual.ts b/node_modules/apollo-utilities/src/util/isEqual.ts new file mode 100644 index 000000000..debf7429c --- /dev/null +++ b/node_modules/apollo-utilities/src/util/isEqual.ts @@ -0,0 +1 @@ +export { equal as isEqual } from '@wry/equality'; diff --git a/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts b/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts new file mode 100644 index 000000000..d966d3364 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts @@ -0,0 +1,33 @@ +import { isDevelopment, isTest } from './environment'; + +// Taken (mostly) from https://github.com/substack/deep-freeze to avoid +// import hassles with rollup. +function deepFreeze(o: any) { + Object.freeze(o); + + Object.getOwnPropertyNames(o).forEach(function(prop) { + if ( + o[prop] !== null && + (typeof o[prop] === 'object' || typeof o[prop] === 'function') && + !Object.isFrozen(o[prop]) + ) { + deepFreeze(o[prop]); + } + }); + + return o; +} + +export function maybeDeepFreeze(obj: any) { + if (isDevelopment() || isTest()) { + // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing + // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043). + const symbolIsPolyfilled = + typeof Symbol === 'function' && typeof Symbol('') === 'string'; + + if (!symbolIsPolyfilled) { + return deepFreeze(obj); + } + } + return obj; +} diff --git a/node_modules/apollo-utilities/src/util/mergeDeep.ts b/node_modules/apollo-utilities/src/util/mergeDeep.ts new file mode 100644 index 000000000..d83a33fe1 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/mergeDeep.ts @@ -0,0 +1,115 @@ +const { hasOwnProperty } = Object.prototype; + +// These mergeDeep and mergeDeepArray utilities merge any number of objects +// together, sharing as much memory as possible with the source objects, while +// remaining careful to avoid modifying any source objects. + +// Logically, the return type of mergeDeep should be the intersection of +// all the argument types. The binary call signature is by far the most +// common, but we support 0- through 5-ary as well. After that, the +// resulting type is just the inferred array element type. Note to nerds: +// there is a more clever way of doing this that converts the tuple type +// first to a union type (easy enough: T[number]) and then converts the +// union to an intersection type using distributive conditional type +// inference, but that approach has several fatal flaws (boolean becomes +// true & false, and the inferred type ends up as unknown in many cases), +// in addition to being nearly impossible to explain/understand. +export type TupleToIntersection = + T extends [infer A] ? A : + T extends [infer A, infer B] ? A & B : + T extends [infer A, infer B, infer C] ? A & B & C : + T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : + T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : + T extends (infer U)[] ? U : any; + +export function mergeDeep( + ...sources: T +): TupleToIntersection { + return mergeDeepArray(sources); +} + +// In almost any situation where you could succeed in getting the +// TypeScript compiler to infer a tuple type for the sources array, you +// could just use mergeDeep instead of mergeDeepArray, so instead of +// trying to convert T[] to an intersection type we just infer the array +// element type, which works perfectly when the sources array has a +// consistent element type. +export function mergeDeepArray(sources: T[]): T { + let target = sources[0] || {} as T; + const count = sources.length; + if (count > 1) { + const pastCopies: any[] = []; + target = shallowCopyForMerge(target, pastCopies); + for (let i = 1; i < count; ++i) { + target = mergeHelper(target, sources[i], pastCopies); + } + } + return target; +} + +function isObject(obj: any): obj is Record { + return obj !== null && typeof obj === 'object'; +} + +function mergeHelper( + target: any, + source: any, + pastCopies: any[], +) { + if (isObject(source) && isObject(target)) { + // In case the target has been frozen, make an extensible copy so that + // we can merge properties into the copy. + if (Object.isExtensible && !Object.isExtensible(target)) { + target = shallowCopyForMerge(target, pastCopies); + } + + Object.keys(source).forEach(sourceKey => { + const sourceValue = source[sourceKey]; + if (hasOwnProperty.call(target, sourceKey)) { + const targetValue = target[sourceKey]; + if (sourceValue !== targetValue) { + // When there is a key collision, we need to make a shallow copy of + // target[sourceKey] so the merge does not modify any source objects. + // To avoid making unnecessary copies, we use a simple array to track + // past copies, since it's safe to modify copies created earlier in + // the merge. We use an array for pastCopies instead of a Map or Set, + // since the number of copies should be relatively small, and some + // Map/Set polyfills modify their keys. + target[sourceKey] = mergeHelper( + shallowCopyForMerge(targetValue, pastCopies), + sourceValue, + pastCopies, + ); + } + } else { + // If there is no collision, the target can safely share memory with + // the source, and the recursion can terminate here. + target[sourceKey] = sourceValue; + } + }); + + return target; + } + + // If source (or target) is not an object, let source replace target. + return source; +} + +function shallowCopyForMerge(value: T, pastCopies: any[]): T { + if ( + value !== null && + typeof value === 'object' && + pastCopies.indexOf(value) < 0 + ) { + if (Array.isArray(value)) { + value = (value as any).slice(0); + } else { + value = { + __proto__: Object.getPrototypeOf(value), + ...value, + }; + } + pastCopies.push(value); + } + return value; +} diff --git a/node_modules/apollo-utilities/src/util/stripSymbols.ts b/node_modules/apollo-utilities/src/util/stripSymbols.ts new file mode 100644 index 000000000..41cabae71 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/stripSymbols.ts @@ -0,0 +1,14 @@ +/** + * In order to make assertions easier, this function strips `symbol`'s from + * the incoming data. + * + * This can be handy when running tests against `apollo-client` for example, + * since it adds `symbol`'s to the data in the store. Jest's `toEqual` + * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437), + * which means all test data used in a `toEqual` comparison would also have to + * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data + * we can compare against more simplified test data. + */ +export function stripSymbols(data: T): T { + return JSON.parse(JSON.stringify(data)); +} diff --git a/node_modules/apollo-utilities/src/util/warnOnce.ts b/node_modules/apollo-utilities/src/util/warnOnce.ts new file mode 100644 index 000000000..90f323215 --- /dev/null +++ b/node_modules/apollo-utilities/src/util/warnOnce.ts @@ -0,0 +1,24 @@ +import { isProduction, isTest } from './environment'; + +const haveWarned = Object.create({}); + +/** + * Print a warning only once in development. + * In production no warnings are printed. + * In test all warnings are printed. + * + * @param msg The warning message + * @param type warn or error (will call console.warn or console.error) + */ +export function warnOnceInDevelopment(msg: string, type = 'warn') { + if (!isProduction() && !haveWarned[msg]) { + if (!isTest()) { + haveWarned[msg] = true; + } + if (type === 'error') { + console.error(msg); + } else { + console.warn(msg); + } + } +} diff --git a/node_modules/fast-json-stable-stringify/.eslintrc.yml b/node_modules/fast-json-stable-stringify/.eslintrc.yml new file mode 100644 index 000000000..1c77b0d47 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.eslintrc.yml @@ -0,0 +1,26 @@ +extends: eslint:recommended +env: + node: true + browser: true +rules: + block-scoped-var: 2 + callback-return: 2 + dot-notation: 2 + indent: 2 + linebreak-style: [2, unix] + new-cap: 2 + no-console: [2, allow: [warn, error]] + no-else-return: 2 + no-eq-null: 2 + no-fallthrough: 2 + no-invalid-this: 2 + no-return-assign: 2 + no-shadow: 1 + no-trailing-spaces: 2 + no-use-before-define: [2, nofunc] + quotes: [2, single, avoid-escape] + semi: [2, always] + strict: [2, global] + valid-jsdoc: [2, requireReturn: false] + no-control-regex: 0 + no-useless-escape: 2 diff --git a/node_modules/fast-json-stable-stringify/.npmignore b/node_modules/fast-json-stable-stringify/.npmignore new file mode 100644 index 000000000..899d7360b --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.npmignore @@ -0,0 +1,4 @@ +node_modules +.nyc_output/ +coverage/ +.DS_Store diff --git a/node_modules/fast-json-stable-stringify/.travis.yml b/node_modules/fast-json-stable-stringify/.travis.yml new file mode 100644 index 000000000..7ddce74b8 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "4" + - "6" + - "7" + - "8" +after_script: + - coveralls < coverage/lcov.info diff --git a/node_modules/fast-json-stable-stringify/LICENSE b/node_modules/fast-json-stable-stringify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fast-json-stable-stringify/README.md b/node_modules/fast-json-stable-stringify/README.md new file mode 100644 index 000000000..0f43b4a7e --- /dev/null +++ b/node_modules/fast-json-stable-stringify/README.md @@ -0,0 +1,119 @@ +# fast-json-stable-stringify + +Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify). + +You can also pass in a custom comparison function. + +[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master) + +# example + +``` js +var stringify = require('fast-json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + + +# methods + +``` js +var stringify = require('fast-json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('fast-json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('fast-json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### cycles + +Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case. + +TypeError will be thrown in case of circular object without this option. + + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install fast-json-stable-stringify +``` + + +# benchmark + +To run benchmark (requires Node.js 6+): +``` +node benchmark +``` + +Results: +``` +fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled) +json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled) +fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled) +faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled) +The fastest is fast-stable-stringify +``` + + +# license + +[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/node_modules/fast-json-stable-stringify/benchmark/index.js b/node_modules/fast-json-stable-stringify/benchmark/index.js new file mode 100644 index 000000000..e725f9fc5 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/index.js @@ -0,0 +1,31 @@ +'use strict'; + +const Benchmark = require('benchmark'); +const suite = new Benchmark.Suite; +const testData = require('./test.json'); + + +const stringifyPackages = { + // 'JSON.stringify': JSON.stringify, + 'fast-json-stable-stringify': require('../index'), + 'json-stable-stringify': true, + 'fast-stable-stringify': true, + 'faster-stable-stringify': true +}; + + +for (const name in stringifyPackages) { + let func = stringifyPackages[name]; + if (func === true) func = require(name); + + suite.add(name, function() { + func(testData); + }); +} + +suite + .on('cycle', (event) => console.log(String(event.target))) + .on('complete', function () { + console.log('The fastest is ' + this.filter('fastest').map('name')); + }) + .run({async: true}); diff --git a/node_modules/fast-json-stable-stringify/benchmark/test.json b/node_modules/fast-json-stable-stringify/benchmark/test.json new file mode 100644 index 000000000..c9118c11f --- /dev/null +++ b/node_modules/fast-json-stable-stringify/benchmark/test.json @@ -0,0 +1,137 @@ +[ + { + "_id": "59ef4a83ee8364808d761beb", + "index": 0, + "guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d", + "isActive": false, + "balance": "$2,341.81", + "picture": "http://placehold.it/32x32", + "age": 28, + "eyeColor": "brown", + "name": "Carey Savage", + "gender": "female", + "company": "VERAQ", + "email": "careysavage@veraq.com", + "phone": "+1 (897) 574-3014", + "address": "458 Willow Street, Henrietta, California, 7234", + "about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n", + "registered": "2014-05-21T01:56:51 -01:00", + "latitude": 63.89502, + "longitude": 62.369807, + "tags": [ + "nostrud", + "nisi", + "consectetur", + "ullamco", + "cupidatat", + "culpa", + "commodo" + ], + "friends": [ + { + "id": 0, + "name": "Henry Walls" + }, + { + "id": 1, + "name": "Janice Baker" + }, + { + "id": 2, + "name": "Russell Bush" + } + ], + "greeting": "Hello, Carey Savage! You have 4 unread messages.", + "favoriteFruit": "banana" + }, + { + "_id": "59ef4a83ff5774a691454e89", + "index": 1, + "guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d", + "isActive": true, + "balance": "$1,618.15", + "picture": "http://placehold.it/32x32", + "age": 35, + "eyeColor": "blue", + "name": "Elinor Pearson", + "gender": "female", + "company": "FLEXIGEN", + "email": "elinorpearson@flexigen.com", + "phone": "+1 (923) 548-3751", + "address": "600 Bayview Avenue, Draper, Montana, 3088", + "about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n", + "registered": "2017-04-22T07:58:41 -01:00", + "latitude": -87.824919, + "longitude": 69.538927, + "tags": [ + "fugiat", + "labore", + "proident", + "quis", + "eiusmod", + "qui", + "est" + ], + "friends": [ + { + "id": 0, + "name": "Massey Wagner" + }, + { + "id": 1, + "name": "Marcella Ferrell" + }, + { + "id": 2, + "name": "Evans Mckee" + } + ], + "greeting": "Hello, Elinor Pearson! You have 3 unread messages.", + "favoriteFruit": "strawberry" + }, + { + "_id": "59ef4a839ec8a4be4430b36b", + "index": 2, + "guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809", + "isActive": false, + "balance": "$2,046.95", + "picture": "http://placehold.it/32x32", + "age": 40, + "eyeColor": "green", + "name": "Irwin Davidson", + "gender": "male", + "company": "DANJA", + "email": "irwindavidson@danja.com", + "phone": "+1 (883) 537-2041", + "address": "439 Cook Street, Chapin, Kentucky, 7398", + "about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n", + "registered": "2016-09-01T07:49:08 -01:00", + "latitude": -49.803812, + "longitude": 104.93279, + "tags": [ + "consequat", + "enim", + "quis", + "magna", + "est", + "culpa", + "tempor" + ], + "friends": [ + { + "id": 0, + "name": "Ruth Hansen" + }, + { + "id": 1, + "name": "Kathrine Austin" + }, + { + "id": 2, + "name": "Rivera Munoz" + } + ], + "greeting": "Hello, Irwin Davidson! You have 2 unread messages.", + "favoriteFruit": "banana" + } +] diff --git a/node_modules/fast-json-stable-stringify/example/key_cmp.js b/node_modules/fast-json-stable-stringify/example/key_cmp.js new file mode 100644 index 000000000..d5f66752d --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/example/nested.js b/node_modules/fast-json-stable-stringify/example/nested.js new file mode 100644 index 000000000..9a672fc65 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/str.js b/node_modules/fast-json-stable-stringify/example/str.js new file mode 100644 index 000000000..9b4b3cd28 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/fast-json-stable-stringify/example/value_cmp.js b/node_modules/fast-json-stable-stringify/example/value_cmp.js new file mode 100644 index 000000000..09f1c5f79 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/fast-json-stable-stringify/index.js b/node_modules/fast-json-stable-stringify/index.js new file mode 100644 index 000000000..c44e6a413 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/index.js @@ -0,0 +1,59 @@ +'use strict'; + +module.exports = function (data, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (node) { + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + if (node === undefined) return; + if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; + if (typeof node !== 'object') return JSON.stringify(node); + + var i, out; + if (Array.isArray(node)) { + out = '['; + for (i = 0; i < node.length; i++) { + if (i) out += ','; + out += stringify(node[i]) || 'null'; + } + return out + ']'; + } + + if (node === null) return 'null'; + + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + + var seenIndex = seen.push(node) - 1; + var keys = Object.keys(node).sort(cmp && cmp(node)); + out = ''; + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node[key]); + + if (!value) continue; + if (out) out += ','; + out += JSON.stringify(key) + ':' + value; + } + seen.splice(seenIndex, 1); + return '{' + out + '}'; + })(data); +}; diff --git a/node_modules/fast-json-stable-stringify/package.json b/node_modules/fast-json-stable-stringify/package.json new file mode 100644 index 000000000..21380a991 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/package.json @@ -0,0 +1,50 @@ +{ + "name": "fast-json-stable-stringify", + "version": "2.0.0", + "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", + "main": "index.js", + "devDependencies": { + "benchmark": "^2.1.4", + "coveralls": "^3.0.0", + "eslint": "^4.9.0", + "fast-stable-stringify": "latest", + "faster-stable-stringify": "latest", + "json-stable-stringify": "latest", + "nyc": "^11.2.1", + "pre-commit": "^1.2.2", + "tape": "~1.0.4" + }, + "scripts": { + "eslint": "eslint index.js test", + "test-spec": "tape test/*.js", + "test": "npm run eslint && nyc npm run test-spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git" + }, + "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "stable" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "nyc": { + "exclude": [ + "test", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + } +} diff --git a/node_modules/fast-json-stable-stringify/test/cmp.js b/node_modules/fast-json-stable-stringify/test/cmp.js new file mode 100644 index 000000000..4efd6b597 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/cmp.js @@ -0,0 +1,13 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/nested.js b/node_modules/fast-json-stable-stringify/test/nested.js new file mode 100644 index 000000000..167a358e0 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/nested.js @@ -0,0 +1,44 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); + +test('acyclic but with reused obj-property pointers', function (t) { + t.plan(1); + var x = { a: 1 }; + var y = { b: x, c: x }; + t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/str.js b/node_modules/fast-json-stable-stringify/test/str.js new file mode 100644 index 000000000..99a9ade18 --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/str.js @@ -0,0 +1,46 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('object with null', function (t) { + t.plan(1); + var obj = { a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"z":null}'); +}); + +test('object with NaN and Infinity', function (t) { + t.plan(1); + var obj = { a: 3, b: NaN, c: Infinity }; + t.equal(stringify(obj), '{"a":3,"b":null,"c":null}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/node_modules/fast-json-stable-stringify/test/to-json.js b/node_modules/fast-json-stable-stringify/test/to-json.js new file mode 100644 index 000000000..2fb2cfa3e --- /dev/null +++ b/node_modules/fast-json-stable-stringify/test/to-json.js @@ -0,0 +1,22 @@ +'use strict'; + +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/node_modules/graphql-tag/.tav.yml b/node_modules/graphql-tag/.tav.yml new file mode 100644 index 000000000..023505f31 --- /dev/null +++ b/node_modules/graphql-tag/.tav.yml @@ -0,0 +1,10 @@ + +graphql-0.11: + name: graphql + versions: "^0.9.0 || ^0.10.0 || ^0.11.0" + commands: mocha test/graphql.js test/graphql-v0.11.js + +graphql-0.12: + name: graphql + versions: "^0.12.0 || ^0.13.0" + commands: mocha test/graphql.js test/graphql-v0.12.js diff --git a/node_modules/graphql-tag/CHANGELOG.md b/node_modules/graphql-tag/CHANGELOG.md new file mode 100644 index 000000000..279ba6edd --- /dev/null +++ b/node_modules/graphql-tag/CHANGELOG.md @@ -0,0 +1,177 @@ +# Change log + +### v2.10.0 +* Add support for `graphql@14` by [timsuchanek](https://github.com/timsuchanek) in [#210](https://github.com/apollographql/graphql-tag/pull/210), [#211](https://github.com/apollographql/graphql-tag/pull/211) + +### v2.9.1 +* Fix IE11 support by using a regular for-loop by [vitorbal](https://github.com/vitorbal) in [#176](https://github.com/apollographql/graphql-tag/pull/176) + +### v2.9.0 +* Remove duplicate exports in named exports by [wacii](https://github.com/wacii) in [#170](https://github.com/apollographql/graphql-tag/pull/170) +* Add `experimentalFragmentVariables` compatibility by [lucasconstantino](https://github.com/lucasconstantino) in [#167](https://github.com/apollographql/graphql-tag/pull/167/) + +### v2.8.0 + +* Update `graphql` to ^0.13, support testing all compatible versions [jnwng](https://github.com/jnwng) in + [PR #156](https://github.com/apollographql/graphql-tag/pull/156) +* Export single queries as both default and named [stonexer](https://github.com/stonexer) in + [PR #154](https://github.com/apollographql/graphql-tag/pull/154) + +### v2.7.{0,1,2,3} + +* Merge and then revert [PR #141](https://github.com/apollographql/graphql-tag/pull/141) due to errors being thrown + +### v2.6.1 + +* Accept `graphql@^0.12.0` as peerDependency [jnwng](https://github.com/jnwng) + addressing [#134](https://github.com/apollographql/graphql-tag/issues/134) + +### v2.6.0 + +* Support multiple query definitions when using Webpack loader [jfaust](https://github.com/jfaust) in + [PR #122](https://github.com/apollographql/graphql-tag/pull/122) + +### v2.5.0 + +* Update graphql to ^0.11.0, add graphql@^0.11.0 to peerDependencies [pleunv](https://github.com/pleunv) in + [PR #124](https://github.com/apollographql/graphql-tag/pull/124) + +### v2.4.{1,2} + +* Temporarily reverting [PR #99](https://github.com/apollographql/graphql-tag/pull/99) to investigate issues with + bundling + +### v2.4.0 + +* Add support for descriptors [jamiter](https://github.com/jamiter) in + [PR #99](https://github.com/apollographql/graphql-tag/pull/99) + +### v2.3.0 + +* Add flow support [michalkvasnicak](https://github.com/michalkvasnicak) in + [PR #98](https://github.com/apollographql/graphql-tag/pull/98) + +### v2.2.2 + +* Make parsing line endings kind agnostic [vlasenko](https://github.com/vlasenko) in + [PR #95](https://github.com/apollographql/graphql-tag/pull/95) + +### v2.2.1 + +* Fix #61: split('/n') does not work on Windows [dnalborczyk](https://github.com/dnalborczyk) in + [PR #89](https://github.com/apollographql/graphql-tag/pull/89) + +### v2.2.0 + +* Bumping `graphql` peer dependency to ^0.10.0 [dotansimha](https://github.com/dotansimha) in + [PR #85](https://github.com/apollographql/graphql-tag/pull/85) + +### v2.1.0 + +* Add support for calling `gql` as a function [matthewerwin](https://github.com/matthewerwin) in + [PR #66](https://github.com/apollographql/graphql-tag/pull/66) +* Including yarn.lock file [PowerKiKi](https://github.com/PowerKiKi) in + [PR #72](https://github.com/apollographql/graphql-tag/pull/72) +* Ignore duplicate fragments when using the Webpack loader [czert](https://github.com/czert) in + [PR #52](https://github.com/apollographql/graphql-tag/pull/52) +* Fixing `graphql-tag/loader` by properly stringifying GraphQL Source [jnwng](https://github.com/jnwng) in + [PR #65](https://github.com/apollographql/graphql-tag/pull/65) + +### v2.0.0 + +Restore dependence on `graphql` module [abhiaiyer91](https://github.com/abhiaiyer91) in +[PR #46](https://github.com/apollographql/graphql-tag/pull/46) addressing +[#6](https://github.com/apollographql/graphql-tag/issues/6) + +* Added `graphql` as a + [peerDependency](https://github.com/apollographql/graphql-tag/commit/ac061dd16440e75c166c85b4bff5ba06c79c9356) + +### v1.3.2 + +* Add typescript definitions for the bundledPrinter [PR #63](https://github.com/apollographql/graphql-tag/pull/63) + +### v1.3.1 + +* Making sure not to log deprecation warnings for internal use of deprecated module [jnwng](https://github.com/jnwng) + addressing [#54](https://github.com/apollographql/graphql-tag/issues/54#issuecomment-283301475) + +### v1.3.0 + +* Bump bundled `graphql` packages to v0.9.1 [jnwng](https://github.com/jnwng) in + [PR #55](https://github.com/apollographql/graphql-tag/pull/55). +* Deprecate the `graphql/language/parser` and `graphql/language/printer` exports [jnwng](https://github.com/jnwng) in + [PR #55](https://github.com/apollographql/graphql-tag/pull/55) + +### v1.2.4 + +Restore Node < 6 compatibility. [DragosRotaru](https://github.com/DragosRotaru) in +[PR #41](https://github.com/apollographql/graphql-tag/pull/41) addressing +[#39](https://github.com/apollographql/graphql-tag/issues/39) + +### v1.2.1 + +Fixed an issue with fragment imports. [PR #35](https://github.com/apollostack/graphql-tag/issues/35). + +### v1.2.0 + +Added ability to import other GraphQL documents with fragments using `#import` comments. +[PR #33](https://github.com/apollostack/graphql-tag/pull/33) + +### v1.1.2 + +Fix issue with interpolating undefined values [Issue #19](https://github.com/apollostack/graphql-tag/issues/19) + +### v1.1.1 + +Added typescript definitions for the below. + +### v1.1.0 + +We now emit warnings if you use the same name for two different fragments. + +You can disable this with: + +```js +import { disableFragmentWarnings } from 'graphql-tag'; + +disableFragmentWarnings(); +``` + +### v1.0.0 + +Releasing 0.1.17 as 1.0.0 in order to be explicit about Semantic Versioning. + +### v0.1.17 + +* Allow embedding fragments inside document strings, as in + +```js +import gql from 'graphql-tag'; + +const fragment = gql` + fragment Foo on Bar { + field + } +`; + +const query = gql` +{ + ...Foo +} +${Foo} +`; +``` + +See also http://dev.apollodata.com/react/fragments.html + +### v0.1.16 + +* Add caching to Webpack loader. [PR #16](https://github.com/apollostack/graphql-tag/pull/16) + +### v0.1.15 + +* Add Webpack loader to `graphql-tag/loader`. + +### v0.1.14 + +Changes were not tracked before this version. diff --git a/node_modules/graphql-tag/CONTRIBUTING.md b/node_modules/graphql-tag/CONTRIBUTING.md new file mode 100644 index 000000000..651c0717c --- /dev/null +++ b/node_modules/graphql-tag/CONTRIBUTING.md @@ -0,0 +1,82 @@ +# Apollo Contributor Guide + +Excited about Apollo and want to make it better? We’re excited too! + +Apollo is a community of developers just like you, striving to create the best tools and libraries around GraphQL. We welcome anyone who wants to contribute or provide constructive feedback, no matter the age or level of experience. If you want to help but don't know where to start, let us know, and we'll find something for you. + +Oh, and if you haven't already, sign up for the [Apollo Slack](http://www.apollodata.com/#slack). + +Here are some ways to contribute to the project, from easiest to most difficult: + +* [Reporting bugs](#reporting-bugs) +* [Improving the documentation](#improving-the-documentation) +* [Responding to issues](#responding-to-issues) +* [Small bug fixes](#small-bug-fixes) +* [Suggesting features](#suggesting-features) +* [Big pull requests](#big-prs) + +## Issues + +### Reporting bugs + +If you encounter a bug, please file an issue on GitHub via the repository of the sub-project you think contains the bug. If an issue you have is already reported, please add additional information or add a 👍 reaction to indicate your agreement. + +While we will try to be as helpful as we can on any issue reported, please include the following to maximize the chances of a quick fix: + +1. **Intended outcome:** What you were trying to accomplish when the bug occurred, and as much code as possible related to the source of the problem. +2. **Actual outcome:** A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”. +3. **How to reproduce the issue:** Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be. + +Creating a good reproduction really helps contributors investigate and resolve your issue quickly. In many cases, the act of creating a minimal reproduction illuminates that the source of the bug was somewhere outside the library in question, saving time and effort for everyone. + +### Improving the documentation + +Improving the documentation, examples, and other open source content can be the easiest way to contribute to the library. If you see a piece of content that can be better, open a PR with an improvement, no matter how small! If you would like to suggest a big change or major rewrite, we’d love to hear your ideas but please open an issue for discussion before writing the PR. + +### Responding to issues + +In addition to reporting issues, a great way to contribute to Apollo is to respond to other peoples' issues and try to identify the problem or help them work around it. If you’re interested in taking a more active role in this process, please go ahead and respond to issues. And don't forget to say "Hi" on Apollo Slack! + +### Small bug fixes + +For a small bug fix change (less than 20 lines of code changed), feel free to open a pull request. We’ll try to merge it as fast as possible and ideally publish a new release on the same day. The only requirement is, make sure you also add a test that verifies the bug you are trying to fix. + +### Suggesting features + +Most of the features in Apollo came from suggestions by you, the community! We welcome any ideas about how to make Apollo better for your use case. Unless there is overwhelming demand for a feature, it might not get implemented immediately, but please include as much information as possible that will help people have a discussion about your proposal: + +1. **Use case:** What are you trying to accomplish, in specific terms? Often, there might already be a good way to do what you need and a new feature is unnecessary, but it’s hard to know without information about the specific use case. +2. **Could this be a plugin?** In many cases, a feature might be too niche to be included in the core of a library, and is better implemented as a companion package. If there isn’t a way to extend the library to do what you want, could we add additional plugin APIs? It’s important to make the case for why a feature should be part of the core functionality of the library. +3. **Is there a workaround?** Is this a more convenient way to do something that is already possible, or is there some blocker that makes a workaround unfeasible? + +Feature requests will be labeled as such, and we encourage using GitHub issues as a place to discuss new features and possible implementation designs. Please refrain from submitting a pull request to implement a proposed feature until there is consensus that it should be included. This way, you can avoid putting in work that can’t be merged in. + +Once there is a consensus on the need for a new feature, proceed as listed below under “Big PRs”. + +## Big PRs + +This includes: + +- Big bug fixes +- New features + +For significant changes to a repository, it’s important to settle on a design before starting on the implementation. This way, we can make sure that major improvements get the care and attention they deserve. Since big changes can be risky and might not always get merged, it’s good to reduce the amount of possible wasted effort by agreeing on an implementation design/plan first. + +1. **Open an issue.** Open an issue about your bug or feature, as described above. +2. **Reach consensus.** Some contributors and community members should reach an agreement that this feature or bug is important, and that someone should work on implementing or fixing it. +3. **Agree on intended behavior.** On the issue, reach an agreement about the desired behavior. In the case of a bug fix, it should be clear what it means for the bug to be fixed, and in the case of a feature, it should be clear what it will be like for developers to use the new feature. +4. **Agree on implementation plan.** Write a plan for how this feature or bug fix should be implemented. What modules need to be added or rewritten? Should this be one pull request or multiple incremental improvements? Who is going to do each part? +5. **Submit PR.** In the case where multiple dependent patches need to be made to implement the change, only submit one at a time. Otherwise, the others might get stale while the first is reviewed and merged. Make sure to avoid “while we’re here” type changes - if something isn’t relevant to the improvement at hand, it should be in a separate PR; this especially includes code style changes of unrelated code. +6. **Review.** At least one core contributor should sign off on the change before it’s merged. Look at the “code review” section below to learn about factors are important in the code review. If you want to expedite the code being merged, try to review your own code first! +7. **Merge and release!** + +### Code review guidelines + +It’s important that every piece of code in Apollo packages is reviewed by at least one core contributor familiar with that codebase. Here are some things we look for: + +1. **Required CI checks pass.** This is a prerequisite for the review, and it is the PR author's responsibility. As long as the tests don’t pass, the PR won't get reviewed. +2. **Simplicity.** Is this the simplest way to achieve the intended goal? If there are too many files, redundant functions, or complex lines of code, suggest a simpler way to do the same thing. In particular, avoid implementing an overly general solution when a simple, small, and pragmatic fix will do. +3. **Testing.** Do the tests ensure this code won’t break when other stuff changes around it? When it does break, will the tests added help us identify which part of the library has the problem? Did we cover an appropriate set of edge cases? Look at the test coverage report if there is one. Are all significant code paths in the new code exercised at least once? +4. **No unnecessary or unrelated changes.** PRs shouldn’t come with random formatting changes, especially in unrelated parts of the code. If there is some refactoring that needs to be done, it should be in a separate PR from a bug fix or feature, if possible. +5. **Code has appropriate comments.** Code should be commented, or written in a clear “self-documenting” way. +6. **Idiomatic use of the language.** In TypeScript, make sure the typings are specific and correct. In ES2015, make sure to use imports rather than require and const instead of var, etc. Ideally a linter enforces a lot of this, but use your common sense and follow the style of the surrounding code. diff --git a/node_modules/graphql-tag/LICENSE b/node_modules/graphql-tag/LICENSE new file mode 100644 index 000000000..1de6fdffd --- /dev/null +++ b/node_modules/graphql-tag/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 - 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/graphql-tag/README.md b/node_modules/graphql-tag/README.md new file mode 100644 index 000000000..f825fdef3 --- /dev/null +++ b/node_modules/graphql-tag/README.md @@ -0,0 +1,164 @@ +# graphql-tag +[![npm version](https://badge.fury.io/js/graphql-tag.svg)](https://badge.fury.io/js/graphql-tag) +[![Build Status](https://travis-ci.org/apollographql/graphql-tag.svg?branch=master)](https://travis-ci.org/apollographql/graphql-tag) +[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollodata.com/#slack) + +Helpful utilities for parsing GraphQL queries. Includes: + +- `gql` A JavaScript template literal tag that parses GraphQL query strings into the standard GraphQL AST. +- `/loader` A webpack loader to preprocess queries + +`graphql-tag` uses [the reference `graphql` library](https://github.com/graphql/graphql-js) under the hood as a peer dependency, so in addition to installing this module, you'll also have to install `graphql-js`. + +### gql + +This is a template literal tag you can use to concisely write a GraphQL query that is parsed into the standard GraphQL AST: + +```js +import gql from 'graphql-tag'; + +const query = gql` + { + user(id: 5) { + firstName + lastName + } + } +` + +// query is now a GraphQL syntax tree object +console.log(query); + +// { +// "kind": "Document", +// "definitions": [ +// { +// "kind": "OperationDefinition", +// "operation": "query", +// "name": null, +// "variableDefinitions": null, +// "directives": [], +// "selectionSet": { +// "kind": "SelectionSet", +// "selections": [ +// { +// "kind": "Field", +// "alias": null, +// "name": { +// "kind": "Name", +// "value": "user", +// ... +``` + +You can easily explore GraphQL ASTs on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1). + +This package is the way to pass queries into [Apollo Client](https://github.com/apollostack/apollo-client). If you're building a GraphQL client, you can use it too! + +#### Why use this? + +GraphQL strings are the right way to write queries in your code, because they can be statically analyzed using tools like [eslint-plugin-graphql](https://github.com/apollostack/eslint-plugin-graphql). However, strings are inconvenient to manipulate, if you are trying to do things like add extra fields, merge multiple queries together, or other interesting stuff. + +That's where this package comes in - it lets you write your queries with [ES2015 template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) and compile them into an AST with the `gql` tag. + +#### Caching parse results + +This package only has one feature - it caches previous parse results in a simple dictionary. This means that if you call the tag on the same query multiple times, it doesn't waste time parsing it again. It also means you can use `===` to compare queries to check if they are identical. + +### Babel preprocessing + +GraphQL queries can be compiled at build time using [babel-plugin-graphql-tag](https://github.com/gajus/babel-plugin-graphql-tag). Pre-compiling queries decreases the script initialization time and reduces the bundle size by potentially removing the need for `graphql-tag` at runtime. + +#### TypeScript +Try this custom transformer to pre-compile your GraphQL queries in TypeScript: [ts-transform-graphql-tag](https://github.com/firede/ts-transform-graphql-tag). + +#### React Native, Next.js + +Additionally, in certain situations, preprocessing queries via the webpack loader is not possible. [babel-plugin-import-graphql](https://www.npmjs.com/package/babel-plugin-import-graphql) will allow one to import graphql files directly into your JavaScript by preprocessing GraphQL queries into ASTs at compile-time. + +E.g.: +```javascript +import myImportedQuery from './productsQuery.graphql' + +class ProductsPage extends React.Component { + ... +} +``` + +#### Create-React-App + +`create-react-app@2.0.0` will [support the ability to preprocess queries](https://github.com/facebook/create-react-app/pull/3909) using `graphql-tag/loader` without the need to eject. + +If you're using an older version of `create-react-app`, check out [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast) to preprocess queries without needing to eject. + +### Webpack preprocessing with `graphql-tag/loader` + +This package also includes a [webpack loader](https://webpack.js.org/concepts/loaders). There are many benefits over this approach, which saves GraphQL ASTs processing time on client-side and enable queries to be separated from script over `.graphql` files. + +```js +loaders: [ + { + test: /\.(graphql|gql)$/, + exclude: /node_modules/, + loader: 'graphql-tag/loader' + } +] +``` + +then: + +```js +import query from './query.graphql'; + +console.log(query); +// { +// "kind": "Document", +// ... +``` + +Testing environments that don't support Webpack require additional configuration. For [Jest](https://facebook.github.io/jest/) use [jest-transform-graphql](https://github.com/remind101/jest-transform-graphql). + +#### Support for multiple operations + +With the webpack loader, you can also import operations by name: + +In a file called `query.gql`: +```graphql +query MyQuery1 { + ... +} + +query MyQuery2 { + ... +} +``` + +And in your JavaScript: +```javascript +import { MyQuery1, MyQuery2 } from 'query.gql' +``` + +### Warnings + +This package will emit a warning if you have multiple fragments of the same name. You can disable this with: + +```js +import { disableFragmentWarnings } from 'graphql-tag'; + +disableFragmentWarnings() +``` + +### Experimental Fragment Variables + +This package exports an `experimentalFragmentVariables` flag that allows you to use experimental support for [parameterized fragments](https://github.com/facebook/graphql/issues/204). + +You can enable / disable this with: +```js +import { enableExperimentalFragmentVariables, disableExperimentalFragmentVariables } from 'graphql-tag'; +``` + +Enabling this feature allows you declare documents of the form +```graphql +fragment SomeFragment ($arg: String!) on SomeType { + someField +} +``` diff --git a/node_modules/graphql-tag/index.d.ts b/node_modules/graphql-tag/index.d.ts new file mode 100644 index 000000000..d010ae401 --- /dev/null +++ b/node_modules/graphql-tag/index.d.ts @@ -0,0 +1,3 @@ +export default function gql(literals: any, ...placeholders: any[]): any; +export function resetCaches(): void; +export function disableFragmentWarnings(): void; diff --git a/node_modules/graphql-tag/lib/graphql-tag.umd.js b/node_modules/graphql-tag/lib/graphql-tag.umd.js new file mode 100644 index 000000000..e05e8fe79 --- /dev/null +++ b/node_modules/graphql-tag/lib/graphql-tag.umd.js @@ -0,0 +1,189 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory() : + typeof define === 'function' && define.amd ? define(factory) : + (factory()); +}(this, (function () { 'use strict'; + +var parser = require('graphql/language/parser'); + +var parse = parser.parse; + +// Strip insignificant whitespace +// Note that this could do a lot more, such as reorder fields etc. +function normalize(string) { + return string.replace(/[\s,]+/g, ' ').trim(); +} + +// A map docString -> graphql document +var docCache = {}; + +// A map fragmentName -> [normalized source] +var fragmentSourceMap = {}; + +function cacheKeyFromLoc(loc) { + return normalize(loc.source.body.substring(loc.start, loc.end)); +} + +// For testing. +function resetCaches() { + docCache = {}; + fragmentSourceMap = {}; +} + +// Take a unstripped parsed document (query/mutation or even fragment), and +// check all fragment definitions, checking for name->source uniqueness. +// We also want to make sure only unique fragments exist in the document. +var printFragmentWarnings = true; +function processFragments(ast) { + var astFragmentMap = {}; + var definitions = []; + + for (var i = 0; i < ast.definitions.length; i++) { + var fragmentDefinition = ast.definitions[i]; + + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); + + // We know something about this fragment + if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) { + + // this is a problem because the app developer is trying to register another fragment with + // the same name as one previously registered. So, we tell them about it. + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + + fragmentSourceMap[fragmentName][sourceKey] = true; + + } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) { + fragmentSourceMap[fragmentName] = {}; + fragmentSourceMap[fragmentName][sourceKey] = true; + } + + if (!astFragmentMap[sourceKey]) { + astFragmentMap[sourceKey] = true; + definitions.push(fragmentDefinition); + } + } else { + definitions.push(fragmentDefinition); + } + } + + ast.definitions = definitions; + return ast; +} + +function disableFragmentWarnings() { + printFragmentWarnings = false; +} + +function stripLoc(doc, removeLocAtThisLevel) { + var docType = Object.prototype.toString.call(doc); + + if (docType === '[object Array]') { + return doc.map(function (d) { + return stripLoc(d, removeLocAtThisLevel); + }); + } + + if (docType !== '[object Object]') { + throw new Error('Unexpected input.'); + } + + // We don't want to remove the root loc field so we can use it + // for fragment substitution (see below) + if (removeLocAtThisLevel && doc.loc) { + delete doc.loc; + } + + // https://github.com/apollographql/graphql-tag/issues/40 + if (doc.loc) { + delete doc.loc.startToken; + delete doc.loc.endToken; + } + + var keys = Object.keys(doc); + var key; + var value; + var valueType; + + for (key in keys) { + if (keys.hasOwnProperty(key)) { + value = doc[keys[key]]; + valueType = Object.prototype.toString.call(value); + + if (valueType === '[object Object]' || valueType === '[object Array]') { + doc[keys[key]] = stripLoc(value, true); + } + } + } + + return doc; +} + +var experimentalFragmentVariables = false; +function parseDocument(doc) { + var cacheKey = normalize(doc); + + if (docCache[cacheKey]) { + return docCache[cacheKey]; + } + + var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables }); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + + // check that all "new" fragments inside the documents are consistent with + // existing fragments of the same name + parsed = processFragments(parsed); + parsed = stripLoc(parsed, false); + docCache[cacheKey] = parsed; + + return parsed; +} + +function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; +} + +function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; +} + +// XXX This should eventually disallow arbitrary string interpolation, like Relay does +function gql(/* arguments */) { + var args = Array.prototype.slice.call(arguments); + + var literals = args[0]; + + // We always get literals[0] and then matching post literals for each arg given + var result = (typeof(literals) === "string") ? literals : literals[0]; + + for (var i = 1; i < args.length; i++) { + if (args[i] && args[i].kind && args[i].kind === 'Document') { + result += args[i].loc.source.body; + } else { + result += args[i]; + } + + result += literals[i]; + } + + return parseDocument(result); +} + +// Support typescript, which isn't as nice as Babel about default exports +gql.default = gql; +gql.resetCaches = resetCaches; +gql.disableFragmentWarnings = disableFragmentWarnings; +gql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables; +gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables; + +module.exports = gql; + +}))); +//# sourceMappingURL=graphql-tag.umd.js.map diff --git a/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow b/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow new file mode 100644 index 000000000..7acb6237a --- /dev/null +++ b/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow @@ -0,0 +1,7 @@ +// @flow + +import type { DocumentNode } from 'graphql'; + +declare export default function gql(literals: any, ...placeholders: any[]): DocumentNode; +declare export function resetCaches(): void; +declare export function disableFragmentWarnings(): void; diff --git a/node_modules/graphql-tag/lib/graphql-tag.umd.js.map b/node_modules/graphql-tag/lib/graphql-tag.umd.js.map new file mode 100644 index 000000000..f5fe04c0d --- /dev/null +++ b/node_modules/graphql-tag/lib/graphql-tag.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.js"],"sourcesContent":["var parser = require('graphql/language/parser');\n\nvar parse = parser.parse;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\n// A map docString -> graphql document\nvar docCache = {};\n\n// A map fragmentName -> [normalized source]\nvar fragmentSourceMap = {};\n\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\n\n// For testing.\nfunction resetCaches() {\n docCache = {};\n fragmentSourceMap = {};\n}\n\n// Take a unstripped parsed document (query/mutation or even fragment), and\n// check all fragment definitions, checking for name->source uniqueness.\n// We also want to make sure only unique fragments exist in the document.\nvar printFragmentWarnings = true;\nfunction processFragments(ast) {\n var astFragmentMap = {};\n var definitions = [];\n\n for (var i = 0; i < ast.definitions.length; i++) {\n var fragmentDefinition = ast.definitions[i];\n\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n\n // We know something about this fragment\n if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {\n\n // this is a problem because the app developer is trying to register another fragment with\n // the same name as one previously registered. So, we tell them about it.\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n\n fragmentSourceMap[fragmentName][sourceKey] = true;\n\n } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {\n fragmentSourceMap[fragmentName] = {};\n fragmentSourceMap[fragmentName][sourceKey] = true;\n }\n\n if (!astFragmentMap[sourceKey]) {\n astFragmentMap[sourceKey] = true;\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n }\n\n ast.definitions = definitions;\n return ast;\n}\n\nfunction disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nfunction stripLoc(doc, removeLocAtThisLevel) {\n var docType = Object.prototype.toString.call(doc);\n\n if (docType === '[object Array]') {\n return doc.map(function (d) {\n return stripLoc(d, removeLocAtThisLevel);\n });\n }\n\n if (docType !== '[object Object]') {\n throw new Error('Unexpected input.');\n }\n\n // We don't want to remove the root loc field so we can use it\n // for fragment substitution (see below)\n if (removeLocAtThisLevel && doc.loc) {\n delete doc.loc;\n }\n\n // https://github.com/apollographql/graphql-tag/issues/40\n if (doc.loc) {\n delete doc.loc.startToken;\n delete doc.loc.endToken;\n }\n\n var keys = Object.keys(doc);\n var key;\n var value;\n var valueType;\n\n for (key in keys) {\n if (keys.hasOwnProperty(key)) {\n value = doc[keys[key]];\n valueType = Object.prototype.toString.call(value);\n\n if (valueType === '[object Object]' || valueType === '[object Array]') {\n doc[keys[key]] = stripLoc(value, true);\n }\n }\n }\n\n return doc;\n}\n\nvar experimentalFragmentVariables = false;\nfunction parseDocument(doc) {\n var cacheKey = normalize(doc);\n\n if (docCache[cacheKey]) {\n return docCache[cacheKey];\n }\n\n var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n parsed = processFragments(parsed);\n parsed = stripLoc(parsed, false);\n docCache[cacheKey] = parsed;\n\n return parsed;\n}\n\nfunction enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nfunction disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nfunction gql(/* arguments */) {\n var args = Array.prototype.slice.call(arguments);\n\n var literals = args[0];\n\n // We always get literals[0] and then matching post literals for each arg given\n var result = (typeof(literals) === \"string\") ? literals : literals[0];\n\n for (var i = 1; i < args.length; i++) {\n if (args[i] && args[i].kind && args[i].kind === 'Document') {\n result += args[i].loc.source.body;\n } else {\n result += args[i];\n }\n\n result += literals[i];\n }\n\n return parseDocument(result);\n}\n\n// Support typescript, which isn't as nice as Babel about default exports\ngql.default = gql;\ngql.resetCaches = resetCaches;\ngql.disableFragmentWarnings = disableFragmentWarnings;\ngql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;\ngql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;\n\nmodule.exports = gql;\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;;AAEhD,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;;;;AAIzB,SAAS,SAAS,CAAC,MAAM,EAAE;EACzB,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;CAC9C;;;AAGD,IAAI,QAAQ,GAAG,EAAE,CAAC;;;AAGlB,IAAI,iBAAiB,GAAG,EAAE,CAAC;;AAE3B,SAAS,eAAe,CAAC,GAAG,EAAE;EAC5B,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;CACjE;;;AAGD,SAAS,WAAW,GAAG;EACrB,QAAQ,GAAG,EAAE,CAAC;EACd,iBAAiB,GAAG,EAAE,CAAC;CACxB;;;;;AAKD,IAAI,qBAAqB,GAAG,IAAI,CAAC;AACjC,SAAS,gBAAgB,CAAC,GAAG,EAAE;EAC7B,IAAI,cAAc,GAAG,EAAE,CAAC;EACxB,IAAI,WAAW,GAAG,EAAE,CAAC;;EAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IAC/C,IAAI,kBAAkB,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;;IAE5C,IAAI,kBAAkB,CAAC,IAAI,KAAK,oBAAoB,EAAE;MACpD,IAAI,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC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C,CAAC,CAAC,CAAC;GACvB;;EAED,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B;;;AAGD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC;AAClB,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;AAC9B,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;AACtD,GAAG,CAAC,mCAAmC,GAAG,mCAAmC,CAAC;AAC9E,GAAG,CAAC,oCAAoC,GAAG,oCAAoC,CAAC;;AAEhF,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/graphql-tag/loader.js b/node_modules/graphql-tag/loader.js new file mode 100644 index 000000000..4ceac4d32 --- /dev/null +++ b/node_modules/graphql-tag/loader.js @@ -0,0 +1,190 @@ +"use strict"; + +const os = require('os'); +const gql = require('./src'); + +// Takes `source` (the source GraphQL query string) +// and `doc` (the parsed GraphQL document) and tacks on +// the imported definitions. +function expandImports(source, doc) { + const lines = source.split(/\r\n|\r|\n/); + let outputCode = ` + var names = {}; + function unique(defs) { + return defs.filter( + function(def) { + if (def.kind !== 'FragmentDefinition') return true; + var name = def.name.value + if (names[name]) { + return false; + } else { + names[name] = true; + return true; + } + } + ) + } + `; + + lines.some((line) => { + if (line[0] === '#' && line.slice(1).split(' ')[0] === 'import') { + const importFile = line.slice(1).split(' ')[1]; + const parseDocument = `require(${importFile})`; + const appendDef = `doc.definitions = doc.definitions.concat(unique(${parseDocument}.definitions));`; + outputCode += appendDef + os.EOL; + } + return (line.length !== 0 && line[0] !== '#'); + }); + + return outputCode; +} + +module.exports = function(source) { + this.cacheable(); + const doc = gql`${source}`; + let headerCode = ` + var doc = ${JSON.stringify(doc)}; + doc.loc.source = ${JSON.stringify(doc.loc.source)}; + `; + + let outputCode = ""; + + // Allow multiple query/mutation definitions in a file. This parses out dependencies + // at compile time, and then uses those at load time to create minimal query documents + // We cannot do the latter at compile time due to how the #import code works. + let operationCount = doc.definitions.reduce(function(accum, op) { + if (op.kind === "OperationDefinition") { + return accum + 1; + } + + return accum; + }, 0); + + if (operationCount < 1) { + outputCode += ` + module.exports = doc; + ` + } else { + outputCode += ` + // Collect any fragment/type references from a node, adding them to the refs Set + function collectFragmentReferences(node, refs) { + if (node.kind === "FragmentSpread") { + refs.add(node.name.value); + } else if (node.kind === "VariableDefinition") { + var type = node.type; + if (type.kind === "NamedType") { + refs.add(type.name.value); + } + } + + if (node.selectionSet) { + node.selectionSet.selections.forEach(function(selection) { + collectFragmentReferences(selection, refs); + }); + } + + if (node.variableDefinitions) { + node.variableDefinitions.forEach(function(def) { + collectFragmentReferences(def, refs); + }); + } + + if (node.definitions) { + node.definitions.forEach(function(def) { + collectFragmentReferences(def, refs); + }); + } + } + + var definitionRefs = {}; + (function extractReferences() { + doc.definitions.forEach(function(def) { + if (def.name) { + var refs = new Set(); + collectFragmentReferences(def, refs); + definitionRefs[def.name.value] = refs; + } + }); + })(); + + function findOperation(doc, name) { + for (var i = 0; i < doc.definitions.length; i++) { + var element = doc.definitions[i]; + if (element.name && element.name.value == name) { + return element; + } + } + } + + function oneQuery(doc, operationName) { + // Copy the DocumentNode, but clear out the definitions + var newDoc = { + kind: doc.kind, + definitions: [findOperation(doc, operationName)] + }; + if (doc.hasOwnProperty("loc")) { + newDoc.loc = doc.loc; + } + + // Now, for the operation we're running, find any fragments referenced by + // it or the fragments it references + var opRefs = definitionRefs[operationName] || new Set(); + var allRefs = new Set(); + var newRefs = new Set(); + + // IE 11 doesn't support "new Set(iterable)", so we add the members of opRefs to newRefs one by one + opRefs.forEach(function(refName) { + newRefs.add(refName); + }); + + while (newRefs.size > 0) { + var prevRefs = newRefs; + newRefs = new Set(); + + prevRefs.forEach(function(refName) { + if (!allRefs.has(refName)) { + allRefs.add(refName); + var childRefs = definitionRefs[refName] || new Set(); + childRefs.forEach(function(childRef) { + newRefs.add(childRef); + }); + } + }); + } + + allRefs.forEach(function(refName) { + var op = findOperation(doc, refName); + if (op) { + newDoc.definitions.push(op); + } + }); + + return newDoc; + } + + module.exports = doc; + ` + + for (const op of doc.definitions) { + if (op.kind === "OperationDefinition") { + if (!op.name) { + if (operationCount > 1) { + throw "Query/mutation names are required for a document with multiple definitions"; + } else { + continue; + } + } + + const opName = op.name.value; + outputCode += ` + module.exports["${opName}"] = oneQuery(doc, "${opName}"); + ` + } + } + } + + const importOutputCode = expandImports(source, doc); + const allCode = headerCode + os.EOL + importOutputCode + os.EOL + outputCode + os.EOL; + + return allCode; +}; diff --git a/node_modules/graphql-tag/package.json b/node_modules/graphql-tag/package.json new file mode 100644 index 000000000..dccbabc4e --- /dev/null +++ b/node_modules/graphql-tag/package.json @@ -0,0 +1,36 @@ +{ + "name": "graphql-tag", + "version": "2.10.1", + "description": "A JavaScript template literal tag that parses GraphQL queries", + "main": "./lib/graphql-tag.umd.js", + "module": "./src/index.js", + "jsnext:main": "./src/index.js", + "scripts": { + "bundle": "rollup -c && cp src/index.js.flow lib/graphql-tag.umd.js.flow", + "test": "mocha test/graphql.js test/graphql-v0.12.js && tav --ci --compat", + "prepublish": "npm run bundle" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/apollostack/graphql-tag.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/apollostack/graphql-tag/issues" + }, + "homepage": "https://github.com/apollostack/graphql-tag#readme", + "dependencies": {}, + "devDependencies": { + "babel-preset-es2015": "^6.9.0", + "babel-register": "^6.9.0", + "chai": "^4.0.2", + "graphql": "^14.0.2", + "mocha": "^3.4.1", + "rollup": "^0.45.0", + "test-all-versions": "^3.3.2" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + } +} diff --git a/node_modules/graphql-tag/src/index.js b/node_modules/graphql-tag/src/index.js new file mode 100644 index 000000000..f52711e4c --- /dev/null +++ b/node_modules/graphql-tag/src/index.js @@ -0,0 +1,180 @@ +var parser = require('graphql/language/parser'); + +var parse = parser.parse; + +// Strip insignificant whitespace +// Note that this could do a lot more, such as reorder fields etc. +function normalize(string) { + return string.replace(/[\s,]+/g, ' ').trim(); +} + +// A map docString -> graphql document +var docCache = {}; + +// A map fragmentName -> [normalized source] +var fragmentSourceMap = {}; + +function cacheKeyFromLoc(loc) { + return normalize(loc.source.body.substring(loc.start, loc.end)); +} + +// For testing. +function resetCaches() { + docCache = {}; + fragmentSourceMap = {}; +} + +// Take a unstripped parsed document (query/mutation or even fragment), and +// check all fragment definitions, checking for name->source uniqueness. +// We also want to make sure only unique fragments exist in the document. +var printFragmentWarnings = true; +function processFragments(ast) { + var astFragmentMap = {}; + var definitions = []; + + for (var i = 0; i < ast.definitions.length; i++) { + var fragmentDefinition = ast.definitions[i]; + + if (fragmentDefinition.kind === 'FragmentDefinition') { + var fragmentName = fragmentDefinition.name.value; + var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); + + // We know something about this fragment + if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) { + + // this is a problem because the app developer is trying to register another fragment with + // the same name as one previously registered. So, we tell them about it. + if (printFragmentWarnings) { + console.warn("Warning: fragment with name " + fragmentName + " already exists.\n" + + "graphql-tag enforces all fragment names across your application to be unique; read more about\n" + + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"); + } + + fragmentSourceMap[fragmentName][sourceKey] = true; + + } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) { + fragmentSourceMap[fragmentName] = {}; + fragmentSourceMap[fragmentName][sourceKey] = true; + } + + if (!astFragmentMap[sourceKey]) { + astFragmentMap[sourceKey] = true; + definitions.push(fragmentDefinition); + } + } else { + definitions.push(fragmentDefinition); + } + } + + ast.definitions = definitions; + return ast; +} + +function disableFragmentWarnings() { + printFragmentWarnings = false; +} + +function stripLoc(doc, removeLocAtThisLevel) { + var docType = Object.prototype.toString.call(doc); + + if (docType === '[object Array]') { + return doc.map(function (d) { + return stripLoc(d, removeLocAtThisLevel); + }); + } + + if (docType !== '[object Object]') { + throw new Error('Unexpected input.'); + } + + // We don't want to remove the root loc field so we can use it + // for fragment substitution (see below) + if (removeLocAtThisLevel && doc.loc) { + delete doc.loc; + } + + // https://github.com/apollographql/graphql-tag/issues/40 + if (doc.loc) { + delete doc.loc.startToken; + delete doc.loc.endToken; + } + + var keys = Object.keys(doc); + var key; + var value; + var valueType; + + for (key in keys) { + if (keys.hasOwnProperty(key)) { + value = doc[keys[key]]; + valueType = Object.prototype.toString.call(value); + + if (valueType === '[object Object]' || valueType === '[object Array]') { + doc[keys[key]] = stripLoc(value, true); + } + } + } + + return doc; +} + +var experimentalFragmentVariables = false; +function parseDocument(doc) { + var cacheKey = normalize(doc); + + if (docCache[cacheKey]) { + return docCache[cacheKey]; + } + + var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables }); + if (!parsed || parsed.kind !== 'Document') { + throw new Error('Not a valid GraphQL document.'); + } + + // check that all "new" fragments inside the documents are consistent with + // existing fragments of the same name + parsed = processFragments(parsed); + parsed = stripLoc(parsed, false); + docCache[cacheKey] = parsed; + + return parsed; +} + +function enableExperimentalFragmentVariables() { + experimentalFragmentVariables = true; +} + +function disableExperimentalFragmentVariables() { + experimentalFragmentVariables = false; +} + +// XXX This should eventually disallow arbitrary string interpolation, like Relay does +function gql(/* arguments */) { + var args = Array.prototype.slice.call(arguments); + + var literals = args[0]; + + // We always get literals[0] and then matching post literals for each arg given + var result = (typeof(literals) === "string") ? literals : literals[0]; + + for (var i = 1; i < args.length; i++) { + if (args[i] && args[i].kind && args[i].kind === 'Document') { + result += args[i].loc.source.body; + } else { + result += args[i]; + } + + result += literals[i]; + } + + return parseDocument(result); +} + +// Support typescript, which isn't as nice as Babel about default exports +gql.default = gql; +gql.resetCaches = resetCaches; +gql.disableFragmentWarnings = disableFragmentWarnings; +gql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables; +gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables; + +module.exports = gql; diff --git a/node_modules/graphql-tag/src/index.js.flow b/node_modules/graphql-tag/src/index.js.flow new file mode 100644 index 000000000..7acb6237a --- /dev/null +++ b/node_modules/graphql-tag/src/index.js.flow @@ -0,0 +1,7 @@ +// @flow + +import type { DocumentNode } from 'graphql'; + +declare export default function gql(literals: any, ...placeholders: any[]): DocumentNode; +declare export function resetCaches(): void; +declare export function disableFragmentWarnings(): void; diff --git a/node_modules/graphql-tag/test/graphql-v0.11.js b/node_modules/graphql-tag/test/graphql-v0.11.js new file mode 100644 index 000000000..ce607bcba --- /dev/null +++ b/node_modules/graphql-tag/test/graphql-v0.11.js @@ -0,0 +1,137 @@ +const gqlRequire = require("../src"); +const gqlDefault = require("../src").default; +const assert = require("chai").assert; + +[gqlRequire, gqlDefault].forEach((gql, i) => { + describe(`gql ${i}`, () => { + it("is correct for a simple query", () => { + const ast = gql` + { + user(id: 5) { + firstName + lastName + } + } + `; + + assert.equal(ast.kind, "Document"); + assert.deepEqual(ast.definitions, [ + { + kind: "OperationDefinition", + operation: "query", + name: null, + variableDefinitions: null, + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: null, + name: { + kind: "Name", + value: "user" + }, + arguments: [ + { + kind: "Argument", + name: { + kind: "Name", + value: "id" + }, + value: { + kind: "IntValue", + value: "5" + } + } + ], + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: null, + name: { + kind: "Name", + value: "firstName" + }, + arguments: [], + directives: [], + selectionSet: null + }, + { + kind: "Field", + alias: null, + name: { + kind: "Name", + value: "lastName" + }, + arguments: [], + directives: [], + selectionSet: null + } + ] + } + } + ] + } + } + ]); + }); + it("is correct for a fragment", () => { + const ast = gql` + fragment UserFragment on User { + firstName + lastName + } + `; + + assert.equal(ast.kind, "Document"); + assert.deepEqual(ast.definitions, [ + { + kind: "FragmentDefinition", + name: { + kind: "Name", + value: "UserFragment" + }, + typeCondition: { + kind: "NamedType", + name: { + kind: "Name", + value: "User" + } + }, + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: null, + name: { + kind: "Name", + value: "firstName" + }, + arguments: [], + directives: [], + selectionSet: null + }, + { + kind: "Field", + alias: null, + name: { + kind: "Name", + value: "lastName" + }, + arguments: [], + directives: [], + selectionSet: null + } + ] + } + } + ]); + }); + }); +}); diff --git a/node_modules/graphql-tag/test/graphql-v0.12.js b/node_modules/graphql-tag/test/graphql-v0.12.js new file mode 100644 index 000000000..cd41e6854 --- /dev/null +++ b/node_modules/graphql-tag/test/graphql-v0.12.js @@ -0,0 +1,138 @@ +const gqlRequire = require("../src"); +const gqlDefault = require("../src").default; +const assert = require("chai").assert; + +[gqlRequire, gqlDefault].forEach((gql, i) => { + describe(`gql ${i}`, () => { + it("is correct for a simple query", () => { + const ast = gql` + { + user(id: 5) { + firstName + lastName + } + } + `; + + assert.equal(ast.kind, "Document"); + assert.deepEqual(ast.definitions, [ + { + kind: "OperationDefinition", + operation: "query", + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: undefined, + name: { + kind: "Name", + value: "user" + }, + arguments: [ + { + kind: "Argument", + name: { + kind: "Name", + value: "id" + }, + value: { + kind: "IntValue", + value: "5" + } + } + ], + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: undefined, + name: { + kind: "Name", + value: "firstName" + }, + arguments: [], + directives: [], + selectionSet: undefined + }, + { + kind: "Field", + alias: undefined, + name: { + kind: "Name", + value: "lastName" + }, + arguments: [], + directives: [], + selectionSet: undefined + } + ] + } + } + ] + } + } + ]); + }); + + it("is correct for a fragment", () => { + const ast = gql` + fragment UserFragment on User { + firstName + lastName + } + `; + + assert.equal(ast.kind, "Document"); + assert.deepEqual(ast.definitions, [ + { + kind: "FragmentDefinition", + name: { + kind: "Name", + value: "UserFragment" + }, + typeCondition: { + kind: "NamedType", + name: { + kind: "Name", + value: "User" + } + }, + directives: [], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + alias: undefined, + name: { + kind: "Name", + value: "firstName" + }, + arguments: [], + directives: [], + selectionSet: undefined + }, + { + kind: "Field", + alias: undefined, + name: { + kind: "Name", + value: "lastName" + }, + arguments: [], + directives: [], + selectionSet: undefined + } + ] + } + } + ]); + }); + }); +}); diff --git a/node_modules/graphql-tag/test/graphql.js b/node_modules/graphql-tag/test/graphql.js new file mode 100644 index 000000000..726e3918f --- /dev/null +++ b/node_modules/graphql-tag/test/graphql.js @@ -0,0 +1,465 @@ +const gqlRequire = require('../src'); +const gqlDefault = require('../src').default; +const loader = require('../loader'); +const assert = require('chai').assert; + +[gqlRequire, gqlDefault].forEach((gql, i) => { + describe(`gql ${i}`, () => { + it('parses queries', () => { + assert.equal(gql`{ testQuery }`.kind, 'Document'); + }); + + it('parses queries when called as a function', () => { + assert.equal(gql('{ testQuery }').kind, 'Document'); + }); + + it('parses queries with weird substitutions', () => { + const obj = {}; + assert.equal(gql`{ field(input: "${obj.missing}") }`.kind, 'Document'); + assert.equal(gql`{ field(input: "${null}") }`.kind, 'Document'); + assert.equal(gql`{ field(input: "${0}") }`.kind, 'Document'); + }); + + it('allows interpolation of documents generated by the webpack loader', () => { + const sameFragment = "fragment SomeFragmentName on SomeType { someField }"; + + const jsSource = loader.call( + { cacheable() {} }, + "fragment SomeFragmentName on SomeType { someField }" + ); + const module = { exports: undefined }; + eval(jsSource); + + const document = gql`query { ...SomeFragmentName } ${module.exports}`; + assert.equal(document.kind, 'Document'); + assert.equal(document.definitions.length, 2); + assert.equal(document.definitions[0].kind, 'OperationDefinition'); + assert.equal(document.definitions[1].kind, 'FragmentDefinition'); + }); + + it('parses queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, '{ testQuery }'); + const module = { exports: undefined }; + eval(jsSource); + assert.equal(module.exports.kind, 'Document'); + }); + + it('parses single query through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + `); + const module = { exports: undefined }; + eval(jsSource); + + assert.equal(module.exports.kind, 'Document'); + assert.exists(module.exports.Q1); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + }); + + it('parses single query and exports as default', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + `); + const module = { exports: undefined }; + eval(jsSource); + + assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); + }); + + it('parses multiple queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + query Q2 { testQuery2 } + `); + const module = { exports: undefined }; + eval(jsSource); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.equal(module.exports.Q1.kind, 'Document'); + assert.equal(module.exports.Q2.kind, 'Document'); + assert.equal(module.exports.Q1.definitions.length, 1); + assert.equal(module.exports.Q2.definitions.length, 1); + }); + + it('parses fragments with variable definitions', () => { + gql.enableExperimentalFragmentVariables(); + + const parsed = gql`fragment A ($arg: String!) on Type { testQuery }`; + assert.equal(parsed.kind, 'Document'); + assert.exists(parsed.definitions[0].variableDefinitions); + + gql.disableExperimentalFragmentVariables() + }); + + // see https://github.com/apollographql/graphql-tag/issues/168 + it('does not nest queries needlessly in named exports', () => { + const jsSource = loader.call({ cacheable() {} }, ` + query Q1 { testQuery } + query Q2 { testQuery2 } + query Q3 { test Query3 } + `); + const module = { exports: undefined }; + eval(jsSource); + + assert.notExists(module.exports.Q2.Q1); + assert.notExists(module.exports.Q3.Q1); + assert.notExists(module.exports.Q3.Q2); + }); + + it('tracks fragment dependencies from multiple queries through webpack loader', () => { + const jsSource = loader.call({ cacheable() {} }, ` + fragment F1 on F { testQuery } + fragment F2 on F { testQuery2 } + fragment F3 on F { testQuery3 } + query Q1 { ...F1 } + query Q2 { ...F2 } + query Q3 { + ...F1 + ...F2 + } + `); + const module = { exports: undefined }; + eval(jsSource); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + assert.exists(module.exports.Q3); + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + const Q3 = module.exports.Q3.definitions; + + assert.equal(Q1.length, 2); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F1'); + + assert.equal(Q2.length, 2); + assert.equal(Q2[0].name.value, 'Q2'); + assert.equal(Q2[1].name.value, 'F2'); + + assert.equal(Q3.length, 3); + assert.equal(Q3[0].name.value, 'Q3'); + assert.equal(Q3[1].name.value, 'F1'); + assert.equal(Q3[2].name.value, 'F2'); + + }); + + it('tracks fragment dependencies across nested fragments', () => { + const jsSource = loader.call({ cacheable() {} }, ` + fragment F11 on F { testQuery } + fragment F22 on F { + ...F11 + testQuery2 + } + fragment F33 on F { + ...F22 + testQuery3 + } + + query Q1 { + ...F33 + } + + query Q2 { + id + } + `); + + const module = { exports: undefined }; + eval(jsSource); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + + assert.equal(Q1.length, 4); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F33'); + assert.equal(Q1[2].name.value, 'F22'); + assert.equal(Q1[3].name.value, 'F11'); + + assert.equal(Q2.length, 1); + }); + + it('correctly imports other files through the webpack loader', () => { + const query = `#import "./fragment_definition.graphql" + query { + author { + ...authorDetails + } + }`; + const jsSource = loader.call({ cacheable() {} }, query); + const oldRequire = require; + const module = { exports: undefined }; + const require = (path) => { + assert.equal(path, './fragment_definition.graphql'); + return gql` + fragment authorDetails on Author { + firstName + lastName + }`; + }; + eval(jsSource); + assert.equal(module.exports.kind, 'Document'); + const definitions = module.exports.definitions; + assert.equal(definitions.length, 2); + assert.equal(definitions[0].kind, 'OperationDefinition'); + assert.equal(definitions[1].kind, 'FragmentDefinition'); + }); + + it('tracks fragment dependencies across fragments loaded via the webpack loader', () => { + const query = `#import "./fragment_definition.graphql" + fragment F111 on F { + ...F222 + } + + query Q1 { + ...F111 + } + + query Q2 { + a + } + `; + const jsSource = loader.call({ cacheable() {} }, query); + const oldRequire = require; + const module = { exports: undefined }; + const require = (path) => { + assert.equal(path, './fragment_definition.graphql'); + return gql` + fragment F222 on F { + f1 + f2 + }`; + }; + eval(jsSource); + + assert.exists(module.exports.Q1); + assert.exists(module.exports.Q2); + + const Q1 = module.exports.Q1.definitions; + const Q2 = module.exports.Q2.definitions; + + assert.equal(Q1.length, 3); + assert.equal(Q1[0].name.value, 'Q1'); + assert.equal(Q1[1].name.value, 'F111'); + assert.equal(Q1[2].name.value, 'F222'); + + assert.equal(Q2.length, 1); + }); + + it('does not complain when presented with normal comments', (done) => { + assert.doesNotThrow(() => { + const query = `#normal comment + query { + author { + ...authorDetails + } + }`; + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: undefined }; + eval(jsSource); + assert.equal(module.exports.kind, 'Document'); + done(); + }); + }); + + it('returns the same object for the same query', () => { + assert.isTrue(gql`{ sameQuery }` === gql`{ sameQuery }`); + }); + + it('returns the same object for the same query, even with whitespace differences', () => { + assert.isTrue(gql`{ sameQuery }` === gql` { sameQuery, }`); + }); + + const fragmentAst = gql` + fragment UserFragment on User { + firstName + lastName + } + `; + + it('returns the same object for the same fragment', () => { + assert.isTrue(gql`fragment same on Same { sameQuery }` === + gql`fragment same on Same { sameQuery }`); + }); + + it('returns the same object for the same document with substitution', () => { + // We know that calling `gql` on a fragment string will always return + // the same document, so we can reuse `fragmentAst` + assert.isTrue(gql`{ ...UserFragment } ${fragmentAst}` === + gql`{ ...UserFragment } ${fragmentAst}`); + }); + + it('can reference a fragment that references as fragment', () => { + const secondFragmentAst = gql` + fragment SecondUserFragment on User { + ...UserFragment + } + ${fragmentAst} + `; + + const ast = gql` + { + user(id: 5) { + ...SecondUserFragment + } + } + ${secondFragmentAst} + `; + + assert.deepEqual(ast, gql` + { + user(id: 5) { + ...SecondUserFragment + } + } + fragment SecondUserFragment on User { + ...UserFragment + } + fragment UserFragment on User { + firstName + lastName + } + `); + }); + + describe('fragment warnings', () => { + let warnings = []; + const oldConsoleWarn = console.warn; + beforeEach(() => { + gqlRequire.resetCaches(); + warnings = []; + console.warn = (w) => warnings.push(w); + }); + afterEach(() => { + console.warn = oldConsoleWarn; + }); + + it('warns if you use the same fragment name for different fragments', () => { + const frag1 = gql`fragment TestSame on Bar { fieldOne }`; + const frag2 = gql`fragment TestSame on Bar { fieldTwo }`; + + assert.isFalse(frag1 === frag2); + assert.equal(warnings.length, 1); + }); + + it('does not warn if you use the same fragment name for the same fragment', () => { + const frag1 = gql`fragment TestDifferent on Bar { fieldOne }`; + const frag2 = gql`fragment TestDifferent on Bar { fieldOne }`; + + assert.isTrue(frag1 === frag2); + assert.equal(warnings.length, 0); + }); + + it('does not warn if you use the same embedded fragment in two different queries', () => { + const frag1 = gql`fragment TestEmbedded on Bar { field }`; + const query1 = gql`{ bar { fieldOne ...TestEmbedded } } ${frag1}`; + const query2 = gql`{ bar { fieldTwo ...TestEmbedded } } ${frag1}`; + + assert.isFalse(query1 === query2); + assert.equal(warnings.length, 0); + }); + + it('does not warn if you use the same fragment name for embedded and non-embedded fragments', () => { + const frag1 = gql`fragment TestEmbeddedTwo on Bar { field }`; + const query1 = gql`{ bar { ...TestEmbedded } } ${frag1}`; + const query2 = gql`{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }`; + + assert.equal(warnings.length, 0); + }); + }); + + describe('unique fragments', () => { + beforeEach(() => { + gqlRequire.resetCaches(); + }); + + it('strips duplicate fragments from the document', () => { + const frag1 = gql`fragment TestDuplicate on Bar { field }`; + const query1 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1} ${frag1}`; + const query2 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1}`; + + assert.equal(query1.definitions.length, 2); + assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); + // We don't test strict equality between the two queries because the source.body parsed from the + // document is not the same, but the set of definitions should be. + assert.deepEqual(query1.definitions, query2.definitions); + }); + + it('ignores duplicate fragments from second-level imports when using the webpack loader', () => { + // take a require function and a query string, use the webpack loader to process it + const load = (require, query) => { + const jsSource = loader.call({ cacheable() {} }, query); + const module = { exports: undefined }; + eval(jsSource); + return module.exports; + } + + const test_require = (path) => { + switch (path) { + case './friends.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment friends on Hero { friends { ...person } }', + ].join('\n')); + case './enemies.graphql': + return load(test_require, [ + '#import "./person.graphql"', + 'fragment enemies on Hero { enemies { ...person } }', + ].join('\n')); + case './person.graphql': + return load(test_require, 'fragment person on Person { name }\n'); + default: + return null; + }; + }; + + const result = load(test_require, [ + '#import "./friends.graphql"', + '#import "./enemies.graphql"', + 'query { hero { ...friends ...enemies } }', + ].join('\n')); + + assert.equal(result.kind, 'Document'); + assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain'); + assert.equal(result.definitions[0].kind, 'OperationDefinition'); + + // the rest of the definitions should be fragments and contain one of + // each: "friends", "enemies", "person". Order does not matter + const fragments = result.definitions.slice(1) + assert(fragments.every(fragment => fragment.kind === 'FragmentDefinition')) + assert(fragments.some(fragment => fragment.name.value === 'friends')) + assert(fragments.some(fragment => fragment.name.value === 'enemies')) + assert(fragments.some(fragment => fragment.name.value === 'person')) + }); + }); + + // How to make this work? + // it.only('can reference a fragment passed as a document via shorthand', () => { + // const ast = gql` + // { + // user(id: 5) { + // ...${userFragmentDocument} + // } + // } + // `; + // + // assert.deepEqual(ast, gql` + // { + // user(id: 5) { + // ...UserFragment + // } + // } + // fragment UserFragment on User { + // firstName + // lastName + // } + // `); + // }); + + }); +}); diff --git a/node_modules/graphql-tag/test/mocha.opts b/node_modules/graphql-tag/test/mocha.opts new file mode 100644 index 000000000..fdcea4771 --- /dev/null +++ b/node_modules/graphql-tag/test/mocha.opts @@ -0,0 +1 @@ +--require babel-register diff --git a/node_modules/graphql/LICENSE b/node_modules/graphql/LICENSE new file mode 100644 index 000000000..cd2262e3a --- /dev/null +++ b/node_modules/graphql/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 GraphQL Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/graphql/README.md b/node_modules/graphql/README.md new file mode 100644 index 000000000..e68221470 --- /dev/null +++ b/node_modules/graphql/README.md @@ -0,0 +1,145 @@ +# GraphQL.js + +The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. + +[![npm version](https://badge.fury.io/js/graphql.svg)](https://badge.fury.io/js/graphql) +[![Build Status](https://travis-ci.org/graphql/graphql-js.svg?branch=master)](https://travis-ci.org/graphql/graphql-js?branch=master) +[![Coverage Status](https://codecov.io/gh/graphql/graphql-js/branch/master/graph/badge.svg)](https://codecov.io/gh/graphql/graphql-js) + +See more complete documentation at https://graphql.org/ and +https://graphql.org/graphql-js/. + +Looking for help? Find resources [from the community](https://graphql.org/community/). + + +## Getting Started + +An overview of GraphQL in general is available in the +[README](https://github.com/graphql/graphql-spec/blob/master/README.md) for the +[Specification for GraphQL](https://github.com/graphql/graphql-spec). That overview +describes a simple set of GraphQL examples that exist as [tests](src/__tests__) +in this repository. A good way to get started with this repository is to walk +through that README and the corresponding tests in parallel. + +### Using GraphQL.js + +Install GraphQL.js from npm + +With yarn: + +```sh +yarn add graphql +``` + +or alternatively using npm: + +```sh +npm install --save graphql +``` + +GraphQL.js provides two important capabilities: building a type schema, and +serving queries against that type schema. + +First, build a GraphQL type schema which maps to your code base. + +```js +import { + graphql, + GraphQLSchema, + GraphQLObjectType, + GraphQLString +} from 'graphql'; + +var schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: 'RootQueryType', + fields: { + hello: { + type: GraphQLString, + resolve() { + return 'world'; + } + } + } + }) +}); +``` + +This defines a simple schema with one type and one field, that resolves +to a fixed value. The `resolve` function can return a value, a promise, +or an array of promises. A more complex example is included in the top +level [tests](src/__tests__) directory. + +Then, serve the result of a query against that type schema. + +```js +var query = '{ hello }'; + +graphql(schema, query).then(result => { + + // Prints + // { + // data: { hello: "world" } + // } + console.log(result); + +}); +``` + +This runs a query fetching the one field defined. The `graphql` function will +first ensure the query is syntactically and semantically valid before executing +it, reporting errors otherwise. + +```js +var query = '{ boyhowdy }'; + +graphql(schema, query).then(result => { + + // Prints + // { + // errors: [ + // { message: 'Cannot query field boyhowdy on RootQueryType', + // locations: [ { line: 1, column: 3 } ] } + // ] + // } + console.log(result); + +}); +``` + +### Want to ride the bleeding edge? + +The `npm` branch in this repository is automatically maintained to be the last +commit to `master` to pass all tests, in the same form found on npm. It is +recommended to use builds deployed to npm for many reasons, but if you want to use +the latest not-yet-released version of graphql-js, you can do so by depending +directly on this branch: + +``` +npm install graphql@git://github.com/graphql/graphql-js.git#npm +``` + +### Using in a Browser + +GraphQL.js is a general purpose library and can be used both in a Node server +and in the browser. As an example, the [GraphiQL](https://github.com/graphql/graphiql/) +tool is built with GraphQL.js! + +Building a project using GraphQL.js with [webpack](https://webpack.js.org) or +[rollup](https://github.com/rollup/rollup) should just work and only include +the portions of the library you use. This works because GraphQL.js is distributed +with both CommonJS (`require()`) and ESModule (`import`) files. Ensure that any +custom build configurations look for `.mjs` files! + +### Contributing + +We actively welcome pull requests, learn how to +[contribute](https://github.com/graphql/graphql-js/blob/master/.github/CONTRIBUTING.md). + +### Changelog + +Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/releases). + +### License + +GraphQL.js is [MIT-licensed](https://github.com/graphql/graphql-js/blob/master/LICENSE). diff --git a/node_modules/graphql/error/GraphQLError.js b/node_modules/graphql/error/GraphQLError.js new file mode 100644 index 000000000..c2fb0e5a1 --- /dev/null +++ b/node_modules/graphql/error/GraphQLError.js @@ -0,0 +1,214 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.GraphQLError = GraphQLError; +exports.printError = printError; + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _location = require("../language/location"); + +var _printLocation = require("../language/printLocation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function GraphQLError( // eslint-disable-line no-redeclare +message, nodes, source, positions, path, originalError, extensions) { + // Compute list of blame nodes. + var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions. + + + var _source = source; + + if (!_source && _nodes) { + var node = _nodes[0]; + _source = node && node.loc && node.loc.source; + } + + var _positions = positions; + + if (!_positions && _nodes) { + _positions = _nodes.reduce(function (list, node) { + if (node.loc) { + list.push(node.loc.start); + } + + return list; + }, []); + } + + if (_positions && _positions.length === 0) { + _positions = undefined; + } + + var _locations; + + if (positions && source) { + _locations = positions.map(function (pos) { + return (0, _location.getLocation)(source, pos); + }); + } else if (_nodes) { + _locations = _nodes.reduce(function (list, node) { + if (node.loc) { + list.push((0, _location.getLocation)(node.loc.source, node.loc.start)); + } + + return list; + }, []); + } + + var _extensions = extensions; + + if (_extensions == null && originalError != null) { + var originalExtensions = originalError.extensions; + + if ((0, _isObjectLike.default)(originalExtensions)) { + _extensions = originalExtensions; + } + } + + Object.defineProperties(this, { + message: { + value: message, + // By being enumerable, JSON.stringify will include `message` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: true, + writable: true + }, + locations: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _locations || undefined, + // By being enumerable, JSON.stringify will include `locations` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_locations) + }, + path: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: path || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(path) + }, + nodes: { + value: _nodes || undefined + }, + source: { + value: _source || undefined + }, + positions: { + value: _positions || undefined + }, + originalError: { + value: originalError + }, + extensions: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _extensions || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_extensions) + } + }); // Include (non-enumerable) stack trace. + + if (originalError && originalError.stack) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true + }); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, GraphQLError); + } else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true + }); + } +} + +GraphQLError.prototype = Object.create(Error.prototype, { + constructor: { + value: GraphQLError + }, + name: { + value: 'GraphQLError' + }, + toString: { + value: function toString() { + return printError(this); + } + } +}); +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ + +function printError(error) { + var output = error.message; + + if (error.nodes) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = error.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var node = _step.value; + + if (node.loc) { + output += '\n\n' + (0, _printLocation.printLocation)(node.loc); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else if (error.source && error.locations) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = error.locations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var location = _step2.value; + output += '\n\n' + (0, _printLocation.printSourceLocation)(error.source, location); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + return output; +} diff --git a/node_modules/graphql/error/GraphQLError.js.flow b/node_modules/graphql/error/GraphQLError.js.flow new file mode 100644 index 000000000..1d0681e6e --- /dev/null +++ b/node_modules/graphql/error/GraphQLError.js.flow @@ -0,0 +1,241 @@ +// @flow strict + +import isObjectLike from '../jsutils/isObjectLike'; +import { type ASTNode } from '../language/ast'; +import { type Source } from '../language/source'; +import { type SourceLocation, getLocation } from '../language/location'; +import { printLocation, printSourceLocation } from '../language/printLocation'; + +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ +declare class GraphQLError extends Error { + constructor( + message: string, + nodes?: $ReadOnlyArray | ASTNode | void | null, + source?: ?Source, + positions?: ?$ReadOnlyArray, + path?: ?$ReadOnlyArray, + originalError?: ?Error, + extensions?: ?{ [key: string]: mixed, ... }, + ): void; + + /** + * A message describing the Error for debugging purposes. + * + * Enumerable, and appears in the result of JSON.stringify(). + * + * Note: should be treated as readonly, despite invariant usage. + */ + message: string; + + /** + * An array of { line, column } locations within the source GraphQL document + * which correspond to this error. + * + * Errors during validation often contain multiple locations, for example to + * point out two things with the same name. Errors during execution include a + * single location, the field which produced the error. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + +locations: $ReadOnlyArray | void; + + /** + * An array describing the JSON-path into the execution response which + * corresponds to this error. Only included for errors during execution. + * + * Enumerable, and appears in the result of JSON.stringify(). + */ + +path: $ReadOnlyArray | void; + + /** + * An array of GraphQL AST Nodes corresponding to this error. + */ + +nodes: $ReadOnlyArray | void; + + /** + * The source GraphQL document for the first location of this error. + * + * Note that if this Error represents more than one node, the source may not + * represent nodes after the first node. + */ + +source: Source | void; + + /** + * An array of character offsets within the source GraphQL document + * which correspond to this error. + */ + +positions: $ReadOnlyArray | void; + + /** + * The original error thrown from a field resolver during execution. + */ + +originalError: ?Error; + + /** + * Extension fields to add to the formatted error. + */ + +extensions: { [key: string]: mixed, ... } | void; +} + +export function GraphQLError( // eslint-disable-line no-redeclare + message: string, + nodes?: $ReadOnlyArray | ASTNode | void, + source?: ?Source, + positions?: ?$ReadOnlyArray, + path?: ?$ReadOnlyArray, + originalError?: ?Error & { +extensions: mixed, ... }, + extensions?: ?{ [key: string]: mixed, ... }, +) { + // Compute list of blame nodes. + const _nodes = Array.isArray(nodes) + ? nodes.length !== 0 + ? nodes + : undefined + : nodes + ? [nodes] + : undefined; + + // Compute locations in the source for the given nodes/positions. + let _source = source; + if (!_source && _nodes) { + const node = _nodes[0]; + _source = node && node.loc && node.loc.source; + } + + let _positions = positions; + if (!_positions && _nodes) { + _positions = _nodes.reduce((list, node) => { + if (node.loc) { + list.push(node.loc.start); + } + return list; + }, []); + } + if (_positions && _positions.length === 0) { + _positions = undefined; + } + + let _locations; + if (positions && source) { + _locations = positions.map(pos => getLocation(source, pos)); + } else if (_nodes) { + _locations = _nodes.reduce((list, node) => { + if (node.loc) { + list.push(getLocation(node.loc.source, node.loc.start)); + } + return list; + }, []); + } + + let _extensions = extensions; + if (_extensions == null && originalError != null) { + const originalExtensions = originalError.extensions; + if (isObjectLike(originalExtensions)) { + _extensions = originalExtensions; + } + } + + Object.defineProperties(this, { + message: { + value: message, + // By being enumerable, JSON.stringify will include `message` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: true, + writable: true, + }, + locations: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _locations || undefined, + // By being enumerable, JSON.stringify will include `locations` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_locations), + }, + path: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: path || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(path), + }, + nodes: { + value: _nodes || undefined, + }, + source: { + value: _source || undefined, + }, + positions: { + value: _positions || undefined, + }, + originalError: { + value: originalError, + }, + extensions: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _extensions || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_extensions), + }, + }); + + // Include (non-enumerable) stack trace. + if (originalError && originalError.stack) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true, + }); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, GraphQLError); + } else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true, + }); + } +} + +(GraphQLError: any).prototype = Object.create(Error.prototype, { + constructor: { value: GraphQLError }, + name: { value: 'GraphQLError' }, + toString: { + value: function toString() { + return printError(this); + }, + }, +}); + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ +export function printError(error: GraphQLError): string { + let output = error.message; + + if (error.nodes) { + for (const node of error.nodes) { + if (node.loc) { + output += '\n\n' + printLocation(node.loc); + } + } + } else if (error.source && error.locations) { + for (const location of error.locations) { + output += '\n\n' + printSourceLocation(error.source, location); + } + } + + return output; +} diff --git a/node_modules/graphql/error/GraphQLError.mjs b/node_modules/graphql/error/GraphQLError.mjs new file mode 100644 index 000000000..6644acea3 --- /dev/null +++ b/node_modules/graphql/error/GraphQLError.mjs @@ -0,0 +1,207 @@ +import isObjectLike from '../jsutils/isObjectLike'; +import { getLocation } from '../language/location'; +import { printLocation, printSourceLocation } from '../language/printLocation'; +/** + * A GraphQLError describes an Error found during the parse, validate, or + * execute phases of performing a GraphQL operation. In addition to a message + * and stack trace, it also includes information about the locations in a + * GraphQL document and/or execution result that correspond to the Error. + */ + +export function GraphQLError( // eslint-disable-line no-redeclare +message, nodes, source, positions, path, originalError, extensions) { + // Compute list of blame nodes. + var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions. + + + var _source = source; + + if (!_source && _nodes) { + var node = _nodes[0]; + _source = node && node.loc && node.loc.source; + } + + var _positions = positions; + + if (!_positions && _nodes) { + _positions = _nodes.reduce(function (list, node) { + if (node.loc) { + list.push(node.loc.start); + } + + return list; + }, []); + } + + if (_positions && _positions.length === 0) { + _positions = undefined; + } + + var _locations; + + if (positions && source) { + _locations = positions.map(function (pos) { + return getLocation(source, pos); + }); + } else if (_nodes) { + _locations = _nodes.reduce(function (list, node) { + if (node.loc) { + list.push(getLocation(node.loc.source, node.loc.start)); + } + + return list; + }, []); + } + + var _extensions = extensions; + + if (_extensions == null && originalError != null) { + var originalExtensions = originalError.extensions; + + if (isObjectLike(originalExtensions)) { + _extensions = originalExtensions; + } + } + + Object.defineProperties(this, { + message: { + value: message, + // By being enumerable, JSON.stringify will include `message` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: true, + writable: true + }, + locations: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _locations || undefined, + // By being enumerable, JSON.stringify will include `locations` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_locations) + }, + path: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: path || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(path) + }, + nodes: { + value: _nodes || undefined + }, + source: { + value: _source || undefined + }, + positions: { + value: _positions || undefined + }, + originalError: { + value: originalError + }, + extensions: { + // Coercing falsey values to undefined ensures they will not be included + // in JSON.stringify() when not provided. + value: _extensions || undefined, + // By being enumerable, JSON.stringify will include `path` in the + // resulting output. This ensures that the simplest possible GraphQL + // service adheres to the spec. + enumerable: Boolean(_extensions) + } + }); // Include (non-enumerable) stack trace. + + if (originalError && originalError.stack) { + Object.defineProperty(this, 'stack', { + value: originalError.stack, + writable: true, + configurable: true + }); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, GraphQLError); + } else { + Object.defineProperty(this, 'stack', { + value: Error().stack, + writable: true, + configurable: true + }); + } +} +GraphQLError.prototype = Object.create(Error.prototype, { + constructor: { + value: GraphQLError + }, + name: { + value: 'GraphQLError' + }, + toString: { + value: function toString() { + return printError(this); + } + } +}); +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ + +export function printError(error) { + var output = error.message; + + if (error.nodes) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = error.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var node = _step.value; + + if (node.loc) { + output += '\n\n' + printLocation(node.loc); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else if (error.source && error.locations) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = error.locations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var location = _step2.value; + output += '\n\n' + printSourceLocation(error.source, location); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + return output; +} diff --git a/node_modules/graphql/error/formatError.js b/node_modules/graphql/error/formatError.js new file mode 100644 index 000000000..37a8afd67 --- /dev/null +++ b/node_modules/graphql/error/formatError.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatError = formatError; + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Given a GraphQLError, format it according to the rules described by the + * Response Format, Errors section of the GraphQL Specification. + */ +function formatError(error) { + !error ? (0, _invariant.default)(0, 'Received null or undefined error.') : void 0; + var message = error.message || 'An unknown error occurred.'; + var locations = error.locations; + var path = error.path; + var extensions = error.extensions; + return extensions ? { + message: message, + locations: locations, + path: path, + extensions: extensions + } : { + message: message, + locations: locations, + path: path + }; +} diff --git a/node_modules/graphql/error/formatError.js.flow b/node_modules/graphql/error/formatError.js.flow new file mode 100644 index 000000000..6990b6b00 --- /dev/null +++ b/node_modules/graphql/error/formatError.js.flow @@ -0,0 +1,28 @@ +// @flow strict + +import invariant from '../jsutils/invariant'; +import { type GraphQLError } from './GraphQLError'; +import { type SourceLocation } from '../language/location'; + +/** + * Given a GraphQLError, format it according to the rules described by the + * Response Format, Errors section of the GraphQL Specification. + */ +export function formatError(error: GraphQLError): GraphQLFormattedError { + invariant(error, 'Received null or undefined error.'); + const message = error.message || 'An unknown error occurred.'; + const locations = error.locations; + const path = error.path; + const extensions = error.extensions; + + return extensions + ? { message, locations, path, extensions } + : { message, locations, path }; +} + +export type GraphQLFormattedError = {| + +message: string, + +locations: $ReadOnlyArray | void, + +path: $ReadOnlyArray | void, + +extensions?: { [key: string]: mixed, ... }, +|}; diff --git a/node_modules/graphql/error/formatError.mjs b/node_modules/graphql/error/formatError.mjs new file mode 100644 index 000000000..c3a3960a4 --- /dev/null +++ b/node_modules/graphql/error/formatError.mjs @@ -0,0 +1,23 @@ +import invariant from '../jsutils/invariant'; + +/** + * Given a GraphQLError, format it according to the rules described by the + * Response Format, Errors section of the GraphQL Specification. + */ +export function formatError(error) { + !error ? invariant(0, 'Received null or undefined error.') : void 0; + var message = error.message || 'An unknown error occurred.'; + var locations = error.locations; + var path = error.path; + var extensions = error.extensions; + return extensions ? { + message: message, + locations: locations, + path: path, + extensions: extensions + } : { + message: message, + locations: locations, + path: path + }; +} diff --git a/node_modules/graphql/error/index.js b/node_modules/graphql/error/index.js new file mode 100644 index 000000000..e71a994fb --- /dev/null +++ b/node_modules/graphql/error/index.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "GraphQLError", { + enumerable: true, + get: function get() { + return _GraphQLError.GraphQLError; + } +}); +Object.defineProperty(exports, "printError", { + enumerable: true, + get: function get() { + return _GraphQLError.printError; + } +}); +Object.defineProperty(exports, "syntaxError", { + enumerable: true, + get: function get() { + return _syntaxError.syntaxError; + } +}); +Object.defineProperty(exports, "locatedError", { + enumerable: true, + get: function get() { + return _locatedError.locatedError; + } +}); +Object.defineProperty(exports, "formatError", { + enumerable: true, + get: function get() { + return _formatError.formatError; + } +}); + +var _GraphQLError = require("./GraphQLError"); + +var _syntaxError = require("./syntaxError"); + +var _locatedError = require("./locatedError"); + +var _formatError = require("./formatError"); diff --git a/node_modules/graphql/error/index.js.flow b/node_modules/graphql/error/index.js.flow new file mode 100644 index 000000000..c920bfc18 --- /dev/null +++ b/node_modules/graphql/error/index.js.flow @@ -0,0 +1,10 @@ +// @flow strict + +export { GraphQLError, printError } from './GraphQLError'; + +export { syntaxError } from './syntaxError'; + +export { locatedError } from './locatedError'; + +export { formatError } from './formatError'; +export type { GraphQLFormattedError } from './formatError'; diff --git a/node_modules/graphql/error/index.mjs b/node_modules/graphql/error/index.mjs new file mode 100644 index 000000000..9e6c1b007 --- /dev/null +++ b/node_modules/graphql/error/index.mjs @@ -0,0 +1,4 @@ +export { GraphQLError, printError } from './GraphQLError'; +export { syntaxError } from './syntaxError'; +export { locatedError } from './locatedError'; +export { formatError } from './formatError'; diff --git a/node_modules/graphql/error/locatedError.js b/node_modules/graphql/error/locatedError.js new file mode 100644 index 000000000..0bb1f7499 --- /dev/null +++ b/node_modules/graphql/error/locatedError.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.locatedError = locatedError; + +var _GraphQLError = require("./GraphQLError"); + +/** + * Given an arbitrary Error, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + */ +function locatedError(originalError, nodes, path) { + // Note: this uses a brand-check to support GraphQL errors originating from + // other contexts. + if (originalError && Array.isArray(originalError.path)) { + return originalError; + } + + return new _GraphQLError.GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError); +} diff --git a/node_modules/graphql/error/locatedError.js.flow b/node_modules/graphql/error/locatedError.js.flow new file mode 100644 index 000000000..955772e67 --- /dev/null +++ b/node_modules/graphql/error/locatedError.js.flow @@ -0,0 +1,30 @@ +// @flow strict + +import { GraphQLError } from './GraphQLError'; +import { type ASTNode } from '../language/ast'; + +/** + * Given an arbitrary Error, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + */ +export function locatedError( + originalError: Error | GraphQLError, + nodes: $ReadOnlyArray, + path: $ReadOnlyArray, +): GraphQLError { + // Note: this uses a brand-check to support GraphQL errors originating from + // other contexts. + if (originalError && Array.isArray(originalError.path)) { + return (originalError: any); + } + + return new GraphQLError( + originalError && originalError.message, + (originalError && (originalError: any).nodes) || nodes, + originalError && (originalError: any).source, + originalError && (originalError: any).positions, + path, + originalError, + ); +} diff --git a/node_modules/graphql/error/locatedError.mjs b/node_modules/graphql/error/locatedError.mjs new file mode 100644 index 000000000..b272eb58e --- /dev/null +++ b/node_modules/graphql/error/locatedError.mjs @@ -0,0 +1,16 @@ +import { GraphQLError } from './GraphQLError'; + +/** + * Given an arbitrary Error, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + */ +export function locatedError(originalError, nodes, path) { + // Note: this uses a brand-check to support GraphQL errors originating from + // other contexts. + if (originalError && Array.isArray(originalError.path)) { + return originalError; + } + + return new GraphQLError(originalError && originalError.message, originalError && originalError.nodes || nodes, originalError && originalError.source, originalError && originalError.positions, path, originalError); +} diff --git a/node_modules/graphql/error/syntaxError.js b/node_modules/graphql/error/syntaxError.js new file mode 100644 index 000000000..6e3ceec73 --- /dev/null +++ b/node_modules/graphql/error/syntaxError.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.syntaxError = syntaxError; + +var _GraphQLError = require("./GraphQLError"); + +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ +function syntaxError(source, position, description) { + return new _GraphQLError.GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]); +} diff --git a/node_modules/graphql/error/syntaxError.js.flow b/node_modules/graphql/error/syntaxError.js.flow new file mode 100644 index 000000000..a0b88cb01 --- /dev/null +++ b/node_modules/graphql/error/syntaxError.js.flow @@ -0,0 +1,18 @@ +// @flow strict + +import { type Source } from '../language/source'; +import { GraphQLError } from './GraphQLError'; + +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ +export function syntaxError( + source: Source, + position: number, + description: string, +): GraphQLError { + return new GraphQLError(`Syntax Error: ${description}`, undefined, source, [ + position, + ]); +} diff --git a/node_modules/graphql/error/syntaxError.mjs b/node_modules/graphql/error/syntaxError.mjs new file mode 100644 index 000000000..cde337240 --- /dev/null +++ b/node_modules/graphql/error/syntaxError.mjs @@ -0,0 +1,9 @@ +import { GraphQLError } from './GraphQLError'; +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ + +export function syntaxError(source, position, description) { + return new GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]); +} diff --git a/node_modules/graphql/execution/execute.js b/node_modules/graphql/execution/execute.js new file mode 100644 index 000000000..174255c39 --- /dev/null +++ b/node_modules/graphql/execution/execute.js @@ -0,0 +1,863 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.execute = execute; +exports.responsePathAsArray = responsePathAsArray; +exports.addPath = addPath; +exports.assertValidExecutionArguments = assertValidExecutionArguments; +exports.buildExecutionContext = buildExecutionContext; +exports.collectFields = collectFields; +exports.buildResolveInfo = buildResolveInfo; +exports.resolveFieldValueOrError = resolveFieldValueOrError; +exports.getFieldDef = getFieldDef; +exports.defaultFieldResolver = exports.defaultTypeResolver = void 0; + +var _iterall = require("iterall"); + +var _GraphQLError = require("../error/GraphQLError"); + +var _locatedError = require("../error/locatedError"); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _isInvalid = _interopRequireDefault(require("../jsutils/isInvalid")); + +var _isNullish = _interopRequireDefault(require("../jsutils/isNullish")); + +var _isPromise = _interopRequireDefault(require("../jsutils/isPromise")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _memoize = _interopRequireDefault(require("../jsutils/memoize3")); + +var _promiseForObject = _interopRequireDefault(require("../jsutils/promiseForObject")); + +var _promiseReduce = _interopRequireDefault(require("../jsutils/promiseReduce")); + +var _getOperationRootType = require("../utilities/getOperationRootType"); + +var _typeFromAST = require("../utilities/typeFromAST"); + +var _kinds = require("../language/kinds"); + +var _values = require("./values"); + +var _definition = require("../type/definition"); + +var _introspection = require("../type/introspection"); + +var _directives = require("../type/directives"); + +var _validate = require("../type/validate"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function execute(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 ? executeImpl(argsOrSchema) : executeImpl({ + schema: argsOrSchema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); +} + +function executeImpl(args) { + var schema = args.schema, + document = args.document, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + typeResolver = args.typeResolver; // If arguments are missing or incorrect, throw an error. + + assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + + var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver); // Return early errors if execution context failed. + + if (Array.isArray(exeContext)) { + return { + errors: exeContext + }; + } // Return a Promise that will eventually resolve to the data described by + // The "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + + + var data = executeOperation(exeContext, exeContext.operation, rootValue); + return buildResponse(exeContext, data); +} +/** + * Given a completed execution context and data, build the { errors, data } + * response defined by the "Response" section of the GraphQL specification. + */ + + +function buildResponse(exeContext, data) { + if ((0, _isPromise.default)(data)) { + return data.then(function (resolved) { + return buildResponse(exeContext, resolved); + }); + } + + return exeContext.errors.length === 0 ? { + data: data + } : { + errors: exeContext.errors, + data: data + }; +} +/** + * Given a ResponsePath (found in the `path` entry in the information provided + * as the last argument to a field resolver), return an Array of the path keys. + */ + + +function responsePathAsArray(path) { + var flattened = []; + var curr = path; + + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + + return flattened.reverse(); +} +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ + + +function addPath(prev, key) { + return { + prev: prev, + key: key + }; +} +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ + + +function assertValidExecutionArguments(schema, document, rawVariableValues) { + !document ? (0, _invariant.default)(0, 'Must provide document') : void 0; // If the schema used for execution is invalid, throw an error. + + (0, _validate.assertValidSchema)(schema); // Variables, if provided, must be an object. + + !(rawVariableValues == null || (0, _isObjectLike.default)(rawVariableValues)) ? (0, _invariant.default)(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.') : void 0; +} +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ + + +function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) { + var errors = []; + var operation; + var hasMultipleAssumedOperations = false; + var fragments = Object.create(null); + + for (var i = 0; i < document.definitions.length; i++) { + var definition = document.definitions[i]; + + switch (definition.kind) { + case _kinds.Kind.OPERATION_DEFINITION: + if (!operationName && operation) { + hasMultipleAssumedOperations = true; + } else if (!operationName || definition.name && definition.name.value === operationName) { + operation = definition; + } + + break; + + case _kinds.Kind.FRAGMENT_DEFINITION: + fragments[definition.name.value] = definition; + break; + } + } + + if (!operation) { + if (operationName) { + errors.push(new _GraphQLError.GraphQLError("Unknown operation named \"".concat(operationName, "\"."))); + } else { + errors.push(new _GraphQLError.GraphQLError('Must provide an operation.')); + } + } else if (hasMultipleAssumedOperations) { + errors.push(new _GraphQLError.GraphQLError('Must provide operation name if query contains multiple operations.')); + } + + var variableValues; + + if (operation) { + var coercedVariableValues = (0, _values.getVariableValues)(schema, operation.variableDefinitions || [], rawVariableValues || {}); + + if (coercedVariableValues.errors) { + errors.push.apply(errors, coercedVariableValues.errors); + } else { + variableValues = coercedVariableValues.coerced; + } + } + + if (errors.length !== 0) { + return errors; + } + + !operation ? (0, _invariant.default)(0, 'Has operation if no errors.') : void 0; + !variableValues ? (0, _invariant.default)(0, 'Has variables if no errors.') : void 0; + return { + schema: schema, + fragments: fragments, + rootValue: rootValue, + contextValue: contextValue, + operation: operation, + variableValues: variableValues, + fieldResolver: fieldResolver || defaultFieldResolver, + typeResolver: typeResolver || defaultTypeResolver, + errors: errors + }; +} +/** + * Implements the "Evaluating operations" section of the spec. + */ + + +function executeOperation(exeContext, operation, rootValue) { + var type = (0, _getOperationRootType.getOperationRootType)(exeContext.schema, operation); + var fields = collectFields(exeContext, type, operation.selectionSet, Object.create(null), Object.create(null)); + var path = undefined; // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + // + // Similar to completeValueCatchingError. + + try { + var result = operation.operation === 'mutation' ? executeFieldsSerially(exeContext, type, rootValue, path, fields) : executeFields(exeContext, type, rootValue, path, fields); + + if ((0, _isPromise.default)(result)) { + return result.then(undefined, function (error) { + exeContext.errors.push(error); + return Promise.resolve(null); + }); + } + + return result; + } catch (error) { + exeContext.errors.push(error); + return null; + } +} +/** + * Implements the "Evaluating selection sets" section of the spec + * for "write" mode. + */ + + +function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) { + return (0, _promiseReduce.default)(Object.keys(fields), function (results, responseName) { + var fieldNodes = fields[responseName]; + var fieldPath = addPath(path, responseName); + var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + + if (result === undefined) { + return results; + } + + if ((0, _isPromise.default)(result)) { + return result.then(function (resolvedResult) { + results[responseName] = resolvedResult; + return results; + }); + } + + results[responseName] = result; + return results; + }, Object.create(null)); +} +/** + * Implements the "Evaluating selection sets" section of the spec + * for "read" mode. + */ + + +function executeFields(exeContext, parentType, sourceValue, path, fields) { + var results = Object.create(null); + var containsPromise = false; + + for (var i = 0, keys = Object.keys(fields); i < keys.length; ++i) { + var responseName = keys[i]; + var fieldNodes = fields[responseName]; + var fieldPath = addPath(path, responseName); + var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + + if (result !== undefined) { + results[responseName] = result; + + if (!containsPromise && (0, _isPromise.default)(result)) { + containsPromise = true; + } + } + } // If there are no promises, we can just return the object + + + if (!containsPromise) { + return results; + } // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + + + return (0, _promiseForObject.default)(results); +} +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ + + +function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) { + for (var i = 0; i < selectionSet.selections.length; i++) { + var selection = selectionSet.selections[i]; + + switch (selection.kind) { + case _kinds.Kind.FIELD: + { + if (!shouldIncludeNode(exeContext, selection)) { + continue; + } + + var name = getFieldEntryKey(selection); + + if (!fields[name]) { + fields[name] = []; + } + + fields[name].push(selection); + break; + } + + case _kinds.Kind.INLINE_FRAGMENT: + { + if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(exeContext, selection, runtimeType)) { + continue; + } + + collectFields(exeContext, runtimeType, selection.selectionSet, fields, visitedFragmentNames); + break; + } + + case _kinds.Kind.FRAGMENT_SPREAD: + { + var fragName = selection.name.value; + + if (visitedFragmentNames[fragName] || !shouldIncludeNode(exeContext, selection)) { + continue; + } + + visitedFragmentNames[fragName] = true; + var fragment = exeContext.fragments[fragName]; + + if (!fragment || !doesFragmentConditionMatch(exeContext, fragment, runtimeType)) { + continue; + } + + collectFields(exeContext, runtimeType, fragment.selectionSet, fields, visitedFragmentNames); + break; + } + } + } + + return fields; +} +/** + * Determines if a field should be included based on the @include and @skip + * directives, where @skip has higher precedence than @include. + */ + + +function shouldIncludeNode(exeContext, node) { + var skip = (0, _values.getDirectiveValues)(_directives.GraphQLSkipDirective, node, exeContext.variableValues); + + if (skip && skip.if === true) { + return false; + } + + var include = (0, _values.getDirectiveValues)(_directives.GraphQLIncludeDirective, node, exeContext.variableValues); + + if (include && include.if === false) { + return false; + } + + return true; +} +/** + * Determines if a fragment is applicable to the given type. + */ + + +function doesFragmentConditionMatch(exeContext, fragment, type) { + var typeConditionNode = fragment.typeCondition; + + if (!typeConditionNode) { + return true; + } + + var conditionalType = (0, _typeFromAST.typeFromAST)(exeContext.schema, typeConditionNode); + + if (conditionalType === type) { + return true; + } + + if ((0, _definition.isAbstractType)(conditionalType)) { + return exeContext.schema.isPossibleType(conditionalType, type); + } + + return false; +} +/** + * Implements the logic to compute the key of a given field's entry + */ + + +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +/** + * Resolves the field on the given source object. In particular, this + * figures out the value that the field returns by calling its resolve function, + * then calls completeValue to complete promises, serialize scalars, or execute + * the sub-selection-set for objects. + */ + + +function resolveField(exeContext, parentType, source, fieldNodes, path) { + var fieldNode = fieldNodes[0]; + var fieldName = fieldNode.name.value; + var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); + + if (!fieldDef) { + return; + } + + var resolveFn = fieldDef.resolve || exeContext.fieldResolver; + var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal + // or abrupt (error). + + var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info); + return completeValueCatchingError(exeContext, fieldDef.type, fieldNodes, info, path, result); +} + +function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) { + // The resolve function's optional fourth argument is a collection of + // information about the current execution state. + return { + fieldName: fieldDef.name, + fieldNodes: fieldNodes, + returnType: fieldDef.type, + parentType: parentType, + path: path, + schema: exeContext.schema, + fragments: exeContext.fragments, + rootValue: exeContext.rootValue, + operation: exeContext.operation, + variableValues: exeContext.variableValues + }; +} // Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. + + +function resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info) { + try { + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + // TODO: find a way to memoize, in case this field is within a List type. + var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], exeContext.variableValues); // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + + var _contextValue = exeContext.contextValue; + var result = resolveFn(source, args, _contextValue, info); + return (0, _isPromise.default)(result) ? result.then(undefined, asErrorInstance) : result; + } catch (error) { + return asErrorInstance(error); + } +} // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a +// consistent Error interface. + + +function asErrorInstance(error) { + if (error instanceof Error) { + return error; + } + + return new Error('Unexpected error value: ' + (0, _inspect.default)(error)); +} // This is a small wrapper around completeValue which detects and logs errors +// in the execution context. + + +function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) { + try { + var completed; + + if ((0, _isPromise.default)(result)) { + completed = result.then(function (resolved) { + return completeValue(exeContext, returnType, fieldNodes, info, path, resolved); + }); + } else { + completed = completeValue(exeContext, returnType, fieldNodes, info, path, result); + } + + if ((0, _isPromise.default)(completed)) { + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completed.then(undefined, function (error) { + return handleFieldError(error, fieldNodes, path, returnType, exeContext); + }); + } + + return completed; + } catch (error) { + return handleFieldError(error, fieldNodes, path, returnType, exeContext); + } +} + +function handleFieldError(rawError, fieldNodes, path, returnType, exeContext) { + var error = (0, _locatedError.locatedError)(asErrorInstance(rawError), fieldNodes, responsePathAsArray(path)); // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + + if ((0, _definition.isNonNullType)(returnType)) { + throw error; + } // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + + + exeContext.errors.push(error); + return null; +} +/** + * Implements the instructions for completeValue as defined in the + * "Field entries" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by evaluating all sub-selections. + */ + + +function completeValue(exeContext, returnType, fieldNodes, info, path, result) { + // If result is an Error, throw a located error. + if (result instanceof Error) { + throw result; + } // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + + + if ((0, _definition.isNonNullType)(returnType)) { + var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result); + + if (completed === null) { + throw new Error("Cannot return null for non-nullable field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")); + } + + return completed; + } // If result value is null-ish (null, undefined, or NaN) then return null. + + + if ((0, _isNullish.default)(result)) { + return null; + } // If field type is List, complete each item in the list with the inner type + + + if ((0, _definition.isListType)(returnType)) { + return completeListValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is a leaf type, Scalar or Enum, serialize to a valid value, + // returning null if serialization is not possible. + + + if ((0, _definition.isLeafType)(returnType)) { + return completeLeafValue(returnType, result); + } // If field type is an abstract type, Interface or Union, determine the + // runtime Object type and complete for that type. + + + if ((0, _definition.isAbstractType)(returnType)) { + return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is Object, execute and complete all sub-selections. + + + if ((0, _definition.isObjectType)(returnType)) { + return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); + } // Not reachable. All possible output types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Cannot complete value of unexpected output type: \"".concat((0, _inspect.default)(returnType), "\".")); +} +/** + * Complete a list value by completing each item in the list with the + * inner type + */ + + +function completeListValue(exeContext, returnType, fieldNodes, info, path, result) { + !(0, _iterall.isCollection)(result) ? (0, _invariant.default)(0, "Expected Iterable, but did not find one for field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")) : void 0; // This is specified as a simple map, however we're optimizing the path + // where the list contains no Promises by avoiding creating another Promise. + + var itemType = returnType.ofType; + var containsPromise = false; + var completedResults = []; + (0, _iterall.forEach)(result, function (item, index) { + // No need to modify the info object containing the path, + // since from here on it is not ever accessed by resolver functions. + var fieldPath = addPath(path, index); + var completedItem = completeValueCatchingError(exeContext, itemType, fieldNodes, info, fieldPath, item); + + if (!containsPromise && (0, _isPromise.default)(completedItem)) { + containsPromise = true; + } + + completedResults.push(completedItem); + }); + return containsPromise ? Promise.all(completedResults) : completedResults; +} +/** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + */ + + +function completeLeafValue(returnType, result) { + !returnType.serialize ? (0, _invariant.default)(0, 'Missing serialize method on type') : void 0; + var serializedResult = returnType.serialize(result); + + if ((0, _isInvalid.default)(serializedResult)) { + throw new Error("Expected a value of type \"".concat((0, _inspect.default)(returnType), "\" but ") + "received: ".concat((0, _inspect.default)(result))); + } + + return serializedResult; +} +/** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + */ + + +function completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result) { + var resolveTypeFn = returnType.resolveType || exeContext.typeResolver; + var contextValue = exeContext.contextValue; + var runtimeType = resolveTypeFn(result, contextValue, info, returnType); + + if ((0, _isPromise.default)(runtimeType)) { + return runtimeType.then(function (resolvedRuntimeType) { + return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); + }); + } + + return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); +} + +function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) { + var runtimeType = typeof runtimeTypeOrName === 'string' ? exeContext.schema.getType(runtimeTypeOrName) : runtimeTypeOrName; + + if (!(0, _definition.isObjectType)(runtimeType)) { + throw new _GraphQLError.GraphQLError("Abstract type ".concat(returnType.name, " must resolve to an Object type at runtime for field ").concat(info.parentType.name, ".").concat(info.fieldName, " with ") + "value ".concat((0, _inspect.default)(result), ", received \"").concat((0, _inspect.default)(runtimeType), "\". ") + "Either the ".concat(returnType.name, " type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes); + } + + if (!exeContext.schema.isPossibleType(returnType, runtimeType)) { + throw new _GraphQLError.GraphQLError("Runtime Object type \"".concat(runtimeType.name, "\" is not a possible type for \"").concat(returnType.name, "\"."), fieldNodes); + } + + return runtimeType; +} +/** + * Complete an Object value by executing all sub-selections. + */ + + +function completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) { + // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + if (returnType.isTypeOf) { + var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); + + if ((0, _isPromise.default)(isTypeOf)) { + return isTypeOf.then(function (resolvedIsTypeOf) { + if (!resolvedIsTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + + return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); + }); + } + + if (!isTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + } + + return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); +} + +function invalidReturnTypeError(returnType, result, fieldNodes) { + return new _GraphQLError.GraphQLError("Expected value of type \"".concat(returnType.name, "\" but got: ").concat((0, _inspect.default)(result), "."), fieldNodes); +} + +function collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result) { + // Collect sub-fields to execute to complete this value. + var subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); + return executeFields(exeContext, returnType, result, path, subFieldNodes); +} +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ + + +var collectSubfields = (0, _memoize.default)(_collectSubfields); + +function _collectSubfields(exeContext, returnType, fieldNodes) { + var subFieldNodes = Object.create(null); + var visitedFragmentNames = Object.create(null); + + for (var i = 0; i < fieldNodes.length; i++) { + var selectionSet = fieldNodes[i].selectionSet; + + if (selectionSet) { + subFieldNodes = collectFields(exeContext, returnType, selectionSet, subFieldNodes, visitedFragmentNames); + } + } + + return subFieldNodes; +} +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ + + +var defaultTypeResolver = function defaultTypeResolver(value, contextValue, info, abstractType) { + // First, look for `__typename`. + if ((0, _isObjectLike.default)(value) && typeof value.__typename === 'string') { + return value.__typename; + } // Otherwise, test each possible type. + + + var possibleTypes = info.schema.getPossibleTypes(abstractType); + var promisedIsTypeOfResults = []; + + for (var i = 0; i < possibleTypes.length; i++) { + var type = possibleTypes[i]; + + if (type.isTypeOf) { + var isTypeOfResult = type.isTypeOf(value, contextValue, info); + + if ((0, _isPromise.default)(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } else if (isTypeOfResult) { + return type; + } + } + } + + if (promisedIsTypeOfResults.length) { + return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) { + for (var _i = 0; _i < isTypeOfResults.length; _i++) { + if (isTypeOfResults[_i]) { + return possibleTypes[_i]; + } + } + }); + } +}; +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ + + +exports.defaultTypeResolver = defaultTypeResolver; + +var defaultFieldResolver = function defaultFieldResolver(source, args, contextValue, info) { + // ensure source is a value for which property access is acceptable. + if ((0, _isObjectLike.default)(source) || typeof source === 'function') { + var property = source[info.fieldName]; + + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + + return property; + } +}; +/** + * This method looks up the field on the given type definition. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ + + +exports.defaultFieldResolver = defaultFieldResolver; + +function getFieldDef(schema, parentType, fieldName) { + if (fieldName === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.SchemaMetaFieldDef; + } else if (fieldName === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.TypeMetaFieldDef; + } else if (fieldName === _introspection.TypeNameMetaFieldDef.name) { + return _introspection.TypeNameMetaFieldDef; + } + + return parentType.getFields()[fieldName]; +} diff --git a/node_modules/graphql/execution/execute.js.flow b/node_modules/graphql/execution/execute.js.flow new file mode 100644 index 000000000..0232d331c --- /dev/null +++ b/node_modules/graphql/execution/execute.js.flow @@ -0,0 +1,1258 @@ +// @flow strict + +import { forEach, isCollection } from 'iterall'; +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import isInvalid from '../jsutils/isInvalid'; +import isNullish from '../jsutils/isNullish'; +import isPromise from '../jsutils/isPromise'; +import isObjectLike from '../jsutils/isObjectLike'; +import memoize3 from '../jsutils/memoize3'; +import promiseForObject from '../jsutils/promiseForObject'; +import promiseReduce from '../jsutils/promiseReduce'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { type PromiseOrValue } from '../jsutils/PromiseOrValue'; + +import { getOperationRootType } from '../utilities/getOperationRootType'; +import { typeFromAST } from '../utilities/typeFromAST'; +import { Kind } from '../language/kinds'; +import { + getVariableValues, + getArgumentValues, + getDirectiveValues, +} from './values'; +import { + type GraphQLObjectType, + type GraphQLOutputType, + type GraphQLLeafType, + type GraphQLAbstractType, + type GraphQLField, + type GraphQLFieldResolver, + type GraphQLResolveInfo, + type GraphQLTypeResolver, + type ResponsePath, + type GraphQLList, + isObjectType, + isAbstractType, + isLeafType, + isListType, + isNonNullType, +} from '../type/definition'; +import { type GraphQLSchema } from '../type/schema'; +import { + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from '../type/introspection'; +import { + GraphQLIncludeDirective, + GraphQLSkipDirective, +} from '../type/directives'; +import { assertValidSchema } from '../type/validate'; +import { + type DocumentNode, + type OperationDefinitionNode, + type SelectionSetNode, + type FieldNode, + type FragmentSpreadNode, + type InlineFragmentNode, + type FragmentDefinitionNode, +} from '../language/ast'; + +/** + * Terminology + * + * "Definitions" are the generic name for top-level statements in the document. + * Examples of this include: + * 1) Operations (such as a query) + * 2) Fragments + * + * "Operations" are a generic name for requests in the document. + * Examples of this include: + * 1) query, + * 2) mutation + * + * "Selections" are the definitions that can appear legally and at + * single level of the query. These include: + * 1) field references e.g "a" + * 2) fragment "spreads" e.g. "...c" + * 3) inline fragment "spreads" e.g. "...on Type { a }" + */ + +/** + * Data that must be available at all points during query execution. + * + * Namely, schema of the type system that is currently executing, + * and the fragments defined in the query document + */ +export type ExecutionContext = {| + schema: GraphQLSchema, + fragments: ObjMap, + rootValue: mixed, + contextValue: mixed, + operation: OperationDefinitionNode, + variableValues: { [variable: string]: mixed, ... }, + fieldResolver: GraphQLFieldResolver, + typeResolver: GraphQLTypeResolver, + errors: Array, +|}; + +/** + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. + */ +export type ExecutionResult = { + errors?: $ReadOnlyArray, + data?: ObjMap | null, + ... +}; + +export type ExecutionArgs = {| + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +|}; + +/** + * Implements the "Evaluating requests" section of the GraphQL specification. + * + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. + * + * If the arguments to this function do not result in a legal execution context, + * a GraphQLError will be thrown immediately explaining the invalid input. + * + * Accepts either an object with named arguments, or individual arguments. + */ +declare function execute( + ExecutionArgs, + ..._: [] +): PromiseOrValue; +/* eslint-disable no-redeclare */ +declare function execute( + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +): PromiseOrValue; +export function execute( + argsOrSchema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, +) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 + ? executeImpl(argsOrSchema) + : executeImpl({ + schema: argsOrSchema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }); +} + +function executeImpl(args: ExecutionArgs): ExecutionResult { + const { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + } = args; + + // If arguments are missing or incorrect, throw an error. + assertValidExecutionArguments(schema, document, variableValues); + + // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + const exeContext = buildExecutionContext( + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + ); + + // Return early errors if execution context failed. + if (Array.isArray(exeContext)) { + return { errors: exeContext }; + } + + // Return a Promise that will eventually resolve to the data described by + // The "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + const data = executeOperation(exeContext, exeContext.operation, rootValue); + return buildResponse(exeContext, data); +} + +/** + * Given a completed execution context and data, build the { errors, data } + * response defined by the "Response" section of the GraphQL specification. + */ +function buildResponse( + exeContext: ExecutionContext, + data: PromiseOrValue | null>, +): ExecutionResult { + if (isPromise(data)) { + return data.then(resolved => buildResponse(exeContext, resolved)); + } + return exeContext.errors.length === 0 + ? { data } + : { errors: exeContext.errors, data }; +} + +/** + * Given a ResponsePath (found in the `path` entry in the information provided + * as the last argument to a field resolver), return an Array of the path keys. + */ +export function responsePathAsArray( + path: ResponsePath, +): $ReadOnlyArray { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + return flattened.reverse(); +} + +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ +export function addPath(prev: ResponsePath | void, key: string | number) { + return { prev, key }; +} + +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ +export function assertValidExecutionArguments( + schema: GraphQLSchema, + document: DocumentNode, + rawVariableValues: ?{ +[variable: string]: mixed, ... }, +): void { + invariant(document, 'Must provide document'); + + // If the schema used for execution is invalid, throw an error. + assertValidSchema(schema); + + // Variables, if provided, must be an object. + invariant( + rawVariableValues == null || isObjectLike(rawVariableValues), + 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.', + ); +} + +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ +export function buildExecutionContext( + schema: GraphQLSchema, + document: DocumentNode, + rootValue: mixed, + contextValue: mixed, + rawVariableValues: ?{ +[variable: string]: mixed, ... }, + operationName: ?string, + fieldResolver: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +): $ReadOnlyArray | ExecutionContext { + const errors: Array = []; + let operation: OperationDefinitionNode | void; + let hasMultipleAssumedOperations = false; + const fragments: ObjMap = Object.create(null); + for (let i = 0; i < document.definitions.length; i++) { + const definition = document.definitions[i]; + switch (definition.kind) { + case Kind.OPERATION_DEFINITION: + if (!operationName && operation) { + hasMultipleAssumedOperations = true; + } else if ( + !operationName || + (definition.name && definition.name.value === operationName) + ) { + operation = definition; + } + break; + case Kind.FRAGMENT_DEFINITION: + fragments[definition.name.value] = definition; + break; + } + } + + if (!operation) { + if (operationName) { + errors.push( + new GraphQLError(`Unknown operation named "${operationName}".`), + ); + } else { + errors.push(new GraphQLError('Must provide an operation.')); + } + } else if (hasMultipleAssumedOperations) { + errors.push( + new GraphQLError( + 'Must provide operation name if query contains multiple operations.', + ), + ); + } + + let variableValues; + if (operation) { + const coercedVariableValues = getVariableValues( + schema, + operation.variableDefinitions || [], + rawVariableValues || {}, + ); + + if (coercedVariableValues.errors) { + errors.push(...coercedVariableValues.errors); + } else { + variableValues = coercedVariableValues.coerced; + } + } + + if (errors.length !== 0) { + return errors; + } + + invariant(operation, 'Has operation if no errors.'); + invariant(variableValues, 'Has variables if no errors.'); + + return { + schema, + fragments, + rootValue, + contextValue, + operation, + variableValues, + fieldResolver: fieldResolver || defaultFieldResolver, + typeResolver: typeResolver || defaultTypeResolver, + errors, + }; +} + +/** + * Implements the "Evaluating operations" section of the spec. + */ +function executeOperation( + exeContext: ExecutionContext, + operation: OperationDefinitionNode, + rootValue: mixed, +): PromiseOrValue | null> { + const type = getOperationRootType(exeContext.schema, operation); + const fields = collectFields( + exeContext, + type, + operation.selectionSet, + Object.create(null), + Object.create(null), + ); + + const path = undefined; + + // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + // + // Similar to completeValueCatchingError. + try { + const result = + operation.operation === 'mutation' + ? executeFieldsSerially(exeContext, type, rootValue, path, fields) + : executeFields(exeContext, type, rootValue, path, fields); + if (isPromise(result)) { + return result.then(undefined, error => { + exeContext.errors.push(error); + return Promise.resolve(null); + }); + } + return result; + } catch (error) { + exeContext.errors.push(error); + return null; + } +} + +/** + * Implements the "Evaluating selection sets" section of the spec + * for "write" mode. + */ +function executeFieldsSerially( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + sourceValue: mixed, + path: ResponsePath | void, + fields: ObjMap>, +): PromiseOrValue> { + return promiseReduce( + Object.keys(fields), + (results, responseName) => { + const fieldNodes = fields[responseName]; + const fieldPath = addPath(path, responseName); + const result = resolveField( + exeContext, + parentType, + sourceValue, + fieldNodes, + fieldPath, + ); + if (result === undefined) { + return results; + } + if (isPromise(result)) { + return result.then(resolvedResult => { + results[responseName] = resolvedResult; + return results; + }); + } + results[responseName] = result; + return results; + }, + Object.create(null), + ); +} + +/** + * Implements the "Evaluating selection sets" section of the spec + * for "read" mode. + */ +function executeFields( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + sourceValue: mixed, + path: ResponsePath | void, + fields: ObjMap>, +): PromiseOrValue> { + const results = Object.create(null); + let containsPromise = false; + + for (let i = 0, keys = Object.keys(fields); i < keys.length; ++i) { + const responseName = keys[i]; + const fieldNodes = fields[responseName]; + const fieldPath = addPath(path, responseName); + const result = resolveField( + exeContext, + parentType, + sourceValue, + fieldNodes, + fieldPath, + ); + + if (result !== undefined) { + results[responseName] = result; + if (!containsPromise && isPromise(result)) { + containsPromise = true; + } + } + } + + // If there are no promises, we can just return the object + if (!containsPromise) { + return results; + } + + // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + return promiseForObject(results); +} + +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ +export function collectFields( + exeContext: ExecutionContext, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, + fields: ObjMap>, + visitedFragmentNames: ObjMap, +): ObjMap> { + for (let i = 0; i < selectionSet.selections.length; i++) { + const selection = selectionSet.selections[i]; + switch (selection.kind) { + case Kind.FIELD: { + if (!shouldIncludeNode(exeContext, selection)) { + continue; + } + const name = getFieldEntryKey(selection); + if (!fields[name]) { + fields[name] = []; + } + fields[name].push(selection); + break; + } + case Kind.INLINE_FRAGMENT: { + if ( + !shouldIncludeNode(exeContext, selection) || + !doesFragmentConditionMatch(exeContext, selection, runtimeType) + ) { + continue; + } + collectFields( + exeContext, + runtimeType, + selection.selectionSet, + fields, + visitedFragmentNames, + ); + break; + } + case Kind.FRAGMENT_SPREAD: { + const fragName = selection.name.value; + if ( + visitedFragmentNames[fragName] || + !shouldIncludeNode(exeContext, selection) + ) { + continue; + } + visitedFragmentNames[fragName] = true; + const fragment = exeContext.fragments[fragName]; + if ( + !fragment || + !doesFragmentConditionMatch(exeContext, fragment, runtimeType) + ) { + continue; + } + collectFields( + exeContext, + runtimeType, + fragment.selectionSet, + fields, + visitedFragmentNames, + ); + break; + } + } + } + return fields; +} + +/** + * Determines if a field should be included based on the @include and @skip + * directives, where @skip has higher precedence than @include. + */ +function shouldIncludeNode( + exeContext: ExecutionContext, + node: FragmentSpreadNode | FieldNode | InlineFragmentNode, +): boolean { + const skip = getDirectiveValues( + GraphQLSkipDirective, + node, + exeContext.variableValues, + ); + if (skip && skip.if === true) { + return false; + } + + const include = getDirectiveValues( + GraphQLIncludeDirective, + node, + exeContext.variableValues, + ); + if (include && include.if === false) { + return false; + } + return true; +} + +/** + * Determines if a fragment is applicable to the given type. + */ +function doesFragmentConditionMatch( + exeContext: ExecutionContext, + fragment: FragmentDefinitionNode | InlineFragmentNode, + type: GraphQLObjectType, +): boolean { + const typeConditionNode = fragment.typeCondition; + if (!typeConditionNode) { + return true; + } + const conditionalType = typeFromAST(exeContext.schema, typeConditionNode); + if (conditionalType === type) { + return true; + } + if (isAbstractType(conditionalType)) { + return exeContext.schema.isPossibleType(conditionalType, type); + } + return false; +} + +/** + * Implements the logic to compute the key of a given field's entry + */ +function getFieldEntryKey(node: FieldNode): string { + return node.alias ? node.alias.value : node.name.value; +} + +/** + * Resolves the field on the given source object. In particular, this + * figures out the value that the field returns by calling its resolve function, + * then calls completeValue to complete promises, serialize scalars, or execute + * the sub-selection-set for objects. + */ +function resolveField( + exeContext: ExecutionContext, + parentType: GraphQLObjectType, + source: mixed, + fieldNodes: $ReadOnlyArray, + path: ResponsePath, +): PromiseOrValue { + const fieldNode = fieldNodes[0]; + const fieldName = fieldNode.name.value; + + const fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); + if (!fieldDef) { + return; + } + + const resolveFn = fieldDef.resolve || exeContext.fieldResolver; + + const info = buildResolveInfo( + exeContext, + fieldDef, + fieldNodes, + parentType, + path, + ); + + // Get the resolve function, regardless of if its result is normal + // or abrupt (error). + const result = resolveFieldValueOrError( + exeContext, + fieldDef, + fieldNodes, + resolveFn, + source, + info, + ); + + return completeValueCatchingError( + exeContext, + fieldDef.type, + fieldNodes, + info, + path, + result, + ); +} + +export function buildResolveInfo( + exeContext: ExecutionContext, + fieldDef: GraphQLField<*, *>, + fieldNodes: $ReadOnlyArray, + parentType: GraphQLObjectType, + path: ResponsePath, +): GraphQLResolveInfo { + // The resolve function's optional fourth argument is a collection of + // information about the current execution state. + return { + fieldName: fieldDef.name, + fieldNodes, + returnType: fieldDef.type, + parentType, + path, + schema: exeContext.schema, + fragments: exeContext.fragments, + rootValue: exeContext.rootValue, + operation: exeContext.operation, + variableValues: exeContext.variableValues, + }; +} + +// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. +export function resolveFieldValueOrError( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: $ReadOnlyArray, + resolveFn: GraphQLFieldResolver, + source: TSource, + info: GraphQLResolveInfo, +): Error | mixed { + try { + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + // TODO: find a way to memoize, in case this field is within a List type. + const args = getArgumentValues( + fieldDef, + fieldNodes[0], + exeContext.variableValues, + ); + + // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + const contextValue = exeContext.contextValue; + + const result = resolveFn(source, args, contextValue, info); + return isPromise(result) ? result.then(undefined, asErrorInstance) : result; + } catch (error) { + return asErrorInstance(error); + } +} + +// Sometimes a non-error is thrown, wrap it as an Error instance to ensure a +// consistent Error interface. +function asErrorInstance(error: mixed): Error { + if (error instanceof Error) { + return error; + } + return new Error('Unexpected error value: ' + inspect(error)); +} + +// This is a small wrapper around completeValue which detects and logs errors +// in the execution context. +function completeValueCatchingError( + exeContext: ExecutionContext, + returnType: GraphQLOutputType, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + path: ResponsePath, + result: mixed, +): PromiseOrValue { + try { + let completed; + if (isPromise(result)) { + completed = result.then(resolved => + completeValue(exeContext, returnType, fieldNodes, info, path, resolved), + ); + } else { + completed = completeValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + if (isPromise(completed)) { + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completed.then(undefined, error => + handleFieldError(error, fieldNodes, path, returnType, exeContext), + ); + } + return completed; + } catch (error) { + return handleFieldError(error, fieldNodes, path, returnType, exeContext); + } +} + +function handleFieldError(rawError, fieldNodes, path, returnType, exeContext) { + const error = locatedError( + asErrorInstance(rawError), + fieldNodes, + responsePathAsArray(path), + ); + + // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + if (isNonNullType(returnType)) { + throw error; + } + + // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + exeContext.errors.push(error); + return null; +} + +/** + * Implements the instructions for completeValue as defined in the + * "Field entries" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by evaluating all sub-selections. + */ +function completeValue( + exeContext: ExecutionContext, + returnType: GraphQLOutputType, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + path: ResponsePath, + result: mixed, +): PromiseOrValue { + // If result is an Error, throw a located error. + if (result instanceof Error) { + throw result; + } + + // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + if (isNonNullType(returnType)) { + const completed = completeValue( + exeContext, + returnType.ofType, + fieldNodes, + info, + path, + result, + ); + if (completed === null) { + throw new Error( + `Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`, + ); + } + return completed; + } + + // If result value is null-ish (null, undefined, or NaN) then return null. + if (isNullish(result)) { + return null; + } + + // If field type is List, complete each item in the list with the inner type + if (isListType(returnType)) { + return completeListValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + // If field type is a leaf type, Scalar or Enum, serialize to a valid value, + // returning null if serialization is not possible. + if (isLeafType(returnType)) { + return completeLeafValue(returnType, result); + } + + // If field type is an abstract type, Interface or Union, determine the + // runtime Object type and complete for that type. + if (isAbstractType(returnType)) { + return completeAbstractValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + // If field type is Object, execute and complete all sub-selections. + if (isObjectType(returnType)) { + return completeObjectValue( + exeContext, + returnType, + fieldNodes, + info, + path, + result, + ); + } + + // Not reachable. All possible output types have been considered. + /* istanbul ignore next */ + throw new Error( + `Cannot complete value of unexpected output type: "${inspect( + (returnType: empty), + )}".`, + ); +} + +/** + * Complete a list value by completing each item in the list with the + * inner type + */ +function completeListValue( + exeContext: ExecutionContext, + returnType: GraphQLList, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + path: ResponsePath, + result: mixed, +): PromiseOrValue<$ReadOnlyArray> { + invariant( + isCollection(result), + `Expected Iterable, but did not find one for field ${info.parentType.name}.${info.fieldName}.`, + ); + + // This is specified as a simple map, however we're optimizing the path + // where the list contains no Promises by avoiding creating another Promise. + const itemType = returnType.ofType; + let containsPromise = false; + const completedResults = []; + forEach((result: any), (item, index) => { + // No need to modify the info object containing the path, + // since from here on it is not ever accessed by resolver functions. + const fieldPath = addPath(path, index); + const completedItem = completeValueCatchingError( + exeContext, + itemType, + fieldNodes, + info, + fieldPath, + item, + ); + + if (!containsPromise && isPromise(completedItem)) { + containsPromise = true; + } + completedResults.push(completedItem); + }); + + return containsPromise ? Promise.all(completedResults) : completedResults; +} + +/** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + */ +function completeLeafValue(returnType: GraphQLLeafType, result: mixed): mixed { + invariant(returnType.serialize, 'Missing serialize method on type'); + const serializedResult = returnType.serialize(result); + if (isInvalid(serializedResult)) { + throw new Error( + `Expected a value of type "${inspect(returnType)}" but ` + + `received: ${inspect(result)}`, + ); + } + return serializedResult; +} + +/** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + */ +function completeAbstractValue( + exeContext: ExecutionContext, + returnType: GraphQLAbstractType, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + path: ResponsePath, + result: mixed, +): PromiseOrValue> { + const resolveTypeFn = returnType.resolveType || exeContext.typeResolver; + const contextValue = exeContext.contextValue; + const runtimeType = resolveTypeFn(result, contextValue, info, returnType); + + if (isPromise(runtimeType)) { + return runtimeType.then(resolvedRuntimeType => + completeObjectValue( + exeContext, + ensureValidRuntimeType( + resolvedRuntimeType, + exeContext, + returnType, + fieldNodes, + info, + result, + ), + fieldNodes, + info, + path, + result, + ), + ); + } + + return completeObjectValue( + exeContext, + ensureValidRuntimeType( + runtimeType, + exeContext, + returnType, + fieldNodes, + info, + result, + ), + fieldNodes, + info, + path, + result, + ); +} + +function ensureValidRuntimeType( + runtimeTypeOrName: ?GraphQLObjectType | string, + exeContext: ExecutionContext, + returnType: GraphQLAbstractType, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + result: mixed, +): GraphQLObjectType { + const runtimeType = + typeof runtimeTypeOrName === 'string' + ? exeContext.schema.getType(runtimeTypeOrName) + : runtimeTypeOrName; + + if (!isObjectType(runtimeType)) { + throw new GraphQLError( + `Abstract type ${returnType.name} must resolve to an Object type at runtime for field ${info.parentType.name}.${info.fieldName} with ` + + `value ${inspect(result)}, received "${inspect(runtimeType)}". ` + + `Either the ${returnType.name} type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, + fieldNodes, + ); + } + + if (!exeContext.schema.isPossibleType(returnType, runtimeType)) { + throw new GraphQLError( + `Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`, + fieldNodes, + ); + } + + return runtimeType; +} + +/** + * Complete an Object value by executing all sub-selections. + */ +function completeObjectValue( + exeContext: ExecutionContext, + returnType: GraphQLObjectType, + fieldNodes: $ReadOnlyArray, + info: GraphQLResolveInfo, + path: ResponsePath, + result: mixed, +): PromiseOrValue> { + // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + if (returnType.isTypeOf) { + const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); + + if (isPromise(isTypeOf)) { + return isTypeOf.then(resolvedIsTypeOf => { + if (!resolvedIsTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + return collectAndExecuteSubfields( + exeContext, + returnType, + fieldNodes, + path, + result, + ); + }); + } + + if (!isTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + } + + return collectAndExecuteSubfields( + exeContext, + returnType, + fieldNodes, + path, + result, + ); +} + +function invalidReturnTypeError( + returnType: GraphQLObjectType, + result: mixed, + fieldNodes: $ReadOnlyArray, +): GraphQLError { + return new GraphQLError( + `Expected value of type "${returnType.name}" but got: ${inspect(result)}.`, + fieldNodes, + ); +} + +function collectAndExecuteSubfields( + exeContext: ExecutionContext, + returnType: GraphQLObjectType, + fieldNodes: $ReadOnlyArray, + path: ResponsePath, + result: mixed, +): PromiseOrValue> { + // Collect sub-fields to execute to complete this value. + const subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); + return executeFields(exeContext, returnType, result, path, subFieldNodes); +} + +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ +const collectSubfields = memoize3(_collectSubfields); +function _collectSubfields( + exeContext: ExecutionContext, + returnType: GraphQLObjectType, + fieldNodes: $ReadOnlyArray, +): ObjMap> { + let subFieldNodes = Object.create(null); + const visitedFragmentNames = Object.create(null); + for (let i = 0; i < fieldNodes.length; i++) { + const selectionSet = fieldNodes[i].selectionSet; + if (selectionSet) { + subFieldNodes = collectFields( + exeContext, + returnType, + selectionSet, + subFieldNodes, + visitedFragmentNames, + ); + } + } + return subFieldNodes; +} + +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ +export const defaultTypeResolver: GraphQLTypeResolver = function( + value, + contextValue, + info, + abstractType, +) { + // First, look for `__typename`. + if (isObjectLike(value) && typeof value.__typename === 'string') { + return value.__typename; + } + + // Otherwise, test each possible type. + const possibleTypes = info.schema.getPossibleTypes(abstractType); + const promisedIsTypeOfResults = []; + + for (let i = 0; i < possibleTypes.length; i++) { + const type = possibleTypes[i]; + + if (type.isTypeOf) { + const isTypeOfResult = type.isTypeOf(value, contextValue, info); + + if (isPromise(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } else if (isTypeOfResult) { + return type; + } + } + } + + if (promisedIsTypeOfResults.length) { + return Promise.all(promisedIsTypeOfResults).then(isTypeOfResults => { + for (let i = 0; i < isTypeOfResults.length; i++) { + if (isTypeOfResults[i]) { + return possibleTypes[i]; + } + } + }); + } +}; + +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ +export const defaultFieldResolver: GraphQLFieldResolver = function( + source, + args, + contextValue, + info, +) { + // ensure source is a value for which property access is acceptable. + if (isObjectLike(source) || typeof source === 'function') { + const property = source[info.fieldName]; + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + return property; + } +}; + +/** + * This method looks up the field on the given type definition. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ +export function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLObjectType, + fieldName: string, +): ?GraphQLField<*, *> { + if ( + fieldName === SchemaMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return SchemaMetaFieldDef; + } else if ( + fieldName === TypeMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return TypeMetaFieldDef; + } else if (fieldName === TypeNameMetaFieldDef.name) { + return TypeNameMetaFieldDef; + } + return parentType.getFields()[fieldName]; +} diff --git a/node_modules/graphql/execution/execute.mjs b/node_modules/graphql/execution/execute.mjs new file mode 100644 index 000000000..733a65f89 --- /dev/null +++ b/node_modules/graphql/execution/execute.mjs @@ -0,0 +1,812 @@ +import { forEach, isCollection } from 'iterall'; +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import isInvalid from '../jsutils/isInvalid'; +import isNullish from '../jsutils/isNullish'; +import isPromise from '../jsutils/isPromise'; +import isObjectLike from '../jsutils/isObjectLike'; +import memoize3 from '../jsutils/memoize3'; +import promiseForObject from '../jsutils/promiseForObject'; +import promiseReduce from '../jsutils/promiseReduce'; +import { getOperationRootType } from '../utilities/getOperationRootType'; +import { typeFromAST } from '../utilities/typeFromAST'; +import { Kind } from '../language/kinds'; +import { getVariableValues, getArgumentValues, getDirectiveValues } from './values'; +import { isObjectType, isAbstractType, isLeafType, isListType, isNonNullType } from '../type/definition'; +import { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from '../type/introspection'; +import { GraphQLIncludeDirective, GraphQLSkipDirective } from '../type/directives'; +import { assertValidSchema } from '../type/validate'; +export function execute(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 ? executeImpl(argsOrSchema) : executeImpl({ + schema: argsOrSchema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); +} + +function executeImpl(args) { + var schema = args.schema, + document = args.document, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + typeResolver = args.typeResolver; // If arguments are missing or incorrect, throw an error. + + assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, + // a "Response" with only errors is returned. + + var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver); // Return early errors if execution context failed. + + if (Array.isArray(exeContext)) { + return { + errors: exeContext + }; + } // Return a Promise that will eventually resolve to the data described by + // The "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + + + var data = executeOperation(exeContext, exeContext.operation, rootValue); + return buildResponse(exeContext, data); +} +/** + * Given a completed execution context and data, build the { errors, data } + * response defined by the "Response" section of the GraphQL specification. + */ + + +function buildResponse(exeContext, data) { + if (isPromise(data)) { + return data.then(function (resolved) { + return buildResponse(exeContext, resolved); + }); + } + + return exeContext.errors.length === 0 ? { + data: data + } : { + errors: exeContext.errors, + data: data + }; +} +/** + * Given a ResponsePath (found in the `path` entry in the information provided + * as the last argument to a field resolver), return an Array of the path keys. + */ + + +export function responsePathAsArray(path) { + var flattened = []; + var curr = path; + + while (curr) { + flattened.push(curr.key); + curr = curr.prev; + } + + return flattened.reverse(); +} +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ + +export function addPath(prev, key) { + return { + prev: prev, + key: key + }; +} +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ + +export function assertValidExecutionArguments(schema, document, rawVariableValues) { + !document ? invariant(0, 'Must provide document') : void 0; // If the schema used for execution is invalid, throw an error. + + assertValidSchema(schema); // Variables, if provided, must be an object. + + !(rawVariableValues == null || isObjectLike(rawVariableValues)) ? invariant(0, 'Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.') : void 0; +} +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ + +export function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) { + var errors = []; + var operation; + var hasMultipleAssumedOperations = false; + var fragments = Object.create(null); + + for (var i = 0; i < document.definitions.length; i++) { + var definition = document.definitions[i]; + + switch (definition.kind) { + case Kind.OPERATION_DEFINITION: + if (!operationName && operation) { + hasMultipleAssumedOperations = true; + } else if (!operationName || definition.name && definition.name.value === operationName) { + operation = definition; + } + + break; + + case Kind.FRAGMENT_DEFINITION: + fragments[definition.name.value] = definition; + break; + } + } + + if (!operation) { + if (operationName) { + errors.push(new GraphQLError("Unknown operation named \"".concat(operationName, "\"."))); + } else { + errors.push(new GraphQLError('Must provide an operation.')); + } + } else if (hasMultipleAssumedOperations) { + errors.push(new GraphQLError('Must provide operation name if query contains multiple operations.')); + } + + var variableValues; + + if (operation) { + var coercedVariableValues = getVariableValues(schema, operation.variableDefinitions || [], rawVariableValues || {}); + + if (coercedVariableValues.errors) { + errors.push.apply(errors, coercedVariableValues.errors); + } else { + variableValues = coercedVariableValues.coerced; + } + } + + if (errors.length !== 0) { + return errors; + } + + !operation ? invariant(0, 'Has operation if no errors.') : void 0; + !variableValues ? invariant(0, 'Has variables if no errors.') : void 0; + return { + schema: schema, + fragments: fragments, + rootValue: rootValue, + contextValue: contextValue, + operation: operation, + variableValues: variableValues, + fieldResolver: fieldResolver || defaultFieldResolver, + typeResolver: typeResolver || defaultTypeResolver, + errors: errors + }; +} +/** + * Implements the "Evaluating operations" section of the spec. + */ + +function executeOperation(exeContext, operation, rootValue) { + var type = getOperationRootType(exeContext.schema, operation); + var fields = collectFields(exeContext, type, operation.selectionSet, Object.create(null), Object.create(null)); + var path = undefined; // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + // + // Similar to completeValueCatchingError. + + try { + var result = operation.operation === 'mutation' ? executeFieldsSerially(exeContext, type, rootValue, path, fields) : executeFields(exeContext, type, rootValue, path, fields); + + if (isPromise(result)) { + return result.then(undefined, function (error) { + exeContext.errors.push(error); + return Promise.resolve(null); + }); + } + + return result; + } catch (error) { + exeContext.errors.push(error); + return null; + } +} +/** + * Implements the "Evaluating selection sets" section of the spec + * for "write" mode. + */ + + +function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) { + return promiseReduce(Object.keys(fields), function (results, responseName) { + var fieldNodes = fields[responseName]; + var fieldPath = addPath(path, responseName); + var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + + if (result === undefined) { + return results; + } + + if (isPromise(result)) { + return result.then(function (resolvedResult) { + results[responseName] = resolvedResult; + return results; + }); + } + + results[responseName] = result; + return results; + }, Object.create(null)); +} +/** + * Implements the "Evaluating selection sets" section of the spec + * for "read" mode. + */ + + +function executeFields(exeContext, parentType, sourceValue, path, fields) { + var results = Object.create(null); + var containsPromise = false; + + for (var i = 0, keys = Object.keys(fields); i < keys.length; ++i) { + var responseName = keys[i]; + var fieldNodes = fields[responseName]; + var fieldPath = addPath(path, responseName); + var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + + if (result !== undefined) { + results[responseName] = result; + + if (!containsPromise && isPromise(result)) { + containsPromise = true; + } + } + } // If there are no promises, we can just return the object + + + if (!containsPromise) { + return results; + } // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + + + return promiseForObject(results); +} +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ + + +export function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) { + for (var i = 0; i < selectionSet.selections.length; i++) { + var selection = selectionSet.selections[i]; + + switch (selection.kind) { + case Kind.FIELD: + { + if (!shouldIncludeNode(exeContext, selection)) { + continue; + } + + var name = getFieldEntryKey(selection); + + if (!fields[name]) { + fields[name] = []; + } + + fields[name].push(selection); + break; + } + + case Kind.INLINE_FRAGMENT: + { + if (!shouldIncludeNode(exeContext, selection) || !doesFragmentConditionMatch(exeContext, selection, runtimeType)) { + continue; + } + + collectFields(exeContext, runtimeType, selection.selectionSet, fields, visitedFragmentNames); + break; + } + + case Kind.FRAGMENT_SPREAD: + { + var fragName = selection.name.value; + + if (visitedFragmentNames[fragName] || !shouldIncludeNode(exeContext, selection)) { + continue; + } + + visitedFragmentNames[fragName] = true; + var fragment = exeContext.fragments[fragName]; + + if (!fragment || !doesFragmentConditionMatch(exeContext, fragment, runtimeType)) { + continue; + } + + collectFields(exeContext, runtimeType, fragment.selectionSet, fields, visitedFragmentNames); + break; + } + } + } + + return fields; +} +/** + * Determines if a field should be included based on the @include and @skip + * directives, where @skip has higher precedence than @include. + */ + +function shouldIncludeNode(exeContext, node) { + var skip = getDirectiveValues(GraphQLSkipDirective, node, exeContext.variableValues); + + if (skip && skip.if === true) { + return false; + } + + var include = getDirectiveValues(GraphQLIncludeDirective, node, exeContext.variableValues); + + if (include && include.if === false) { + return false; + } + + return true; +} +/** + * Determines if a fragment is applicable to the given type. + */ + + +function doesFragmentConditionMatch(exeContext, fragment, type) { + var typeConditionNode = fragment.typeCondition; + + if (!typeConditionNode) { + return true; + } + + var conditionalType = typeFromAST(exeContext.schema, typeConditionNode); + + if (conditionalType === type) { + return true; + } + + if (isAbstractType(conditionalType)) { + return exeContext.schema.isPossibleType(conditionalType, type); + } + + return false; +} +/** + * Implements the logic to compute the key of a given field's entry + */ + + +function getFieldEntryKey(node) { + return node.alias ? node.alias.value : node.name.value; +} +/** + * Resolves the field on the given source object. In particular, this + * figures out the value that the field returns by calling its resolve function, + * then calls completeValue to complete promises, serialize scalars, or execute + * the sub-selection-set for objects. + */ + + +function resolveField(exeContext, parentType, source, fieldNodes, path) { + var fieldNode = fieldNodes[0]; + var fieldName = fieldNode.name.value; + var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); + + if (!fieldDef) { + return; + } + + var resolveFn = fieldDef.resolve || exeContext.fieldResolver; + var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path); // Get the resolve function, regardless of if its result is normal + // or abrupt (error). + + var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info); + return completeValueCatchingError(exeContext, fieldDef.type, fieldNodes, info, path, result); +} + +export function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) { + // The resolve function's optional fourth argument is a collection of + // information about the current execution state. + return { + fieldName: fieldDef.name, + fieldNodes: fieldNodes, + returnType: fieldDef.type, + parentType: parentType, + path: path, + schema: exeContext.schema, + fragments: exeContext.fragments, + rootValue: exeContext.rootValue, + operation: exeContext.operation, + variableValues: exeContext.variableValues + }; +} // Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. + +export function resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, source, info) { + try { + // Build a JS object of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + // TODO: find a way to memoize, in case this field is within a List type. + var args = getArgumentValues(fieldDef, fieldNodes[0], exeContext.variableValues); // The resolve function's optional third argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + + var _contextValue = exeContext.contextValue; + var result = resolveFn(source, args, _contextValue, info); + return isPromise(result) ? result.then(undefined, asErrorInstance) : result; + } catch (error) { + return asErrorInstance(error); + } +} // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a +// consistent Error interface. + +function asErrorInstance(error) { + if (error instanceof Error) { + return error; + } + + return new Error('Unexpected error value: ' + inspect(error)); +} // This is a small wrapper around completeValue which detects and logs errors +// in the execution context. + + +function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) { + try { + var completed; + + if (isPromise(result)) { + completed = result.then(function (resolved) { + return completeValue(exeContext, returnType, fieldNodes, info, path, resolved); + }); + } else { + completed = completeValue(exeContext, returnType, fieldNodes, info, path, result); + } + + if (isPromise(completed)) { + // Note: we don't rely on a `catch` method, but we do expect "thenable" + // to take a second callback for the error case. + return completed.then(undefined, function (error) { + return handleFieldError(error, fieldNodes, path, returnType, exeContext); + }); + } + + return completed; + } catch (error) { + return handleFieldError(error, fieldNodes, path, returnType, exeContext); + } +} + +function handleFieldError(rawError, fieldNodes, path, returnType, exeContext) { + var error = locatedError(asErrorInstance(rawError), fieldNodes, responsePathAsArray(path)); // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + + if (isNonNullType(returnType)) { + throw error; + } // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + + + exeContext.errors.push(error); + return null; +} +/** + * Implements the instructions for completeValue as defined in the + * "Field entries" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by evaluating all sub-selections. + */ + + +function completeValue(exeContext, returnType, fieldNodes, info, path, result) { + // If result is an Error, throw a located error. + if (result instanceof Error) { + throw result; + } // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + + + if (isNonNullType(returnType)) { + var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path, result); + + if (completed === null) { + throw new Error("Cannot return null for non-nullable field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")); + } + + return completed; + } // If result value is null-ish (null, undefined, or NaN) then return null. + + + if (isNullish(result)) { + return null; + } // If field type is List, complete each item in the list with the inner type + + + if (isListType(returnType)) { + return completeListValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is a leaf type, Scalar or Enum, serialize to a valid value, + // returning null if serialization is not possible. + + + if (isLeafType(returnType)) { + return completeLeafValue(returnType, result); + } // If field type is an abstract type, Interface or Union, determine the + // runtime Object type and complete for that type. + + + if (isAbstractType(returnType)) { + return completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result); + } // If field type is Object, execute and complete all sub-selections. + + + if (isObjectType(returnType)) { + return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); + } // Not reachable. All possible output types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Cannot complete value of unexpected output type: \"".concat(inspect(returnType), "\".")); +} +/** + * Complete a list value by completing each item in the list with the + * inner type + */ + + +function completeListValue(exeContext, returnType, fieldNodes, info, path, result) { + !isCollection(result) ? invariant(0, "Expected Iterable, but did not find one for field ".concat(info.parentType.name, ".").concat(info.fieldName, ".")) : void 0; // This is specified as a simple map, however we're optimizing the path + // where the list contains no Promises by avoiding creating another Promise. + + var itemType = returnType.ofType; + var containsPromise = false; + var completedResults = []; + forEach(result, function (item, index) { + // No need to modify the info object containing the path, + // since from here on it is not ever accessed by resolver functions. + var fieldPath = addPath(path, index); + var completedItem = completeValueCatchingError(exeContext, itemType, fieldNodes, info, fieldPath, item); + + if (!containsPromise && isPromise(completedItem)) { + containsPromise = true; + } + + completedResults.push(completedItem); + }); + return containsPromise ? Promise.all(completedResults) : completedResults; +} +/** + * Complete a Scalar or Enum by serializing to a valid value, returning + * null if serialization is not possible. + */ + + +function completeLeafValue(returnType, result) { + !returnType.serialize ? invariant(0, 'Missing serialize method on type') : void 0; + var serializedResult = returnType.serialize(result); + + if (isInvalid(serializedResult)) { + throw new Error("Expected a value of type \"".concat(inspect(returnType), "\" but ") + "received: ".concat(inspect(result))); + } + + return serializedResult; +} +/** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + */ + + +function completeAbstractValue(exeContext, returnType, fieldNodes, info, path, result) { + var resolveTypeFn = returnType.resolveType || exeContext.typeResolver; + var contextValue = exeContext.contextValue; + var runtimeType = resolveTypeFn(result, contextValue, info, returnType); + + if (isPromise(runtimeType)) { + return runtimeType.then(function (resolvedRuntimeType) { + return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); + }); + } + + return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path, result); +} + +function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) { + var runtimeType = typeof runtimeTypeOrName === 'string' ? exeContext.schema.getType(runtimeTypeOrName) : runtimeTypeOrName; + + if (!isObjectType(runtimeType)) { + throw new GraphQLError("Abstract type ".concat(returnType.name, " must resolve to an Object type at runtime for field ").concat(info.parentType.name, ".").concat(info.fieldName, " with ") + "value ".concat(inspect(result), ", received \"").concat(inspect(runtimeType), "\". ") + "Either the ".concat(returnType.name, " type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes); + } + + if (!exeContext.schema.isPossibleType(returnType, runtimeType)) { + throw new GraphQLError("Runtime Object type \"".concat(runtimeType.name, "\" is not a possible type for \"").concat(returnType.name, "\"."), fieldNodes); + } + + return runtimeType; +} +/** + * Complete an Object value by executing all sub-selections. + */ + + +function completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) { + // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + if (returnType.isTypeOf) { + var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); + + if (isPromise(isTypeOf)) { + return isTypeOf.then(function (resolvedIsTypeOf) { + if (!resolvedIsTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + + return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); + }); + } + + if (!isTypeOf) { + throw invalidReturnTypeError(returnType, result, fieldNodes); + } + } + + return collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result); +} + +function invalidReturnTypeError(returnType, result, fieldNodes) { + return new GraphQLError("Expected value of type \"".concat(returnType.name, "\" but got: ").concat(inspect(result), "."), fieldNodes); +} + +function collectAndExecuteSubfields(exeContext, returnType, fieldNodes, path, result) { + // Collect sub-fields to execute to complete this value. + var subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); + return executeFields(exeContext, returnType, result, path, subFieldNodes); +} +/** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ + + +var collectSubfields = memoize3(_collectSubfields); + +function _collectSubfields(exeContext, returnType, fieldNodes) { + var subFieldNodes = Object.create(null); + var visitedFragmentNames = Object.create(null); + + for (var i = 0; i < fieldNodes.length; i++) { + var selectionSet = fieldNodes[i].selectionSet; + + if (selectionSet) { + subFieldNodes = collectFields(exeContext, returnType, selectionSet, subFieldNodes, visitedFragmentNames); + } + } + + return subFieldNodes; +} +/** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + */ + + +export var defaultTypeResolver = function defaultTypeResolver(value, contextValue, info, abstractType) { + // First, look for `__typename`. + if (isObjectLike(value) && typeof value.__typename === 'string') { + return value.__typename; + } // Otherwise, test each possible type. + + + var possibleTypes = info.schema.getPossibleTypes(abstractType); + var promisedIsTypeOfResults = []; + + for (var i = 0; i < possibleTypes.length; i++) { + var type = possibleTypes[i]; + + if (type.isTypeOf) { + var isTypeOfResult = type.isTypeOf(value, contextValue, info); + + if (isPromise(isTypeOfResult)) { + promisedIsTypeOfResults[i] = isTypeOfResult; + } else if (isTypeOfResult) { + return type; + } + } + } + + if (promisedIsTypeOfResults.length) { + return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) { + for (var _i = 0; _i < isTypeOfResults.length; _i++) { + if (isTypeOfResults[_i]) { + return possibleTypes[_i]; + } + } + }); + } +}; +/** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the source object of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context value. + */ + +export var defaultFieldResolver = function defaultFieldResolver(source, args, contextValue, info) { + // ensure source is a value for which property access is acceptable. + if (isObjectLike(source) || typeof source === 'function') { + var property = source[info.fieldName]; + + if (typeof property === 'function') { + return source[info.fieldName](args, contextValue, info); + } + + return property; + } +}; +/** + * This method looks up the field on the given type definition. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ + +export function getFieldDef(schema, parentType, fieldName) { + if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return SchemaMetaFieldDef; + } else if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return TypeMetaFieldDef; + } else if (fieldName === TypeNameMetaFieldDef.name) { + return TypeNameMetaFieldDef; + } + + return parentType.getFields()[fieldName]; +} diff --git a/node_modules/graphql/execution/index.js b/node_modules/graphql/execution/index.js new file mode 100644 index 000000000..bf3224418 --- /dev/null +++ b/node_modules/graphql/execution/index.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "execute", { + enumerable: true, + get: function get() { + return _execute.execute; + } +}); +Object.defineProperty(exports, "defaultFieldResolver", { + enumerable: true, + get: function get() { + return _execute.defaultFieldResolver; + } +}); +Object.defineProperty(exports, "defaultTypeResolver", { + enumerable: true, + get: function get() { + return _execute.defaultTypeResolver; + } +}); +Object.defineProperty(exports, "responsePathAsArray", { + enumerable: true, + get: function get() { + return _execute.responsePathAsArray; + } +}); +Object.defineProperty(exports, "getDirectiveValues", { + enumerable: true, + get: function get() { + return _values.getDirectiveValues; + } +}); + +var _execute = require("./execute"); + +var _values = require("./values"); diff --git a/node_modules/graphql/execution/index.js.flow b/node_modules/graphql/execution/index.js.flow new file mode 100644 index 000000000..3da79ecbe --- /dev/null +++ b/node_modules/graphql/execution/index.js.flow @@ -0,0 +1,11 @@ +// @flow strict + +export { + execute, + defaultFieldResolver, + defaultTypeResolver, + responsePathAsArray, +} from './execute'; +export type { ExecutionArgs, ExecutionResult } from './execute'; + +export { getDirectiveValues } from './values'; diff --git a/node_modules/graphql/execution/index.mjs b/node_modules/graphql/execution/index.mjs new file mode 100644 index 000000000..2791d8814 --- /dev/null +++ b/node_modules/graphql/execution/index.mjs @@ -0,0 +1,2 @@ +export { execute, defaultFieldResolver, defaultTypeResolver, responsePathAsArray } from './execute'; +export { getDirectiveValues } from './values'; diff --git a/node_modules/graphql/execution/values.js b/node_modules/graphql/execution/values.js new file mode 100644 index 000000000..bc7224760 --- /dev/null +++ b/node_modules/graphql/execution/values.js @@ -0,0 +1,231 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getVariableValues = getVariableValues; +exports.getArgumentValues = getArgumentValues; +exports.getDirectiveValues = getDirectiveValues; + +var _find = _interopRequireDefault(require("../polyfills/find")); + +var _GraphQLError = require("../error/GraphQLError"); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _keyMap = _interopRequireDefault(require("../jsutils/keyMap")); + +var _coerceValue = require("../utilities/coerceValue"); + +var _typeFromAST = require("../utilities/typeFromAST"); + +var _valueFromAST = require("../utilities/valueFromAST"); + +var _kinds = require("../language/kinds"); + +var _printer = require("../language/printer"); + +var _definition = require("../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +function getVariableValues(schema, varDefNodes, inputs) { + var errors = []; + var coercedValues = {}; + + for (var i = 0; i < varDefNodes.length; i++) { + var varDefNode = varDefNodes[i]; + var varName = varDefNode.variable.name.value; + var varType = (0, _typeFromAST.typeFromAST)(schema, varDefNode.type); + + if (!(0, _definition.isInputType)(varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + errors.push(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" expected value of type ") + "\"".concat((0, _printer.print)(varDefNode.type), "\" which cannot be used as an input type."), varDefNode.type)); + } else { + var hasValue = hasOwnProperty(inputs, varName); + var value = hasValue ? inputs[varName] : undefined; + + if (!hasValue && varDefNode.defaultValue) { + // If no value was provided to a variable with a default value, + // use the default value. + coercedValues[varName] = (0, _valueFromAST.valueFromAST)(varDefNode.defaultValue, varType); + } else if ((!hasValue || value === null) && (0, _definition.isNonNullType)(varType)) { + // If no value or a nullish value was provided to a variable with a + // non-null type (required), produce an error. + errors.push(new _GraphQLError.GraphQLError(hasValue ? "Variable \"$".concat(varName, "\" of non-null type ") + "\"".concat((0, _inspect.default)(varType), "\" must not be null.") : "Variable \"$".concat(varName, "\" of required type ") + "\"".concat((0, _inspect.default)(varType), "\" was not provided."), varDefNode)); + } else if (hasValue) { + if (value === null) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[varName] = null; + } else { + // Otherwise, a non-null value was provided, coerce it to the expected + // type or report an error if coercion fails. + var coerced = (0, _coerceValue.coerceValue)(value, varType, varDefNode); + var coercionErrors = coerced.errors; + + if (coercionErrors) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = coercionErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var error = _step.value; + error.message = "Variable \"$".concat(varName, "\" got invalid value ").concat((0, _inspect.default)(value), "; ") + error.message; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + errors.push.apply(errors, coercionErrors); + } else { + coercedValues[varName] = coerced.value; + } + } + } + } + } + + return errors.length === 0 ? { + errors: undefined, + coerced: coercedValues + } : { + errors: errors, + coerced: undefined + }; +} +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ + + +function getArgumentValues(def, node, variableValues) { + var coercedValues = {}; + var argDefs = def.args; + var argNodes = node.arguments; + + if (!argDefs || !argNodes) { + return coercedValues; + } + + var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { + return arg.name.value; + }); + + for (var i = 0; i < argDefs.length; i++) { + var argDef = argDefs[i]; + var name = argDef.name; + var argType = argDef.type; + var argumentNode = argNodeMap[name]; + var hasValue = void 0; + var isNull = void 0; + + if (argumentNode && argumentNode.value.kind === _kinds.Kind.VARIABLE) { + var variableName = argumentNode.value.name.value; + hasValue = variableValues != null && hasOwnProperty(variableValues, variableName); + isNull = variableValues != null && variableValues[variableName] === null; + } else { + hasValue = argumentNode != null; + isNull = argumentNode != null && argumentNode.value.kind === _kinds.Kind.NULL; + } + + if (!hasValue && argDef.defaultValue !== undefined) { + // If no argument was provided where the definition has a default value, + // use the default value. + coercedValues[name] = argDef.defaultValue; + } else if ((!hasValue || isNull) && (0, _definition.isNonNullType)(argType)) { + // If no argument or a null value was provided to an argument with a + // non-null type (required), produce a field error. + if (isNull) { + throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of non-null type \"").concat((0, _inspect.default)(argType), "\" ") + 'must not be null.', argumentNode.value); + } else if (argumentNode && argumentNode.value.kind === _kinds.Kind.VARIABLE) { + var _variableName = argumentNode.value.name.value; + throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of required type \"").concat((0, _inspect.default)(argType), "\" ") + "was provided the variable \"$".concat(_variableName, "\" which was not provided a runtime value."), argumentNode.value); + } else { + throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of required type \"").concat((0, _inspect.default)(argType), "\" ") + 'was not provided.', node); + } + } else if (hasValue) { + if (argumentNode.value.kind === _kinds.Kind.NULL) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[name] = null; + } else if (argumentNode.value.kind === _kinds.Kind.VARIABLE) { + var _variableName2 = argumentNode.value.name.value; + !variableValues ? (0, _invariant.default)(0, 'Must exist for hasValue to be true.') : void 0; // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + + coercedValues[name] = variableValues[_variableName2]; + } else { + var valueNode = argumentNode.value; + var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues); + + if (coercedValue === undefined) { + // Note: ValuesOfCorrectType validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" has invalid value ").concat((0, _printer.print)(valueNode), "."), argumentNode.value); + } + + coercedValues[name] = coercedValue; + } + } + } + + return coercedValues; +} +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ + + +function getDirectiveValues(directiveDef, node, variableValues) { + var directiveNode = node.directives && (0, _find.default)(node.directives, function (directive) { + return directive.name.value === directiveDef.name; + }); + + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues); + } +} + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/node_modules/graphql/execution/values.js.flow b/node_modules/graphql/execution/values.js.flow new file mode 100644 index 000000000..87fdd6f52 --- /dev/null +++ b/node_modules/graphql/execution/values.js.flow @@ -0,0 +1,238 @@ +// @flow strict + +import find from '../polyfills/find'; +import { GraphQLError } from '../error/GraphQLError'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import { coerceValue } from '../utilities/coerceValue'; +import { typeFromAST } from '../utilities/typeFromAST'; +import { valueFromAST } from '../utilities/valueFromAST'; +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; +import { + type GraphQLField, + isInputType, + isNonNullType, +} from '../type/definition'; +import { type GraphQLDirective } from '../type/directives'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { type GraphQLSchema } from '../type/schema'; +import { + type FieldNode, + type DirectiveNode, + type VariableDefinitionNode, +} from '../language/ast'; + +type CoercedVariableValues = {| + errors: $ReadOnlyArray | void, + coerced: { [variable: string]: mixed, ... } | void, +|}; + +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getVariableValues( + schema: GraphQLSchema, + varDefNodes: $ReadOnlyArray, + inputs: { +[variable: string]: mixed, ... }, +): CoercedVariableValues { + const errors = []; + const coercedValues = {}; + for (let i = 0; i < varDefNodes.length; i++) { + const varDefNode = varDefNodes[i]; + const varName = varDefNode.variable.name.value; + const varType = typeFromAST(schema, varDefNode.type); + if (!isInputType(varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + errors.push( + new GraphQLError( + `Variable "$${varName}" expected value of type ` + + `"${print( + varDefNode.type, + )}" which cannot be used as an input type.`, + varDefNode.type, + ), + ); + } else { + const hasValue = hasOwnProperty(inputs, varName); + const value = hasValue ? inputs[varName] : undefined; + if (!hasValue && varDefNode.defaultValue) { + // If no value was provided to a variable with a default value, + // use the default value. + coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType); + } else if ((!hasValue || value === null) && isNonNullType(varType)) { + // If no value or a nullish value was provided to a variable with a + // non-null type (required), produce an error. + errors.push( + new GraphQLError( + hasValue + ? `Variable "$${varName}" of non-null type ` + + `"${inspect(varType)}" must not be null.` + : `Variable "$${varName}" of required type ` + + `"${inspect(varType)}" was not provided.`, + varDefNode, + ), + ); + } else if (hasValue) { + if (value === null) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[varName] = null; + } else { + // Otherwise, a non-null value was provided, coerce it to the expected + // type or report an error if coercion fails. + const coerced = coerceValue(value, varType, varDefNode); + const coercionErrors = coerced.errors; + if (coercionErrors) { + for (const error of coercionErrors) { + error.message = + `Variable "$${varName}" got invalid value ${inspect(value)}; ` + + error.message; + } + errors.push(...coercionErrors); + } else { + coercedValues[varName] = coerced.value; + } + } + } + } + } + return errors.length === 0 + ? { errors: undefined, coerced: coercedValues } + : { errors, coerced: undefined }; +} + +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getArgumentValues( + def: GraphQLField<*, *> | GraphQLDirective, + node: FieldNode | DirectiveNode, + variableValues?: ?ObjMap, +): { [argument: string]: mixed, ... } { + const coercedValues = {}; + const argDefs = def.args; + const argNodes = node.arguments; + if (!argDefs || !argNodes) { + return coercedValues; + } + const argNodeMap = keyMap(argNodes, arg => arg.name.value); + for (let i = 0; i < argDefs.length; i++) { + const argDef = argDefs[i]; + const name = argDef.name; + const argType = argDef.type; + const argumentNode = argNodeMap[name]; + let hasValue; + let isNull; + if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) { + const variableName = argumentNode.value.name.value; + hasValue = + variableValues != null && hasOwnProperty(variableValues, variableName); + isNull = variableValues != null && variableValues[variableName] === null; + } else { + hasValue = argumentNode != null; + isNull = argumentNode != null && argumentNode.value.kind === Kind.NULL; + } + + if (!hasValue && argDef.defaultValue !== undefined) { + // If no argument was provided where the definition has a default value, + // use the default value. + coercedValues[name] = argDef.defaultValue; + } else if ((!hasValue || isNull) && isNonNullType(argType)) { + // If no argument or a null value was provided to an argument with a + // non-null type (required), produce a field error. + if (isNull) { + throw new GraphQLError( + `Argument "${name}" of non-null type "${inspect(argType)}" ` + + 'must not be null.', + argumentNode.value, + ); + } else if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) { + const variableName = argumentNode.value.name.value; + throw new GraphQLError( + `Argument "${name}" of required type "${inspect(argType)}" ` + + `was provided the variable "$${variableName}" which was not provided a runtime value.`, + argumentNode.value, + ); + } else { + throw new GraphQLError( + `Argument "${name}" of required type "${inspect(argType)}" ` + + 'was not provided.', + node, + ); + } + } else if (hasValue) { + if (argumentNode.value.kind === Kind.NULL) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[name] = null; + } else if (argumentNode.value.kind === Kind.VARIABLE) { + const variableName = argumentNode.value.name.value; + invariant(variableValues, 'Must exist for hasValue to be true.'); + // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + coercedValues[name] = variableValues[variableName]; + } else { + const valueNode = argumentNode.value; + const coercedValue = valueFromAST(valueNode, argType, variableValues); + if (coercedValue === undefined) { + // Note: ValuesOfCorrectType validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new GraphQLError( + `Argument "${name}" has invalid value ${print(valueNode)}.`, + argumentNode.value, + ); + } + coercedValues[name] = coercedValue; + } + } + } + return coercedValues; +} + +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getDirectiveValues( + directiveDef: GraphQLDirective, + node: { +directives?: $ReadOnlyArray, ... }, + variableValues?: ?ObjMap, +): void | { [argument: string]: mixed, ... } { + const directiveNode = + node.directives && + find( + node.directives, + directive => directive.name.value === directiveDef.name, + ); + + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues); + } +} + +function hasOwnProperty(obj: mixed, prop: string): boolean { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/node_modules/graphql/execution/values.mjs b/node_modules/graphql/execution/values.mjs new file mode 100644 index 000000000..0594e09b9 --- /dev/null +++ b/node_modules/graphql/execution/values.mjs @@ -0,0 +1,208 @@ +import find from '../polyfills/find'; +import { GraphQLError } from '../error/GraphQLError'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import { coerceValue } from '../utilities/coerceValue'; +import { typeFromAST } from '../utilities/typeFromAST'; +import { valueFromAST } from '../utilities/valueFromAST'; +import { Kind } from '../language/kinds'; +import { print } from '../language/printer'; +import { isInputType, isNonNullType } from '../type/definition'; + +/** + * Prepares an object map of variableValues of the correct type based on the + * provided variable definitions and arbitrary input. If the input cannot be + * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ +export function getVariableValues(schema, varDefNodes, inputs) { + var errors = []; + var coercedValues = {}; + + for (var i = 0; i < varDefNodes.length; i++) { + var varDefNode = varDefNodes[i]; + var varName = varDefNode.variable.name.value; + var varType = typeFromAST(schema, varDefNode.type); + + if (!isInputType(varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + errors.push(new GraphQLError("Variable \"$".concat(varName, "\" expected value of type ") + "\"".concat(print(varDefNode.type), "\" which cannot be used as an input type."), varDefNode.type)); + } else { + var hasValue = hasOwnProperty(inputs, varName); + var value = hasValue ? inputs[varName] : undefined; + + if (!hasValue && varDefNode.defaultValue) { + // If no value was provided to a variable with a default value, + // use the default value. + coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType); + } else if ((!hasValue || value === null) && isNonNullType(varType)) { + // If no value or a nullish value was provided to a variable with a + // non-null type (required), produce an error. + errors.push(new GraphQLError(hasValue ? "Variable \"$".concat(varName, "\" of non-null type ") + "\"".concat(inspect(varType), "\" must not be null.") : "Variable \"$".concat(varName, "\" of required type ") + "\"".concat(inspect(varType), "\" was not provided."), varDefNode)); + } else if (hasValue) { + if (value === null) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[varName] = null; + } else { + // Otherwise, a non-null value was provided, coerce it to the expected + // type or report an error if coercion fails. + var coerced = coerceValue(value, varType, varDefNode); + var coercionErrors = coerced.errors; + + if (coercionErrors) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = coercionErrors[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var error = _step.value; + error.message = "Variable \"$".concat(varName, "\" got invalid value ").concat(inspect(value), "; ") + error.message; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + errors.push.apply(errors, coercionErrors); + } else { + coercedValues[varName] = coerced.value; + } + } + } + } + } + + return errors.length === 0 ? { + errors: undefined, + coerced: coercedValues + } : { + errors: errors, + coerced: undefined + }; +} +/** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ + +export function getArgumentValues(def, node, variableValues) { + var coercedValues = {}; + var argDefs = def.args; + var argNodes = node.arguments; + + if (!argDefs || !argNodes) { + return coercedValues; + } + + var argNodeMap = keyMap(argNodes, function (arg) { + return arg.name.value; + }); + + for (var i = 0; i < argDefs.length; i++) { + var argDef = argDefs[i]; + var name = argDef.name; + var argType = argDef.type; + var argumentNode = argNodeMap[name]; + var hasValue = void 0; + var isNull = void 0; + + if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) { + var variableName = argumentNode.value.name.value; + hasValue = variableValues != null && hasOwnProperty(variableValues, variableName); + isNull = variableValues != null && variableValues[variableName] === null; + } else { + hasValue = argumentNode != null; + isNull = argumentNode != null && argumentNode.value.kind === Kind.NULL; + } + + if (!hasValue && argDef.defaultValue !== undefined) { + // If no argument was provided where the definition has a default value, + // use the default value. + coercedValues[name] = argDef.defaultValue; + } else if ((!hasValue || isNull) && isNonNullType(argType)) { + // If no argument or a null value was provided to an argument with a + // non-null type (required), produce a field error. + if (isNull) { + throw new GraphQLError("Argument \"".concat(name, "\" of non-null type \"").concat(inspect(argType), "\" ") + 'must not be null.', argumentNode.value); + } else if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) { + var _variableName = argumentNode.value.name.value; + throw new GraphQLError("Argument \"".concat(name, "\" of required type \"").concat(inspect(argType), "\" ") + "was provided the variable \"$".concat(_variableName, "\" which was not provided a runtime value."), argumentNode.value); + } else { + throw new GraphQLError("Argument \"".concat(name, "\" of required type \"").concat(inspect(argType), "\" ") + 'was not provided.', node); + } + } else if (hasValue) { + if (argumentNode.value.kind === Kind.NULL) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + coercedValues[name] = null; + } else if (argumentNode.value.kind === Kind.VARIABLE) { + var _variableName2 = argumentNode.value.name.value; + !variableValues ? invariant(0, 'Must exist for hasValue to be true.') : void 0; // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + + coercedValues[name] = variableValues[_variableName2]; + } else { + var valueNode = argumentNode.value; + var coercedValue = valueFromAST(valueNode, argType, variableValues); + + if (coercedValue === undefined) { + // Note: ValuesOfCorrectType validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new GraphQLError("Argument \"".concat(name, "\" has invalid value ").concat(print(valueNode), "."), argumentNode.value); + } + + coercedValues[name] = coercedValue; + } + } + } + + return coercedValues; +} +/** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. + */ + +export function getDirectiveValues(directiveDef, node, variableValues) { + var directiveNode = node.directives && find(node.directives, function (directive) { + return directive.name.value === directiveDef.name; + }); + + if (directiveNode) { + return getArgumentValues(directiveDef, directiveNode, variableValues); + } +} + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} diff --git a/node_modules/graphql/graphql.js b/node_modules/graphql/graphql.js new file mode 100644 index 000000000..6e242999a --- /dev/null +++ b/node_modules/graphql/graphql.js @@ -0,0 +1,118 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.graphql = graphql; +exports.graphqlSync = graphqlSync; + +var _isPromise = _interopRequireDefault(require("./jsutils/isPromise")); + +var _validate = require("./type/validate"); + +var _parser = require("./language/parser"); + +var _validate2 = require("./validation/validate"); + +var _execute = require("./execution/execute"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + var _arguments = arguments; + + /* eslint-enable no-redeclare */ + // Always return a Promise for a consistent API. + return new Promise(function (resolve) { + return resolve( // Extract arguments from object args if provided. + _arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ + schema: argsOrSchema, + source: source, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + })); + }); +} +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ + + +function graphqlSync(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + var result = arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ + schema: argsOrSchema, + source: source, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); // Assert that the execution was synchronous. + + if ((0, _isPromise.default)(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + + return result; +} + +function graphqlImpl(args) { + var schema = args.schema, + source = args.source, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + typeResolver = args.typeResolver; // Validate Schema + + var schemaValidationErrors = (0, _validate.validateSchema)(schema); + + if (schemaValidationErrors.length > 0) { + return { + errors: schemaValidationErrors + }; + } // Parse + + + var document; + + try { + document = (0, _parser.parse)(source); + } catch (syntaxError) { + return { + errors: [syntaxError] + }; + } // Validate + + + var validationErrors = (0, _validate2.validate)(schema, document); + + if (validationErrors.length > 0) { + return { + errors: validationErrors + }; + } // Execute + + + return (0, _execute.execute)({ + schema: schema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); +} diff --git a/node_modules/graphql/graphql.js.flow b/node_modules/graphql/graphql.js.flow new file mode 100644 index 000000000..05a5bb91c --- /dev/null +++ b/node_modules/graphql/graphql.js.flow @@ -0,0 +1,203 @@ +// @flow strict + +import isPromise from './jsutils/isPromise'; +import { validateSchema } from './type/validate'; +import { parse } from './language/parser'; +import { validate } from './validation/validate'; +import { type ExecutionResult, execute } from './execution/execute'; +import { type Source } from './language/source'; +import { + type GraphQLFieldResolver, + type GraphQLTypeResolver, +} from './type/definition'; +import { type GraphQLSchema } from './type/schema'; +import { type PromiseOrValue } from './jsutils/PromiseOrValue'; + +/** + * This is the primary entry point function for fulfilling GraphQL operations + * by parsing, validating, and executing a GraphQL document along side a + * GraphQL schema. + * + * More sophisticated GraphQL servers, such as those which persist queries, + * may wish to separate the validation and execution phases to a static time + * tooling step, and a server runtime step. + * + * Accepts either an object with named arguments, or individual arguments: + * + * schema: + * The GraphQL type system to use when validating and executing a query. + * source: + * A GraphQL language formatted string representing the requested operation. + * rootValue: + * The value provided as the first argument to resolver functions on the top + * level type (e.g. the query object type). + * contextValue: + * The context value is provided as an argument to resolver functions after + * field arguments. It is used to pass shared information useful at any point + * during executing this query, for example the currently logged in user and + * connections to databases or other services. + * variableValues: + * A mapping of variable name to runtime value to use for all variables + * defined in the requestString. + * operationName: + * The name of the operation to use if requestString contains multiple + * possible operations. Can be omitted if requestString contains only + * one operation. + * fieldResolver: + * A resolver function to use when one is not provided by the schema. + * If not provided, the default field resolver is used (which looks for a + * value or method on the source value with the field's name). + * typeResolver: + * A type resolver function to use when none is provided by the schema. + * If not provided, the default type resolver is used (which looks for a + * `__typename` field or alternatively calls the `isTypeOf` method). + */ +export type GraphQLArgs = {| + schema: GraphQLSchema, + source: string | Source, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +|}; +declare function graphql(GraphQLArgs, ..._: []): Promise; +/* eslint-disable no-redeclare */ +declare function graphql( + schema: GraphQLSchema, + source: Source | string, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +): Promise; +export function graphql( + argsOrSchema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, +) { + /* eslint-enable no-redeclare */ + // Always return a Promise for a consistent API. + return new Promise(resolve => + resolve( + // Extract arguments from object args if provided. + arguments.length === 1 + ? graphqlImpl(argsOrSchema) + : graphqlImpl({ + schema: argsOrSchema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }), + ), + ); +} + +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +declare function graphqlSync(GraphQLArgs, ..._: []): ExecutionResult; +/* eslint-disable no-redeclare */ +declare function graphqlSync( + schema: GraphQLSchema, + source: Source | string, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, +): ExecutionResult; +export function graphqlSync( + argsOrSchema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, +) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + const result = + arguments.length === 1 + ? graphqlImpl(argsOrSchema) + : graphqlImpl({ + schema: argsOrSchema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }); + + // Assert that the execution was synchronous. + if (isPromise(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + + return result; +} + +function graphqlImpl(args: GraphQLArgs): PromiseOrValue { + const { + schema, + source, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + } = args; + + // Validate Schema + const schemaValidationErrors = validateSchema(schema); + if (schemaValidationErrors.length > 0) { + return { errors: schemaValidationErrors }; + } + + // Parse + let document; + try { + document = parse(source); + } catch (syntaxError) { + return { errors: [syntaxError] }; + } + + // Validate + const validationErrors = validate(schema, document); + if (validationErrors.length > 0) { + return { errors: validationErrors }; + } + + // Execute + return execute({ + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver, + }); +} diff --git a/node_modules/graphql/graphql.mjs b/node_modules/graphql/graphql.mjs new file mode 100644 index 000000000..88d28bf9d --- /dev/null +++ b/node_modules/graphql/graphql.mjs @@ -0,0 +1,102 @@ +import isPromise from './jsutils/isPromise'; +import { validateSchema } from './type/validate'; +import { parse } from './language/parser'; +import { validate } from './validation/validate'; +import { execute } from './execution/execute'; +export function graphql(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + var _arguments = arguments; + + /* eslint-enable no-redeclare */ + // Always return a Promise for a consistent API. + return new Promise(function (resolve) { + return resolve( // Extract arguments from object args if provided. + _arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ + schema: argsOrSchema, + source: source, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + })); + }); +} +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ + +export function graphqlSync(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + var result = arguments.length === 1 ? graphqlImpl(argsOrSchema) : graphqlImpl({ + schema: argsOrSchema, + source: source, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); // Assert that the execution was synchronous. + + if (isPromise(result)) { + throw new Error('GraphQL execution failed to complete synchronously.'); + } + + return result; +} + +function graphqlImpl(args) { + var schema = args.schema, + source = args.source, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + typeResolver = args.typeResolver; // Validate Schema + + var schemaValidationErrors = validateSchema(schema); + + if (schemaValidationErrors.length > 0) { + return { + errors: schemaValidationErrors + }; + } // Parse + + + var document; + + try { + document = parse(source); + } catch (syntaxError) { + return { + errors: [syntaxError] + }; + } // Validate + + + var validationErrors = validate(schema, document); + + if (validationErrors.length > 0) { + return { + errors: validationErrors + }; + } // Execute + + + return execute({ + schema: schema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + typeResolver: typeResolver + }); +} diff --git a/node_modules/graphql/index.js b/node_modules/graphql/index.js new file mode 100644 index 000000000..1763c9720 --- /dev/null +++ b/node_modules/graphql/index.js @@ -0,0 +1,1139 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "version", { + enumerable: true, + get: function get() { + return _version.version; + } +}); +Object.defineProperty(exports, "versionInfo", { + enumerable: true, + get: function get() { + return _version.versionInfo; + } +}); +Object.defineProperty(exports, "graphql", { + enumerable: true, + get: function get() { + return _graphql.graphql; + } +}); +Object.defineProperty(exports, "graphqlSync", { + enumerable: true, + get: function get() { + return _graphql.graphqlSync; + } +}); +Object.defineProperty(exports, "GraphQLSchema", { + enumerable: true, + get: function get() { + return _type.GraphQLSchema; + } +}); +Object.defineProperty(exports, "GraphQLDirective", { + enumerable: true, + get: function get() { + return _type.GraphQLDirective; + } +}); +Object.defineProperty(exports, "GraphQLScalarType", { + enumerable: true, + get: function get() { + return _type.GraphQLScalarType; + } +}); +Object.defineProperty(exports, "GraphQLObjectType", { + enumerable: true, + get: function get() { + return _type.GraphQLObjectType; + } +}); +Object.defineProperty(exports, "GraphQLInterfaceType", { + enumerable: true, + get: function get() { + return _type.GraphQLInterfaceType; + } +}); +Object.defineProperty(exports, "GraphQLUnionType", { + enumerable: true, + get: function get() { + return _type.GraphQLUnionType; + } +}); +Object.defineProperty(exports, "GraphQLEnumType", { + enumerable: true, + get: function get() { + return _type.GraphQLEnumType; + } +}); +Object.defineProperty(exports, "GraphQLInputObjectType", { + enumerable: true, + get: function get() { + return _type.GraphQLInputObjectType; + } +}); +Object.defineProperty(exports, "GraphQLList", { + enumerable: true, + get: function get() { + return _type.GraphQLList; + } +}); +Object.defineProperty(exports, "GraphQLNonNull", { + enumerable: true, + get: function get() { + return _type.GraphQLNonNull; + } +}); +Object.defineProperty(exports, "specifiedScalarTypes", { + enumerable: true, + get: function get() { + return _type.specifiedScalarTypes; + } +}); +Object.defineProperty(exports, "GraphQLInt", { + enumerable: true, + get: function get() { + return _type.GraphQLInt; + } +}); +Object.defineProperty(exports, "GraphQLFloat", { + enumerable: true, + get: function get() { + return _type.GraphQLFloat; + } +}); +Object.defineProperty(exports, "GraphQLString", { + enumerable: true, + get: function get() { + return _type.GraphQLString; + } +}); +Object.defineProperty(exports, "GraphQLBoolean", { + enumerable: true, + get: function get() { + return _type.GraphQLBoolean; + } +}); +Object.defineProperty(exports, "GraphQLID", { + enumerable: true, + get: function get() { + return _type.GraphQLID; + } +}); +Object.defineProperty(exports, "specifiedDirectives", { + enumerable: true, + get: function get() { + return _type.specifiedDirectives; + } +}); +Object.defineProperty(exports, "GraphQLIncludeDirective", { + enumerable: true, + get: function get() { + return _type.GraphQLIncludeDirective; + } +}); +Object.defineProperty(exports, "GraphQLSkipDirective", { + enumerable: true, + get: function get() { + return _type.GraphQLSkipDirective; + } +}); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", { + enumerable: true, + get: function get() { + return _type.GraphQLDeprecatedDirective; + } +}); +Object.defineProperty(exports, "TypeKind", { + enumerable: true, + get: function get() { + return _type.TypeKind; + } +}); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", { + enumerable: true, + get: function get() { + return _type.DEFAULT_DEPRECATION_REASON; + } +}); +Object.defineProperty(exports, "introspectionTypes", { + enumerable: true, + get: function get() { + return _type.introspectionTypes; + } +}); +Object.defineProperty(exports, "__Schema", { + enumerable: true, + get: function get() { + return _type.__Schema; + } +}); +Object.defineProperty(exports, "__Directive", { + enumerable: true, + get: function get() { + return _type.__Directive; + } +}); +Object.defineProperty(exports, "__DirectiveLocation", { + enumerable: true, + get: function get() { + return _type.__DirectiveLocation; + } +}); +Object.defineProperty(exports, "__Type", { + enumerable: true, + get: function get() { + return _type.__Type; + } +}); +Object.defineProperty(exports, "__Field", { + enumerable: true, + get: function get() { + return _type.__Field; + } +}); +Object.defineProperty(exports, "__InputValue", { + enumerable: true, + get: function get() { + return _type.__InputValue; + } +}); +Object.defineProperty(exports, "__EnumValue", { + enumerable: true, + get: function get() { + return _type.__EnumValue; + } +}); +Object.defineProperty(exports, "__TypeKind", { + enumerable: true, + get: function get() { + return _type.__TypeKind; + } +}); +Object.defineProperty(exports, "SchemaMetaFieldDef", { + enumerable: true, + get: function get() { + return _type.SchemaMetaFieldDef; + } +}); +Object.defineProperty(exports, "TypeMetaFieldDef", { + enumerable: true, + get: function get() { + return _type.TypeMetaFieldDef; + } +}); +Object.defineProperty(exports, "TypeNameMetaFieldDef", { + enumerable: true, + get: function get() { + return _type.TypeNameMetaFieldDef; + } +}); +Object.defineProperty(exports, "isSchema", { + enumerable: true, + get: function get() { + return _type.isSchema; + } +}); +Object.defineProperty(exports, "isDirective", { + enumerable: true, + get: function get() { + return _type.isDirective; + } +}); +Object.defineProperty(exports, "isType", { + enumerable: true, + get: function get() { + return _type.isType; + } +}); +Object.defineProperty(exports, "isScalarType", { + enumerable: true, + get: function get() { + return _type.isScalarType; + } +}); +Object.defineProperty(exports, "isObjectType", { + enumerable: true, + get: function get() { + return _type.isObjectType; + } +}); +Object.defineProperty(exports, "isInterfaceType", { + enumerable: true, + get: function get() { + return _type.isInterfaceType; + } +}); +Object.defineProperty(exports, "isUnionType", { + enumerable: true, + get: function get() { + return _type.isUnionType; + } +}); +Object.defineProperty(exports, "isEnumType", { + enumerable: true, + get: function get() { + return _type.isEnumType; + } +}); +Object.defineProperty(exports, "isInputObjectType", { + enumerable: true, + get: function get() { + return _type.isInputObjectType; + } +}); +Object.defineProperty(exports, "isListType", { + enumerable: true, + get: function get() { + return _type.isListType; + } +}); +Object.defineProperty(exports, "isNonNullType", { + enumerable: true, + get: function get() { + return _type.isNonNullType; + } +}); +Object.defineProperty(exports, "isInputType", { + enumerable: true, + get: function get() { + return _type.isInputType; + } +}); +Object.defineProperty(exports, "isOutputType", { + enumerable: true, + get: function get() { + return _type.isOutputType; + } +}); +Object.defineProperty(exports, "isLeafType", { + enumerable: true, + get: function get() { + return _type.isLeafType; + } +}); +Object.defineProperty(exports, "isCompositeType", { + enumerable: true, + get: function get() { + return _type.isCompositeType; + } +}); +Object.defineProperty(exports, "isAbstractType", { + enumerable: true, + get: function get() { + return _type.isAbstractType; + } +}); +Object.defineProperty(exports, "isWrappingType", { + enumerable: true, + get: function get() { + return _type.isWrappingType; + } +}); +Object.defineProperty(exports, "isNullableType", { + enumerable: true, + get: function get() { + return _type.isNullableType; + } +}); +Object.defineProperty(exports, "isNamedType", { + enumerable: true, + get: function get() { + return _type.isNamedType; + } +}); +Object.defineProperty(exports, "isRequiredArgument", { + enumerable: true, + get: function get() { + return _type.isRequiredArgument; + } +}); +Object.defineProperty(exports, "isRequiredInputField", { + enumerable: true, + get: function get() { + return _type.isRequiredInputField; + } +}); +Object.defineProperty(exports, "isSpecifiedScalarType", { + enumerable: true, + get: function get() { + return _type.isSpecifiedScalarType; + } +}); +Object.defineProperty(exports, "isIntrospectionType", { + enumerable: true, + get: function get() { + return _type.isIntrospectionType; + } +}); +Object.defineProperty(exports, "isSpecifiedDirective", { + enumerable: true, + get: function get() { + return _type.isSpecifiedDirective; + } +}); +Object.defineProperty(exports, "assertSchema", { + enumerable: true, + get: function get() { + return _type.assertSchema; + } +}); +Object.defineProperty(exports, "assertDirective", { + enumerable: true, + get: function get() { + return _type.assertDirective; + } +}); +Object.defineProperty(exports, "assertType", { + enumerable: true, + get: function get() { + return _type.assertType; + } +}); +Object.defineProperty(exports, "assertScalarType", { + enumerable: true, + get: function get() { + return _type.assertScalarType; + } +}); +Object.defineProperty(exports, "assertObjectType", { + enumerable: true, + get: function get() { + return _type.assertObjectType; + } +}); +Object.defineProperty(exports, "assertInterfaceType", { + enumerable: true, + get: function get() { + return _type.assertInterfaceType; + } +}); +Object.defineProperty(exports, "assertUnionType", { + enumerable: true, + get: function get() { + return _type.assertUnionType; + } +}); +Object.defineProperty(exports, "assertEnumType", { + enumerable: true, + get: function get() { + return _type.assertEnumType; + } +}); +Object.defineProperty(exports, "assertInputObjectType", { + enumerable: true, + get: function get() { + return _type.assertInputObjectType; + } +}); +Object.defineProperty(exports, "assertListType", { + enumerable: true, + get: function get() { + return _type.assertListType; + } +}); +Object.defineProperty(exports, "assertNonNullType", { + enumerable: true, + get: function get() { + return _type.assertNonNullType; + } +}); +Object.defineProperty(exports, "assertInputType", { + enumerable: true, + get: function get() { + return _type.assertInputType; + } +}); +Object.defineProperty(exports, "assertOutputType", { + enumerable: true, + get: function get() { + return _type.assertOutputType; + } +}); +Object.defineProperty(exports, "assertLeafType", { + enumerable: true, + get: function get() { + return _type.assertLeafType; + } +}); +Object.defineProperty(exports, "assertCompositeType", { + enumerable: true, + get: function get() { + return _type.assertCompositeType; + } +}); +Object.defineProperty(exports, "assertAbstractType", { + enumerable: true, + get: function get() { + return _type.assertAbstractType; + } +}); +Object.defineProperty(exports, "assertWrappingType", { + enumerable: true, + get: function get() { + return _type.assertWrappingType; + } +}); +Object.defineProperty(exports, "assertNullableType", { + enumerable: true, + get: function get() { + return _type.assertNullableType; + } +}); +Object.defineProperty(exports, "assertNamedType", { + enumerable: true, + get: function get() { + return _type.assertNamedType; + } +}); +Object.defineProperty(exports, "getNullableType", { + enumerable: true, + get: function get() { + return _type.getNullableType; + } +}); +Object.defineProperty(exports, "getNamedType", { + enumerable: true, + get: function get() { + return _type.getNamedType; + } +}); +Object.defineProperty(exports, "validateSchema", { + enumerable: true, + get: function get() { + return _type.validateSchema; + } +}); +Object.defineProperty(exports, "assertValidSchema", { + enumerable: true, + get: function get() { + return _type.assertValidSchema; + } +}); +Object.defineProperty(exports, "Source", { + enumerable: true, + get: function get() { + return _language.Source; + } +}); +Object.defineProperty(exports, "getLocation", { + enumerable: true, + get: function get() { + return _language.getLocation; + } +}); +Object.defineProperty(exports, "printLocation", { + enumerable: true, + get: function get() { + return _language.printLocation; + } +}); +Object.defineProperty(exports, "printSourceLocation", { + enumerable: true, + get: function get() { + return _language.printSourceLocation; + } +}); +Object.defineProperty(exports, "createLexer", { + enumerable: true, + get: function get() { + return _language.createLexer; + } +}); +Object.defineProperty(exports, "TokenKind", { + enumerable: true, + get: function get() { + return _language.TokenKind; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function get() { + return _language.parse; + } +}); +Object.defineProperty(exports, "parseValue", { + enumerable: true, + get: function get() { + return _language.parseValue; + } +}); +Object.defineProperty(exports, "parseType", { + enumerable: true, + get: function get() { + return _language.parseType; + } +}); +Object.defineProperty(exports, "print", { + enumerable: true, + get: function get() { + return _language.print; + } +}); +Object.defineProperty(exports, "visit", { + enumerable: true, + get: function get() { + return _language.visit; + } +}); +Object.defineProperty(exports, "visitInParallel", { + enumerable: true, + get: function get() { + return _language.visitInParallel; + } +}); +Object.defineProperty(exports, "visitWithTypeInfo", { + enumerable: true, + get: function get() { + return _language.visitWithTypeInfo; + } +}); +Object.defineProperty(exports, "getVisitFn", { + enumerable: true, + get: function get() { + return _language.getVisitFn; + } +}); +Object.defineProperty(exports, "BREAK", { + enumerable: true, + get: function get() { + return _language.BREAK; + } +}); +Object.defineProperty(exports, "Kind", { + enumerable: true, + get: function get() { + return _language.Kind; + } +}); +Object.defineProperty(exports, "DirectiveLocation", { + enumerable: true, + get: function get() { + return _language.DirectiveLocation; + } +}); +Object.defineProperty(exports, "isDefinitionNode", { + enumerable: true, + get: function get() { + return _language.isDefinitionNode; + } +}); +Object.defineProperty(exports, "isExecutableDefinitionNode", { + enumerable: true, + get: function get() { + return _language.isExecutableDefinitionNode; + } +}); +Object.defineProperty(exports, "isSelectionNode", { + enumerable: true, + get: function get() { + return _language.isSelectionNode; + } +}); +Object.defineProperty(exports, "isValueNode", { + enumerable: true, + get: function get() { + return _language.isValueNode; + } +}); +Object.defineProperty(exports, "isTypeNode", { + enumerable: true, + get: function get() { + return _language.isTypeNode; + } +}); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", { + enumerable: true, + get: function get() { + return _language.isTypeSystemDefinitionNode; + } +}); +Object.defineProperty(exports, "isTypeDefinitionNode", { + enumerable: true, + get: function get() { + return _language.isTypeDefinitionNode; + } +}); +Object.defineProperty(exports, "isTypeSystemExtensionNode", { + enumerable: true, + get: function get() { + return _language.isTypeSystemExtensionNode; + } +}); +Object.defineProperty(exports, "isTypeExtensionNode", { + enumerable: true, + get: function get() { + return _language.isTypeExtensionNode; + } +}); +Object.defineProperty(exports, "execute", { + enumerable: true, + get: function get() { + return _execution.execute; + } +}); +Object.defineProperty(exports, "defaultFieldResolver", { + enumerable: true, + get: function get() { + return _execution.defaultFieldResolver; + } +}); +Object.defineProperty(exports, "defaultTypeResolver", { + enumerable: true, + get: function get() { + return _execution.defaultTypeResolver; + } +}); +Object.defineProperty(exports, "responsePathAsArray", { + enumerable: true, + get: function get() { + return _execution.responsePathAsArray; + } +}); +Object.defineProperty(exports, "getDirectiveValues", { + enumerable: true, + get: function get() { + return _execution.getDirectiveValues; + } +}); +Object.defineProperty(exports, "subscribe", { + enumerable: true, + get: function get() { + return _subscription.subscribe; + } +}); +Object.defineProperty(exports, "createSourceEventStream", { + enumerable: true, + get: function get() { + return _subscription.createSourceEventStream; + } +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function get() { + return _validation.validate; + } +}); +Object.defineProperty(exports, "ValidationContext", { + enumerable: true, + get: function get() { + return _validation.ValidationContext; + } +}); +Object.defineProperty(exports, "specifiedRules", { + enumerable: true, + get: function get() { + return _validation.specifiedRules; + } +}); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { + enumerable: true, + get: function get() { + return _validation.FieldsOnCorrectTypeRule; + } +}); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { + enumerable: true, + get: function get() { + return _validation.FragmentsOnCompositeTypesRule; + } +}); +Object.defineProperty(exports, "KnownArgumentNamesRule", { + enumerable: true, + get: function get() { + return _validation.KnownArgumentNamesRule; + } +}); +Object.defineProperty(exports, "KnownDirectivesRule", { + enumerable: true, + get: function get() { + return _validation.KnownDirectivesRule; + } +}); +Object.defineProperty(exports, "KnownFragmentNamesRule", { + enumerable: true, + get: function get() { + return _validation.KnownFragmentNamesRule; + } +}); +Object.defineProperty(exports, "KnownTypeNamesRule", { + enumerable: true, + get: function get() { + return _validation.KnownTypeNamesRule; + } +}); +Object.defineProperty(exports, "LoneAnonymousOperationRule", { + enumerable: true, + get: function get() { + return _validation.LoneAnonymousOperationRule; + } +}); +Object.defineProperty(exports, "NoFragmentCyclesRule", { + enumerable: true, + get: function get() { + return _validation.NoFragmentCyclesRule; + } +}); +Object.defineProperty(exports, "NoUndefinedVariablesRule", { + enumerable: true, + get: function get() { + return _validation.NoUndefinedVariablesRule; + } +}); +Object.defineProperty(exports, "NoUnusedFragmentsRule", { + enumerable: true, + get: function get() { + return _validation.NoUnusedFragmentsRule; + } +}); +Object.defineProperty(exports, "NoUnusedVariablesRule", { + enumerable: true, + get: function get() { + return _validation.NoUnusedVariablesRule; + } +}); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { + enumerable: true, + get: function get() { + return _validation.OverlappingFieldsCanBeMergedRule; + } +}); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { + enumerable: true, + get: function get() { + return _validation.PossibleFragmentSpreadsRule; + } +}); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { + enumerable: true, + get: function get() { + return _validation.ProvidedRequiredArgumentsRule; + } +}); +Object.defineProperty(exports, "ScalarLeafsRule", { + enumerable: true, + get: function get() { + return _validation.ScalarLeafsRule; + } +}); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { + enumerable: true, + get: function get() { + return _validation.SingleFieldSubscriptionsRule; + } +}); +Object.defineProperty(exports, "UniqueArgumentNamesRule", { + enumerable: true, + get: function get() { + return _validation.UniqueArgumentNamesRule; + } +}); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { + enumerable: true, + get: function get() { + return _validation.UniqueDirectivesPerLocationRule; + } +}); +Object.defineProperty(exports, "UniqueFragmentNamesRule", { + enumerable: true, + get: function get() { + return _validation.UniqueFragmentNamesRule; + } +}); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", { + enumerable: true, + get: function get() { + return _validation.UniqueInputFieldNamesRule; + } +}); +Object.defineProperty(exports, "UniqueOperationNamesRule", { + enumerable: true, + get: function get() { + return _validation.UniqueOperationNamesRule; + } +}); +Object.defineProperty(exports, "UniqueVariableNamesRule", { + enumerable: true, + get: function get() { + return _validation.UniqueVariableNamesRule; + } +}); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { + enumerable: true, + get: function get() { + return _validation.ValuesOfCorrectTypeRule; + } +}); +Object.defineProperty(exports, "VariablesAreInputTypesRule", { + enumerable: true, + get: function get() { + return _validation.VariablesAreInputTypesRule; + } +}); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", { + enumerable: true, + get: function get() { + return _validation.VariablesInAllowedPositionRule; + } +}); +Object.defineProperty(exports, "GraphQLError", { + enumerable: true, + get: function get() { + return _error.GraphQLError; + } +}); +Object.defineProperty(exports, "syntaxError", { + enumerable: true, + get: function get() { + return _error.syntaxError; + } +}); +Object.defineProperty(exports, "locatedError", { + enumerable: true, + get: function get() { + return _error.locatedError; + } +}); +Object.defineProperty(exports, "printError", { + enumerable: true, + get: function get() { + return _error.printError; + } +}); +Object.defineProperty(exports, "formatError", { + enumerable: true, + get: function get() { + return _error.formatError; + } +}); +Object.defineProperty(exports, "getIntrospectionQuery", { + enumerable: true, + get: function get() { + return _utilities.getIntrospectionQuery; + } +}); +Object.defineProperty(exports, "introspectionQuery", { + enumerable: true, + get: function get() { + return _utilities.introspectionQuery; + } +}); +Object.defineProperty(exports, "getOperationAST", { + enumerable: true, + get: function get() { + return _utilities.getOperationAST; + } +}); +Object.defineProperty(exports, "getOperationRootType", { + enumerable: true, + get: function get() { + return _utilities.getOperationRootType; + } +}); +Object.defineProperty(exports, "introspectionFromSchema", { + enumerable: true, + get: function get() { + return _utilities.introspectionFromSchema; + } +}); +Object.defineProperty(exports, "buildClientSchema", { + enumerable: true, + get: function get() { + return _utilities.buildClientSchema; + } +}); +Object.defineProperty(exports, "buildASTSchema", { + enumerable: true, + get: function get() { + return _utilities.buildASTSchema; + } +}); +Object.defineProperty(exports, "buildSchema", { + enumerable: true, + get: function get() { + return _utilities.buildSchema; + } +}); +Object.defineProperty(exports, "getDescription", { + enumerable: true, + get: function get() { + return _utilities.getDescription; + } +}); +Object.defineProperty(exports, "extendSchema", { + enumerable: true, + get: function get() { + return _utilities.extendSchema; + } +}); +Object.defineProperty(exports, "lexicographicSortSchema", { + enumerable: true, + get: function get() { + return _utilities.lexicographicSortSchema; + } +}); +Object.defineProperty(exports, "printSchema", { + enumerable: true, + get: function get() { + return _utilities.printSchema; + } +}); +Object.defineProperty(exports, "printType", { + enumerable: true, + get: function get() { + return _utilities.printType; + } +}); +Object.defineProperty(exports, "printIntrospectionSchema", { + enumerable: true, + get: function get() { + return _utilities.printIntrospectionSchema; + } +}); +Object.defineProperty(exports, "typeFromAST", { + enumerable: true, + get: function get() { + return _utilities.typeFromAST; + } +}); +Object.defineProperty(exports, "valueFromAST", { + enumerable: true, + get: function get() { + return _utilities.valueFromAST; + } +}); +Object.defineProperty(exports, "valueFromASTUntyped", { + enumerable: true, + get: function get() { + return _utilities.valueFromASTUntyped; + } +}); +Object.defineProperty(exports, "astFromValue", { + enumerable: true, + get: function get() { + return _utilities.astFromValue; + } +}); +Object.defineProperty(exports, "TypeInfo", { + enumerable: true, + get: function get() { + return _utilities.TypeInfo; + } +}); +Object.defineProperty(exports, "coerceValue", { + enumerable: true, + get: function get() { + return _utilities.coerceValue; + } +}); +Object.defineProperty(exports, "isValidJSValue", { + enumerable: true, + get: function get() { + return _utilities.isValidJSValue; + } +}); +Object.defineProperty(exports, "isValidLiteralValue", { + enumerable: true, + get: function get() { + return _utilities.isValidLiteralValue; + } +}); +Object.defineProperty(exports, "concatAST", { + enumerable: true, + get: function get() { + return _utilities.concatAST; + } +}); +Object.defineProperty(exports, "separateOperations", { + enumerable: true, + get: function get() { + return _utilities.separateOperations; + } +}); +Object.defineProperty(exports, "stripIgnoredCharacters", { + enumerable: true, + get: function get() { + return _utilities.stripIgnoredCharacters; + } +}); +Object.defineProperty(exports, "isEqualType", { + enumerable: true, + get: function get() { + return _utilities.isEqualType; + } +}); +Object.defineProperty(exports, "isTypeSubTypeOf", { + enumerable: true, + get: function get() { + return _utilities.isTypeSubTypeOf; + } +}); +Object.defineProperty(exports, "doTypesOverlap", { + enumerable: true, + get: function get() { + return _utilities.doTypesOverlap; + } +}); +Object.defineProperty(exports, "assertValidName", { + enumerable: true, + get: function get() { + return _utilities.assertValidName; + } +}); +Object.defineProperty(exports, "isValidNameError", { + enumerable: true, + get: function get() { + return _utilities.isValidNameError; + } +}); +Object.defineProperty(exports, "BreakingChangeType", { + enumerable: true, + get: function get() { + return _utilities.BreakingChangeType; + } +}); +Object.defineProperty(exports, "DangerousChangeType", { + enumerable: true, + get: function get() { + return _utilities.DangerousChangeType; + } +}); +Object.defineProperty(exports, "findBreakingChanges", { + enumerable: true, + get: function get() { + return _utilities.findBreakingChanges; + } +}); +Object.defineProperty(exports, "findDangerousChanges", { + enumerable: true, + get: function get() { + return _utilities.findDangerousChanges; + } +}); +Object.defineProperty(exports, "findDeprecatedUsages", { + enumerable: true, + get: function get() { + return _utilities.findDeprecatedUsages; + } +}); + +var _version = require("./version"); + +var _graphql = require("./graphql"); + +var _type = require("./type"); + +var _language = require("./language"); + +var _execution = require("./execution"); + +var _subscription = require("./subscription"); + +var _validation = require("./validation"); + +var _error = require("./error"); + +var _utilities = require("./utilities"); diff --git a/node_modules/graphql/index.js.flow b/node_modules/graphql/index.js.flow new file mode 100644 index 000000000..b56d72bf1 --- /dev/null +++ b/node_modules/graphql/index.js.flow @@ -0,0 +1,444 @@ +// @flow strict + +/** + * GraphQL.js provides a reference implementation for the GraphQL specification + * but is also a useful utility for operating on GraphQL files and building + * sophisticated tools. + * + * This primary module exports a general purpose function for fulfilling all + * steps of the GraphQL specification in a single operation, but also includes + * utilities for every part of the GraphQL specification: + * + * - Parsing the GraphQL language. + * - Building a GraphQL type schema. + * - Validating a GraphQL request against a type schema. + * - Executing a GraphQL request against a type schema. + * + * This also includes utility functions for operating on GraphQL types and + * GraphQL documents to facilitate building tools. + * + * You may also import from each sub-directory directly. For example, the + * following two import statements are equivalent: + * + * import { parse } from 'graphql'; + * import { parse } from 'graphql/language'; + */ + +// The GraphQL.js version info. +export { version, versionInfo } from './version'; + +// The primary entry point into fulfilling a GraphQL request. +export type { GraphQLArgs } from './graphql'; +export { graphql, graphqlSync } from './graphql'; + +// Create and operate on GraphQL type definitions and schema. +export { + // Definitions + GraphQLSchema, + GraphQLDirective, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + // Standard GraphQL Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // "Enum" of Type Kinds + TypeKind, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + // Predicates + isSchema, + isDirective, + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isRequiredArgument, + isRequiredInputField, + isSpecifiedScalarType, + isIntrospectionType, + isSpecifiedDirective, + // Assertions + assertSchema, + assertDirective, + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Validate GraphQL schema. + validateSchema, + assertValidSchema, +} from './type'; + +export type { + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLSchemaConfig, + GraphQLDirectiveConfig, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLScalarSerializer, + GraphQLScalarValueParser, + GraphQLScalarLiteralParser, +} from './type'; + +// Parse and operate on GraphQL language source files. +export { + Source, + getLocation, + // Print source location + printLocation, + printSourceLocation, + // Lex + createLexer, + TokenKind, + // Parse + parse, + parseValue, + parseType, + // Print + print, + // Visit + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, + Kind, + DirectiveLocation, + // Predicates + isDefinitionNode, + isExecutableDefinitionNode, + isSelectionNode, + isValueNode, + isTypeNode, + isTypeSystemDefinitionNode, + isTypeDefinitionNode, + isTypeSystemExtensionNode, + isTypeExtensionNode, +} from './language'; + +export type { + Lexer, + ParseOptions, + SourceLocation, + Location, + Token, + TokenKindEnum, + KindEnum, + DirectiveLocationEnum, + // Visitor utilities + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, + // AST nodes + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + DirectiveDefinitionNode, + TypeSystemExtensionNode, + SchemaExtensionNode, + TypeExtensionNode, + ScalarTypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, + UnionTypeExtensionNode, + EnumTypeExtensionNode, + InputObjectTypeExtensionNode, +} from './language'; + +// Execute GraphQL queries. +export { + execute, + defaultFieldResolver, + defaultTypeResolver, + responsePathAsArray, + getDirectiveValues, +} from './execution'; + +export type { ExecutionArgs, ExecutionResult } from './execution'; + +export { subscribe, createSourceEventStream } from './subscription'; +export type { SubscriptionArgs } from './subscription'; + +// Validate GraphQL documents. +export { + validate, + ValidationContext, + // All validation rules in the GraphQL Specification. + specifiedRules, + // Individual validation rules. + FieldsOnCorrectTypeRule, + FragmentsOnCompositeTypesRule, + KnownArgumentNamesRule, + KnownDirectivesRule, + KnownFragmentNamesRule, + KnownTypeNamesRule, + LoneAnonymousOperationRule, + NoFragmentCyclesRule, + NoUndefinedVariablesRule, + NoUnusedFragmentsRule, + NoUnusedVariablesRule, + OverlappingFieldsCanBeMergedRule, + PossibleFragmentSpreadsRule, + ProvidedRequiredArgumentsRule, + ScalarLeafsRule, + SingleFieldSubscriptionsRule, + UniqueArgumentNamesRule, + UniqueDirectivesPerLocationRule, + UniqueFragmentNamesRule, + UniqueInputFieldNamesRule, + UniqueOperationNamesRule, + UniqueVariableNamesRule, + ValuesOfCorrectTypeRule, + VariablesAreInputTypesRule, + VariablesInAllowedPositionRule, +} from './validation'; + +export type { ValidationRule } from './validation'; + +// Create, format, and print GraphQL errors. +export { + GraphQLError, + syntaxError, + locatedError, + printError, + formatError, +} from './error'; + +export type { GraphQLFormattedError } from './error'; + +// Utilities for operating on GraphQL type schema and parsed sources. +export { + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // @deprecated: use getIntrospectionQuery - will be removed in v15. + introspectionQuery, + // Gets the target Operation from a Document. + getOperationAST, + // Gets the Type for the target Operation AST. + getOperationRootType, + // Convert a GraphQLSchema to an IntrospectionQuery. + introspectionFromSchema, + // Build a GraphQLSchema from an introspection result. + buildClientSchema, + // Build a GraphQLSchema from a parsed GraphQL Schema language AST. + buildASTSchema, + // Build a GraphQLSchema from a GraphQL schema language document. + buildSchema, + // @deprecated: Get the description from a schema AST node and supports legacy + // syntax for specifying descriptions - will be removed in v16. + getDescription, + // Extends an existing GraphQLSchema from a parsed GraphQL Schema + // language AST. + extendSchema, + // Sort a GraphQLSchema. + lexicographicSortSchema, + // Print a GraphQLSchema to GraphQL Schema language. + printSchema, + // Print a GraphQLType to GraphQL Schema language. + printType, + // Prints the built-in introspection schema in the Schema Language + // format. + printIntrospectionSchema, + // Create a GraphQLType from a GraphQL language AST. + typeFromAST, + // Create a JavaScript value from a GraphQL language AST with a Type. + valueFromAST, + // Create a JavaScript value from a GraphQL language AST without a Type. + valueFromASTUntyped, + // Create a GraphQL language AST from a JavaScript value. + astFromValue, + // A helper to use within recursive-descent visitors which need to be aware of + // the GraphQL type system. + TypeInfo, + // Coerces a JavaScript value to a GraphQL type, or produces errors. + coerceValue, + // @deprecated use coerceValue - will be removed in v15 + isValidJSValue, + // @deprecated use validation - will be removed in v15 + isValidLiteralValue, + // Concatenates multiple AST together. + concatAST, + // Separates an AST into an AST per Operation. + separateOperations, + // Strips characters that are not significant to the validity or execution + // of a GraphQL document. + stripIgnoredCharacters, + // Comparators for types + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, + // Asserts a string is a valid GraphQL name. + assertValidName, + // Determine if a string is a valid GraphQL name. + isValidNameError, + // Compares two GraphQLSchemas and detects breaking changes. + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, + // Report all deprecated usage within a GraphQL document. + findDeprecatedUsages, +} from './utilities'; + +export type { + IntrospectionOptions, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, + BuildSchemaOptions, + BreakingChange, + DangerousChange, +} from './utilities'; diff --git a/node_modules/graphql/index.mjs b/node_modules/graphql/index.mjs new file mode 100644 index 000000000..864af01e7 --- /dev/null +++ b/node_modules/graphql/index.mjs @@ -0,0 +1,95 @@ +/** + * GraphQL.js provides a reference implementation for the GraphQL specification + * but is also a useful utility for operating on GraphQL files and building + * sophisticated tools. + * + * This primary module exports a general purpose function for fulfilling all + * steps of the GraphQL specification in a single operation, but also includes + * utilities for every part of the GraphQL specification: + * + * - Parsing the GraphQL language. + * - Building a GraphQL type schema. + * - Validating a GraphQL request against a type schema. + * - Executing a GraphQL request against a type schema. + * + * This also includes utility functions for operating on GraphQL types and + * GraphQL documents to facilitate building tools. + * + * You may also import from each sub-directory directly. For example, the + * following two import statements are equivalent: + * + * import { parse } from 'graphql'; + * import { parse } from 'graphql/language'; + */ +// The GraphQL.js version info. +export { version, versionInfo } from './version'; // The primary entry point into fulfilling a GraphQL request. + +export { graphql, graphqlSync } from './graphql'; // Create and operate on GraphQL type definitions and schema. + +export { // Definitions +GraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, // Standard GraphQL Scalars +specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, // Built-in Directives defined by the Spec +specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // "Enum" of Type Kinds +TypeKind, // Constant Deprecation Reason +DEFAULT_DEPRECATION_REASON, // GraphQL Types for introspection. +introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, // Meta-field definitions. +SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, // Predicates +isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, // Assertions +assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, // Un-modifiers +getNullableType, getNamedType, // Validate GraphQL schema. +validateSchema, assertValidSchema } from './type'; +// Parse and operate on GraphQL language source files. +export { Source, getLocation, // Print source location +printLocation, printSourceLocation, // Lex +createLexer, TokenKind, // Parse +parse, parseValue, parseType, // Print +print, // Visit +visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK, Kind, DirectiveLocation, // Predicates +isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from './language'; +// Execute GraphQL queries. +export { execute, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from './execution'; +export { subscribe, createSourceEventStream } from './subscription'; +// Validate GraphQL documents. +export { validate, ValidationContext, // All validation rules in the GraphQL Specification. +specifiedRules, // Individual validation rules. +FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule } from './validation'; +// Create, format, and print GraphQL errors. +export { GraphQLError, syntaxError, locatedError, printError, formatError } from './error'; +// Utilities for operating on GraphQL type schema and parsed sources. +export { // Produce the GraphQL query recommended for a full schema introspection. +// Accepts optional IntrospectionOptions. +getIntrospectionQuery, // @deprecated: use getIntrospectionQuery - will be removed in v15. +introspectionQuery, // Gets the target Operation from a Document. +getOperationAST, // Gets the Type for the target Operation AST. +getOperationRootType, // Convert a GraphQLSchema to an IntrospectionQuery. +introspectionFromSchema, // Build a GraphQLSchema from an introspection result. +buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST. +buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document. +buildSchema, // @deprecated: Get the description from a schema AST node and supports legacy +// syntax for specifying descriptions - will be removed in v16. +getDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema +// language AST. +extendSchema, // Sort a GraphQLSchema. +lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language. +printSchema, // Print a GraphQLType to GraphQL Schema language. +printType, // Prints the built-in introspection schema in the Schema Language +// format. +printIntrospectionSchema, // Create a GraphQLType from a GraphQL language AST. +typeFromAST, // Create a JavaScript value from a GraphQL language AST with a Type. +valueFromAST, // Create a JavaScript value from a GraphQL language AST without a Type. +valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value. +astFromValue, // A helper to use within recursive-descent visitors which need to be aware of +// the GraphQL type system. +TypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors. +coerceValue, // @deprecated use coerceValue - will be removed in v15 +isValidJSValue, // @deprecated use validation - will be removed in v15 +isValidLiteralValue, // Concatenates multiple AST together. +concatAST, // Separates an AST into an AST per Operation. +separateOperations, // Strips characters that are not significant to the validity or execution +// of a GraphQL document. +stripIgnoredCharacters, // Comparators for types +isEqualType, isTypeSubTypeOf, doTypesOverlap, // Asserts a string is a valid GraphQL name. +assertValidName, // Determine if a string is a valid GraphQL name. +isValidNameError, // Compares two GraphQLSchemas and detects breaking changes. +BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges, // Report all deprecated usage within a GraphQL document. +findDeprecatedUsages } from './utilities'; diff --git a/node_modules/graphql/jsutils/ObjMap.js b/node_modules/graphql/jsutils/ObjMap.js new file mode 100644 index 000000000..3918c74e4 --- /dev/null +++ b/node_modules/graphql/jsutils/ObjMap.js @@ -0,0 +1 @@ +"use strict"; diff --git a/node_modules/graphql/jsutils/ObjMap.js.flow b/node_modules/graphql/jsutils/ObjMap.js.flow new file mode 100644 index 000000000..1835d9837 --- /dev/null +++ b/node_modules/graphql/jsutils/ObjMap.js.flow @@ -0,0 +1,3 @@ +// @flow strict + +export type ObjMap = { [key: string]: T, __proto__: null, ... }; diff --git a/node_modules/graphql/jsutils/ObjMap.mjs b/node_modules/graphql/jsutils/ObjMap.mjs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/node_modules/graphql/jsutils/ObjMap.mjs @@ -0,0 +1 @@ + diff --git a/node_modules/graphql/jsutils/PromiseOrValue.js b/node_modules/graphql/jsutils/PromiseOrValue.js new file mode 100644 index 000000000..3918c74e4 --- /dev/null +++ b/node_modules/graphql/jsutils/PromiseOrValue.js @@ -0,0 +1 @@ +"use strict"; diff --git a/node_modules/graphql/jsutils/PromiseOrValue.js.flow b/node_modules/graphql/jsutils/PromiseOrValue.js.flow new file mode 100644 index 000000000..2d3741228 --- /dev/null +++ b/node_modules/graphql/jsutils/PromiseOrValue.js.flow @@ -0,0 +1,3 @@ +// @flow strict + +export type PromiseOrValue<+T> = Promise | T; diff --git a/node_modules/graphql/jsutils/PromiseOrValue.mjs b/node_modules/graphql/jsutils/PromiseOrValue.mjs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/node_modules/graphql/jsutils/PromiseOrValue.mjs @@ -0,0 +1 @@ + diff --git a/node_modules/graphql/jsutils/dedent.js b/node_modules/graphql/jsutils/dedent.js new file mode 100644 index 000000000..eadad7fbf --- /dev/null +++ b/node_modules/graphql/jsutils/dedent.js @@ -0,0 +1,66 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = dedent; + +/** + * An ES6 string tag that fixes indentation. Also removes leading newlines + * and trailing spaces and tabs, but keeps trailing newlines. + * + * Example usage: + * const str = dedent` + * { + * test + * } + * `; + * str === "{\n test\n}\n"; + */ +function dedent(strings) { + var str = ''; + + for (var i = 0; i < strings.length; ++i) { + str += strings[i]; + + if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { + str += i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; // interpolation + } + } + + var trimmedStr = str.replace(/^\n*/m, '') // remove leading newline + .replace(/[ \t]*$/, ''); // remove trailing spaces and tabs + // fixes indentation by removing leading spaces and tabs from each line + + var indent = ''; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = trimmedStr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var char = _step.value; + + if (char !== ' ' && char !== '\t') { + break; + } + + indent += char; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent +} diff --git a/node_modules/graphql/jsutils/dedent.js.flow b/node_modules/graphql/jsutils/dedent.js.flow new file mode 100644 index 000000000..d7270f8c5 --- /dev/null +++ b/node_modules/graphql/jsutils/dedent.js.flow @@ -0,0 +1,41 @@ +// @flow strict + +/** + * An ES6 string tag that fixes indentation. Also removes leading newlines + * and trailing spaces and tabs, but keeps trailing newlines. + * + * Example usage: + * const str = dedent` + * { + * test + * } + * `; + * str === "{\n test\n}\n"; + */ +export default function dedent( + strings: $ReadOnlyArray, + ...values: $ReadOnlyArray +): string { + let str = ''; + + for (let i = 0; i < strings.length; ++i) { + str += strings[i]; + if (i < values.length) { + str += values[i]; // interpolation + } + } + + const trimmedStr = str + .replace(/^\n*/m, '') // remove leading newline + .replace(/[ \t]*$/, ''); // remove trailing spaces and tabs + + // fixes indentation by removing leading spaces and tabs from each line + let indent = ''; + for (const char of trimmedStr) { + if (char !== ' ' && char !== '\t') { + break; + } + indent += char; + } + return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent +} diff --git a/node_modules/graphql/jsutils/dedent.mjs b/node_modules/graphql/jsutils/dedent.mjs new file mode 100644 index 000000000..24b353935 --- /dev/null +++ b/node_modules/graphql/jsutils/dedent.mjs @@ -0,0 +1,59 @@ +/** + * An ES6 string tag that fixes indentation. Also removes leading newlines + * and trailing spaces and tabs, but keeps trailing newlines. + * + * Example usage: + * const str = dedent` + * { + * test + * } + * `; + * str === "{\n test\n}\n"; + */ +export default function dedent(strings) { + var str = ''; + + for (var i = 0; i < strings.length; ++i) { + str += strings[i]; + + if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { + str += i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; // interpolation + } + } + + var trimmedStr = str.replace(/^\n*/m, '') // remove leading newline + .replace(/[ \t]*$/, ''); // remove trailing spaces and tabs + // fixes indentation by removing leading spaces and tabs from each line + + var indent = ''; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = trimmedStr[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var char = _step.value; + + if (char !== ' ' && char !== '\t') { + break; + } + + indent += char; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return trimmedStr.replace(RegExp('^' + indent, 'mg'), ''); // remove indent +} diff --git a/node_modules/graphql/jsutils/defineToJSON.js b/node_modules/graphql/jsutils/defineToJSON.js new file mode 100644 index 000000000..a082e57e2 --- /dev/null +++ b/node_modules/graphql/jsutils/defineToJSON.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = defineToJSON; + +var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The `defineToJSON()` function defines toJSON() and inspect() prototype + * methods, if no function provided they become aliases for toString(). + */ +function defineToJSON(classObject) { + var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString; + classObject.prototype.toJSON = fn; + classObject.prototype.inspect = fn; + + if (_nodejsCustomInspectSymbol.default) { + classObject.prototype[_nodejsCustomInspectSymbol.default] = fn; + } +} diff --git a/node_modules/graphql/jsutils/defineToJSON.js.flow b/node_modules/graphql/jsutils/defineToJSON.js.flow new file mode 100644 index 000000000..8647e7371 --- /dev/null +++ b/node_modules/graphql/jsutils/defineToJSON.js.flow @@ -0,0 +1,18 @@ +// @flow strict + +import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; + +/** + * The `defineToJSON()` function defines toJSON() and inspect() prototype + * methods, if no function provided they become aliases for toString(). + */ +export default function defineToJSON( + classObject: Class | ((...args: Array) => mixed), + fn?: () => mixed = classObject.prototype.toString, +): void { + classObject.prototype.toJSON = fn; + classObject.prototype.inspect = fn; + if (nodejsCustomInspectSymbol) { + classObject.prototype[nodejsCustomInspectSymbol] = fn; + } +} diff --git a/node_modules/graphql/jsutils/defineToJSON.mjs b/node_modules/graphql/jsutils/defineToJSON.mjs new file mode 100644 index 000000000..4d50eb450 --- /dev/null +++ b/node_modules/graphql/jsutils/defineToJSON.mjs @@ -0,0 +1,15 @@ +import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; +/** + * The `defineToJSON()` function defines toJSON() and inspect() prototype + * methods, if no function provided they become aliases for toString(). + */ + +export default function defineToJSON(classObject) { + var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : classObject.prototype.toString; + classObject.prototype.toJSON = fn; + classObject.prototype.inspect = fn; + + if (nodejsCustomInspectSymbol) { + classObject.prototype[nodejsCustomInspectSymbol] = fn; + } +} diff --git a/node_modules/graphql/jsutils/defineToStringTag.js b/node_modules/graphql/jsutils/defineToStringTag.js new file mode 100644 index 000000000..0248317cb --- /dev/null +++ b/node_modules/graphql/jsutils/defineToStringTag.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = defineToStringTag; + +/** + * The `defineToStringTag()` function checks first to see if the runtime + * supports the `Symbol` class and then if the `Symbol.toStringTag` constant + * is defined as a `Symbol` instance. If both conditions are met, the + * Symbol.toStringTag property is defined as a getter that returns the + * supplied class constructor's name. + * + * @method defineToStringTag + * + * @param {Class} classObject a class such as Object, String, Number but + * typically one of your own creation through the class keyword; `class A {}`, + * for example. + */ +function defineToStringTag(classObject) { + if (typeof Symbol === 'function' && Symbol.toStringTag) { + Object.defineProperty(classObject.prototype, Symbol.toStringTag, { + get: function get() { + return this.constructor.name; + } + }); + } +} diff --git a/node_modules/graphql/jsutils/defineToStringTag.js.flow b/node_modules/graphql/jsutils/defineToStringTag.js.flow new file mode 100644 index 000000000..f14c3308b --- /dev/null +++ b/node_modules/graphql/jsutils/defineToStringTag.js.flow @@ -0,0 +1,24 @@ +// @flow strict + +/** + * The `defineToStringTag()` function checks first to see if the runtime + * supports the `Symbol` class and then if the `Symbol.toStringTag` constant + * is defined as a `Symbol` instance. If both conditions are met, the + * Symbol.toStringTag property is defined as a getter that returns the + * supplied class constructor's name. + * + * @method defineToStringTag + * + * @param {Class} classObject a class such as Object, String, Number but + * typically one of your own creation through the class keyword; `class A {}`, + * for example. + */ +export default function defineToStringTag(classObject: Class): void { + if (typeof Symbol === 'function' && Symbol.toStringTag) { + Object.defineProperty(classObject.prototype, Symbol.toStringTag, { + get() { + return this.constructor.name; + }, + }); + } +} diff --git a/node_modules/graphql/jsutils/defineToStringTag.mjs b/node_modules/graphql/jsutils/defineToStringTag.mjs new file mode 100644 index 000000000..fb1e78c36 --- /dev/null +++ b/node_modules/graphql/jsutils/defineToStringTag.mjs @@ -0,0 +1,22 @@ +/** + * The `defineToStringTag()` function checks first to see if the runtime + * supports the `Symbol` class and then if the `Symbol.toStringTag` constant + * is defined as a `Symbol` instance. If both conditions are met, the + * Symbol.toStringTag property is defined as a getter that returns the + * supplied class constructor's name. + * + * @method defineToStringTag + * + * @param {Class} classObject a class such as Object, String, Number but + * typically one of your own creation through the class keyword; `class A {}`, + * for example. + */ +export default function defineToStringTag(classObject) { + if (typeof Symbol === 'function' && Symbol.toStringTag) { + Object.defineProperty(classObject.prototype, Symbol.toStringTag, { + get: function get() { + return this.constructor.name; + } + }); + } +} diff --git a/node_modules/graphql/jsutils/didYouMean.js b/node_modules/graphql/jsutils/didYouMean.js new file mode 100644 index 000000000..43640da8a --- /dev/null +++ b/node_modules/graphql/jsutils/didYouMean.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = didYouMean; +var MAX_SUGGESTIONS = 5; +/** + * Given [ A, B, C ] return ' Did you mean A, B, or C?'. + */ + +// eslint-disable-next-line no-redeclare +function didYouMean(firstArg, secondArg) { + var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg], + subMessage = _ref[0], + suggestions = _ref[1]; + + var message = ' Did you mean '; + + if (subMessage) { + message += subMessage + ' '; + } + + switch (suggestions.length) { + case 0: + return ''; + + case 1: + return message + suggestions[0] + '?'; + + case 2: + return message + suggestions[0] + ' or ' + suggestions[1] + '?'; + } + + var selected = suggestions.slice(0, MAX_SUGGESTIONS); + var lastItem = selected.pop(); + return message + selected.join(', ') + ', or ' + lastItem + '?'; +} diff --git a/node_modules/graphql/jsutils/didYouMean.js.flow b/node_modules/graphql/jsutils/didYouMean.js.flow new file mode 100644 index 000000000..c000dd20e --- /dev/null +++ b/node_modules/graphql/jsutils/didYouMean.js.flow @@ -0,0 +1,39 @@ +// @flow strict + +const MAX_SUGGESTIONS = 5; + +/** + * Given [ A, B, C ] return ' Did you mean A, B, or C?'. + */ +declare function didYouMean(suggestions: $ReadOnlyArray): string; +// eslint-disable-next-line no-redeclare +declare function didYouMean( + subMessage: string, + suggestions: $ReadOnlyArray, +): string; + +// eslint-disable-next-line no-redeclare +export default function didYouMean(firstArg, secondArg) { + const [subMessage, suggestions] = + typeof firstArg === 'string' + ? [firstArg, secondArg] + : [undefined, firstArg]; + + let message = ' Did you mean '; + if (subMessage) { + message += subMessage + ' '; + } + + switch (suggestions.length) { + case 0: + return ''; + case 1: + return message + suggestions[0] + '?'; + case 2: + return message + suggestions[0] + ' or ' + suggestions[1] + '?'; + } + + const selected = suggestions.slice(0, MAX_SUGGESTIONS); + const lastItem = selected.pop(); + return message + selected.join(', ') + ', or ' + lastItem + '?'; +} diff --git a/node_modules/graphql/jsutils/didYouMean.mjs b/node_modules/graphql/jsutils/didYouMean.mjs new file mode 100644 index 000000000..5cb41d5b0 --- /dev/null +++ b/node_modules/graphql/jsutils/didYouMean.mjs @@ -0,0 +1,32 @@ +var MAX_SUGGESTIONS = 5; +/** + * Given [ A, B, C ] return ' Did you mean A, B, or C?'. + */ + +// eslint-disable-next-line no-redeclare +export default function didYouMean(firstArg, secondArg) { + var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg], + subMessage = _ref[0], + suggestions = _ref[1]; + + var message = ' Did you mean '; + + if (subMessage) { + message += subMessage + ' '; + } + + switch (suggestions.length) { + case 0: + return ''; + + case 1: + return message + suggestions[0] + '?'; + + case 2: + return message + suggestions[0] + ' or ' + suggestions[1] + '?'; + } + + var selected = suggestions.slice(0, MAX_SUGGESTIONS); + var lastItem = selected.pop(); + return message + selected.join(', ') + ', or ' + lastItem + '?'; +} diff --git a/node_modules/graphql/jsutils/identityFunc.js b/node_modules/graphql/jsutils/identityFunc.js new file mode 100644 index 000000000..630772f6b --- /dev/null +++ b/node_modules/graphql/jsutils/identityFunc.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = identityFunc; + +/** + * Returns the first argument it receives. + */ +function identityFunc(x) { + return x; +} diff --git a/node_modules/graphql/jsutils/identityFunc.js.flow b/node_modules/graphql/jsutils/identityFunc.js.flow new file mode 100644 index 000000000..5cf7c4c33 --- /dev/null +++ b/node_modules/graphql/jsutils/identityFunc.js.flow @@ -0,0 +1,8 @@ +// @flow strict + +/** + * Returns the first argument it receives. + */ +export default function identityFunc(x: T): T { + return x; +} diff --git a/node_modules/graphql/jsutils/identityFunc.mjs b/node_modules/graphql/jsutils/identityFunc.mjs new file mode 100644 index 000000000..daf23914a --- /dev/null +++ b/node_modules/graphql/jsutils/identityFunc.mjs @@ -0,0 +1,6 @@ +/** + * Returns the first argument it receives. + */ +export default function identityFunc(x) { + return x; +} diff --git a/node_modules/graphql/jsutils/inspect.js b/node_modules/graphql/jsutils/inspect.js new file mode 100644 index 000000000..ddc8514b8 --- /dev/null +++ b/node_modules/graphql/jsutils/inspect.js @@ -0,0 +1,134 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = inspect; + +var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var MAX_ARRAY_LENGTH = 10; +var MAX_RECURSIVE_DEPTH = 2; +/** + * Used to print values in error messages. + */ + +function inspect(value) { + return formatValue(value, []); +} + +function formatValue(value, seenValues) { + switch (_typeof(value)) { + case 'string': + return JSON.stringify(value); + + case 'function': + return value.name ? "[function ".concat(value.name, "]") : '[function]'; + + case 'object': + if (value === null) { + return 'null'; + } + + return formatObjectValue(value, seenValues); + + default: + return String(value); + } +} + +function formatObjectValue(value, previouslySeenValues) { + if (previouslySeenValues.indexOf(value) !== -1) { + return '[Circular]'; + } + + var seenValues = [].concat(previouslySeenValues, [value]); + var customInspectFn = getCustomFn(value); + + if (customInspectFn !== undefined) { + // $FlowFixMe(>=0.90.0) + var customValue = customInspectFn.call(value); // check for infinite recursion + + if (customValue !== value) { + return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); + } + } else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + + return formatObject(value, seenValues); +} + +function formatObject(object, seenValues) { + var keys = Object.keys(object); + + if (keys.length === 0) { + return '{}'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + + var properties = keys.map(function (key) { + var value = formatValue(object[key], seenValues); + return key + ': ' + value; + }); + return '{ ' + properties.join(', ') + ' }'; +} + +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + + var len = Math.min(MAX_ARRAY_LENGTH, array.length); + var remaining = array.length - len; + var items = []; + + for (var i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + + if (remaining === 1) { + items.push('... 1 more item'); + } else if (remaining > 1) { + items.push("... ".concat(remaining, " more items")); + } + + return '[' + items.join(', ') + ']'; +} + +function getCustomFn(object) { + var customInspectFn = object[String(_nodejsCustomInspectSymbol.default)]; + + if (typeof customInspectFn === 'function') { + return customInspectFn; + } + + if (typeof object.inspect === 'function') { + return object.inspect; + } +} + +function getObjectTag(object) { + var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); + + if (tag === 'Object' && typeof object.constructor === 'function') { + var name = object.constructor.name; + + if (typeof name === 'string') { + return name; + } + } + + return tag; +} diff --git a/node_modules/graphql/jsutils/inspect.js.flow b/node_modules/graphql/jsutils/inspect.js.flow new file mode 100644 index 000000000..0e444898a --- /dev/null +++ b/node_modules/graphql/jsutils/inspect.js.flow @@ -0,0 +1,126 @@ +// @flow strict + +import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; + +const MAX_ARRAY_LENGTH = 10; +const MAX_RECURSIVE_DEPTH = 2; + +/** + * Used to print values in error messages. + */ +export default function inspect(value: mixed): string { + return formatValue(value, []); +} + +function formatValue(value, seenValues) { + switch (typeof value) { + case 'string': + return JSON.stringify(value); + case 'function': + return value.name ? `[function ${value.name}]` : '[function]'; + case 'object': + if (value === null) { + return 'null'; + } + return formatObjectValue(value, seenValues); + default: + return String(value); + } +} + +function formatObjectValue(value, previouslySeenValues) { + if (previouslySeenValues.indexOf(value) !== -1) { + return '[Circular]'; + } + + const seenValues = [...previouslySeenValues, value]; + const customInspectFn = getCustomFn(value); + + if (customInspectFn !== undefined) { + // $FlowFixMe(>=0.90.0) + const customValue = customInspectFn.call(value); + + // check for infinite recursion + if (customValue !== value) { + return typeof customValue === 'string' + ? customValue + : formatValue(customValue, seenValues); + } + } else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + + return formatObject(value, seenValues); +} + +function formatObject(object, seenValues) { + const keys = Object.keys(object); + if (keys.length === 0) { + return '{}'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + + const properties = keys.map(key => { + const value = formatValue(object[key], seenValues); + return key + ': ' + value; + }); + + return '{ ' + properties.join(', ') + ' }'; +} + +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + + const len = Math.min(MAX_ARRAY_LENGTH, array.length); + const remaining = array.length - len; + const items = []; + + for (let i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + + if (remaining === 1) { + items.push('... 1 more item'); + } else if (remaining > 1) { + items.push(`... ${remaining} more items`); + } + + return '[' + items.join(', ') + ']'; +} + +function getCustomFn(object) { + const customInspectFn = object[String(nodejsCustomInspectSymbol)]; + + if (typeof customInspectFn === 'function') { + return customInspectFn; + } + + if (typeof object.inspect === 'function') { + return object.inspect; + } +} + +function getObjectTag(object) { + const tag = Object.prototype.toString + .call(object) + .replace(/^\[object /, '') + .replace(/]$/, ''); + + if (tag === 'Object' && typeof object.constructor === 'function') { + const name = object.constructor.name; + if (typeof name === 'string') { + return name; + } + } + + return tag; +} diff --git a/node_modules/graphql/jsutils/inspect.mjs b/node_modules/graphql/jsutils/inspect.mjs new file mode 100644 index 000000000..7a6fb7291 --- /dev/null +++ b/node_modules/graphql/jsutils/inspect.mjs @@ -0,0 +1,124 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; +var MAX_ARRAY_LENGTH = 10; +var MAX_RECURSIVE_DEPTH = 2; +/** + * Used to print values in error messages. + */ + +export default function inspect(value) { + return formatValue(value, []); +} + +function formatValue(value, seenValues) { + switch (_typeof(value)) { + case 'string': + return JSON.stringify(value); + + case 'function': + return value.name ? "[function ".concat(value.name, "]") : '[function]'; + + case 'object': + if (value === null) { + return 'null'; + } + + return formatObjectValue(value, seenValues); + + default: + return String(value); + } +} + +function formatObjectValue(value, previouslySeenValues) { + if (previouslySeenValues.indexOf(value) !== -1) { + return '[Circular]'; + } + + var seenValues = [].concat(previouslySeenValues, [value]); + var customInspectFn = getCustomFn(value); + + if (customInspectFn !== undefined) { + // $FlowFixMe(>=0.90.0) + var customValue = customInspectFn.call(value); // check for infinite recursion + + if (customValue !== value) { + return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues); + } + } else if (Array.isArray(value)) { + return formatArray(value, seenValues); + } + + return formatObject(value, seenValues); +} + +function formatObject(object, seenValues) { + var keys = Object.keys(object); + + if (keys.length === 0) { + return '{}'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[' + getObjectTag(object) + ']'; + } + + var properties = keys.map(function (key) { + var value = formatValue(object[key], seenValues); + return key + ': ' + value; + }); + return '{ ' + properties.join(', ') + ' }'; +} + +function formatArray(array, seenValues) { + if (array.length === 0) { + return '[]'; + } + + if (seenValues.length > MAX_RECURSIVE_DEPTH) { + return '[Array]'; + } + + var len = Math.min(MAX_ARRAY_LENGTH, array.length); + var remaining = array.length - len; + var items = []; + + for (var i = 0; i < len; ++i) { + items.push(formatValue(array[i], seenValues)); + } + + if (remaining === 1) { + items.push('... 1 more item'); + } else if (remaining > 1) { + items.push("... ".concat(remaining, " more items")); + } + + return '[' + items.join(', ') + ']'; +} + +function getCustomFn(object) { + var customInspectFn = object[String(nodejsCustomInspectSymbol)]; + + if (typeof customInspectFn === 'function') { + return customInspectFn; + } + + if (typeof object.inspect === 'function') { + return object.inspect; + } +} + +function getObjectTag(object) { + var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, ''); + + if (tag === 'Object' && typeof object.constructor === 'function') { + var name = object.constructor.name; + + if (typeof name === 'string') { + return name; + } + } + + return tag; +} diff --git a/node_modules/graphql/jsutils/instanceOf.js b/node_modules/graphql/jsutils/instanceOf.js new file mode 100644 index 000000000..8631fd13e --- /dev/null +++ b/node_modules/graphql/jsutils/instanceOf.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * A replacement for instanceof which includes an error warning when multi-realm + * constructors are detected. + */ +// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production +// See: https://webpack.js.org/guides/production/ +var _default = process.env.NODE_ENV === 'production' ? // eslint-disable-next-line no-shadow +function instanceOf(value, constructor) { + return value instanceof constructor; +} : // eslint-disable-next-line no-shadow +function instanceOf(value, constructor) { + if (value instanceof constructor) { + return true; + } + + if (value) { + var valueClass = value.constructor; + var className = constructor.name; + + if (className && valueClass && valueClass.name === className) { + throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); + } + } + + return false; +}; + +exports.default = _default; diff --git a/node_modules/graphql/jsutils/instanceOf.js.flow b/node_modules/graphql/jsutils/instanceOf.js.flow new file mode 100644 index 000000000..967969ab2 --- /dev/null +++ b/node_modules/graphql/jsutils/instanceOf.js.flow @@ -0,0 +1,45 @@ +// @flow strict + +/** + * A replacement for instanceof which includes an error warning when multi-realm + * constructors are detected. + */ +declare function instanceOf( + value: mixed, + constructor: mixed, +): boolean %checks(value instanceof constructor); + +// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production +// See: https://webpack.js.org/guides/production/ +export default process.env.NODE_ENV === 'production' + ? // eslint-disable-next-line no-shadow + function instanceOf(value: mixed, constructor: mixed) { + return value instanceof constructor; + } + : // eslint-disable-next-line no-shadow + function instanceOf(value: any, constructor: any) { + if (value instanceof constructor) { + return true; + } + if (value) { + const valueClass = value.constructor; + const className = constructor.name; + if (className && valueClass && valueClass.name === className) { + throw new Error( + `Cannot use ${className} "${value}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`, + ); + } + } + return false; + }; diff --git a/node_modules/graphql/jsutils/instanceOf.mjs b/node_modules/graphql/jsutils/instanceOf.mjs new file mode 100644 index 000000000..eeea88d73 --- /dev/null +++ b/node_modules/graphql/jsutils/instanceOf.mjs @@ -0,0 +1,26 @@ +/** + * A replacement for instanceof which includes an error warning when multi-realm + * constructors are detected. + */ +// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production +// See: https://webpack.js.org/guides/production/ +export default process.env.NODE_ENV === 'production' ? // eslint-disable-next-line no-shadow +function instanceOf(value, constructor) { + return value instanceof constructor; +} : // eslint-disable-next-line no-shadow +function instanceOf(value, constructor) { + if (value instanceof constructor) { + return true; + } + + if (value) { + var valueClass = value.constructor; + var className = constructor.name; + + if (className && valueClass && valueClass.name === className) { + throw new Error("Cannot use ".concat(className, " \"").concat(value, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); + } + } + + return false; +}; diff --git a/node_modules/graphql/jsutils/invariant.js b/node_modules/graphql/jsutils/invariant.js new file mode 100644 index 000000000..cb94b5903 --- /dev/null +++ b/node_modules/graphql/jsutils/invariant.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = invariant; + +function invariant(condition, message) { + var booleanCondition = Boolean(condition); + /* istanbul ignore else */ + + if (!booleanCondition) { + throw new Error(message); + } +} diff --git a/node_modules/graphql/jsutils/invariant.js.flow b/node_modules/graphql/jsutils/invariant.js.flow new file mode 100644 index 000000000..083c6b099 --- /dev/null +++ b/node_modules/graphql/jsutils/invariant.js.flow @@ -0,0 +1,9 @@ +// @flow strict + +export default function invariant(condition: mixed, message: string) { + const booleanCondition = Boolean(condition); + /* istanbul ignore else */ + if (!booleanCondition) { + throw new Error(message); + } +} diff --git a/node_modules/graphql/jsutils/invariant.mjs b/node_modules/graphql/jsutils/invariant.mjs new file mode 100644 index 000000000..3d313cbf7 --- /dev/null +++ b/node_modules/graphql/jsutils/invariant.mjs @@ -0,0 +1,8 @@ +export default function invariant(condition, message) { + var booleanCondition = Boolean(condition); + /* istanbul ignore else */ + + if (!booleanCondition) { + throw new Error(message); + } +} diff --git a/node_modules/graphql/jsutils/isInvalid.js b/node_modules/graphql/jsutils/isInvalid.js new file mode 100644 index 000000000..0018c9d3f --- /dev/null +++ b/node_modules/graphql/jsutils/isInvalid.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isInvalid; + +/** + * Returns true if a value is undefined, or NaN. + */ +function isInvalid(value) { + return value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isInvalid.js.flow b/node_modules/graphql/jsutils/isInvalid.js.flow new file mode 100644 index 000000000..5aa7799a3 --- /dev/null +++ b/node_modules/graphql/jsutils/isInvalid.js.flow @@ -0,0 +1,8 @@ +// @flow strict + +/** + * Returns true if a value is undefined, or NaN. + */ +export default function isInvalid(value: mixed): boolean %checks { + return value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isInvalid.mjs b/node_modules/graphql/jsutils/isInvalid.mjs new file mode 100644 index 000000000..7cde2ab39 --- /dev/null +++ b/node_modules/graphql/jsutils/isInvalid.mjs @@ -0,0 +1,6 @@ +/** + * Returns true if a value is undefined, or NaN. + */ +export default function isInvalid(value) { + return value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isNullish.js b/node_modules/graphql/jsutils/isNullish.js new file mode 100644 index 000000000..2d6b5335d --- /dev/null +++ b/node_modules/graphql/jsutils/isNullish.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isNullish; + +/** + * Returns true if a value is null, undefined, or NaN. + */ +function isNullish(value) { + return value === null || value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isNullish.js.flow b/node_modules/graphql/jsutils/isNullish.js.flow new file mode 100644 index 000000000..8026ee83a --- /dev/null +++ b/node_modules/graphql/jsutils/isNullish.js.flow @@ -0,0 +1,8 @@ +// @flow strict + +/** + * Returns true if a value is null, undefined, or NaN. + */ +export default function isNullish(value: mixed): boolean %checks { + return value === null || value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isNullish.mjs b/node_modules/graphql/jsutils/isNullish.mjs new file mode 100644 index 000000000..610fcf7c4 --- /dev/null +++ b/node_modules/graphql/jsutils/isNullish.mjs @@ -0,0 +1,6 @@ +/** + * Returns true if a value is null, undefined, or NaN. + */ +export default function isNullish(value) { + return value === null || value === undefined || value !== value; +} diff --git a/node_modules/graphql/jsutils/isObjectLike.js b/node_modules/graphql/jsutils/isObjectLike.js new file mode 100644 index 000000000..ab0004e1e --- /dev/null +++ b/node_modules/graphql/jsutils/isObjectLike.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isObjectLike; + +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + */ +function isObjectLike(value) { + return _typeof(value) == 'object' && value !== null; +} diff --git a/node_modules/graphql/jsutils/isObjectLike.js.flow b/node_modules/graphql/jsutils/isObjectLike.js.flow new file mode 100644 index 000000000..45d29f603 --- /dev/null +++ b/node_modules/graphql/jsutils/isObjectLike.js.flow @@ -0,0 +1,9 @@ +// @flow strict + +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + */ +export default function isObjectLike(value: mixed): boolean %checks { + return typeof value == 'object' && value !== null; +} diff --git a/node_modules/graphql/jsutils/isObjectLike.mjs b/node_modules/graphql/jsutils/isObjectLike.mjs new file mode 100644 index 000000000..ff6176143 --- /dev/null +++ b/node_modules/graphql/jsutils/isObjectLike.mjs @@ -0,0 +1,9 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/** + * Return true if `value` is object-like. A value is object-like if it's not + * `null` and has a `typeof` result of "object". + */ +export default function isObjectLike(value) { + return _typeof(value) == 'object' && value !== null; +} diff --git a/node_modules/graphql/jsutils/isPromise.js b/node_modules/graphql/jsutils/isPromise.js new file mode 100644 index 000000000..77ddb8d3e --- /dev/null +++ b/node_modules/graphql/jsutils/isPromise.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isPromise; + +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + */ +// eslint-disable-next-line no-redeclare +function isPromise(value) { + return Boolean(value && typeof value.then === 'function'); +} diff --git a/node_modules/graphql/jsutils/isPromise.js.flow b/node_modules/graphql/jsutils/isPromise.js.flow new file mode 100644 index 000000000..f1d5add8a --- /dev/null +++ b/node_modules/graphql/jsutils/isPromise.js.flow @@ -0,0 +1,13 @@ +// @flow strict + +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + */ +declare function isPromise(value: mixed): boolean %checks(value instanceof + Promise); + +// eslint-disable-next-line no-redeclare +export default function isPromise(value) { + return Boolean(value && typeof value.then === 'function'); +} diff --git a/node_modules/graphql/jsutils/isPromise.mjs b/node_modules/graphql/jsutils/isPromise.mjs new file mode 100644 index 000000000..eea41039d --- /dev/null +++ b/node_modules/graphql/jsutils/isPromise.mjs @@ -0,0 +1,8 @@ +/** + * Returns true if the value acts like a Promise, i.e. has a "then" function, + * otherwise returns false. + */ +// eslint-disable-next-line no-redeclare +export default function isPromise(value) { + return Boolean(value && typeof value.then === 'function'); +} diff --git a/node_modules/graphql/jsutils/keyMap.js b/node_modules/graphql/jsutils/keyMap.js new file mode 100644 index 000000000..c0672101b --- /dev/null +++ b/node_modules/graphql/jsutils/keyMap.js @@ -0,0 +1,36 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = keyMap; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: { name: 'Jon', num: '555-1234' }, + * // Jenny: { name: 'Jenny', num: '867-5309' } } + * const entriesByName = keyMap( + * phoneBook, + * entry => entry.name + * ) + * + * // { name: 'Jenny', num: '857-6309' } + * const jennyEntry = entriesByName['Jenny'] + * + */ +function keyMap(list, keyFn) { + return list.reduce(function (map, item) { + map[keyFn(item)] = item; + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/keyMap.js.flow b/node_modules/graphql/jsutils/keyMap.js.flow new file mode 100644 index 000000000..410dad437 --- /dev/null +++ b/node_modules/graphql/jsutils/keyMap.js.flow @@ -0,0 +1,36 @@ +// @flow strict + +import { type ObjMap } from './ObjMap'; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: { name: 'Jon', num: '555-1234' }, + * // Jenny: { name: 'Jenny', num: '867-5309' } } + * const entriesByName = keyMap( + * phoneBook, + * entry => entry.name + * ) + * + * // { name: 'Jenny', num: '857-6309' } + * const jennyEntry = entriesByName['Jenny'] + * + */ +export default function keyMap( + list: $ReadOnlyArray, + keyFn: (item: T) => string, +): ObjMap { + return list.reduce((map, item) => { + map[keyFn(item)] = item; + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/keyMap.mjs b/node_modules/graphql/jsutils/keyMap.mjs new file mode 100644 index 000000000..567dd86ad --- /dev/null +++ b/node_modules/graphql/jsutils/keyMap.mjs @@ -0,0 +1,29 @@ +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * for each value in the array. + * + * This provides a convenient lookup for the array items if the key function + * produces unique results. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: { name: 'Jon', num: '555-1234' }, + * // Jenny: { name: 'Jenny', num: '867-5309' } } + * const entriesByName = keyMap( + * phoneBook, + * entry => entry.name + * ) + * + * // { name: 'Jenny', num: '857-6309' } + * const jennyEntry = entriesByName['Jenny'] + * + */ +export default function keyMap(list, keyFn) { + return list.reduce(function (map, item) { + map[keyFn(item)] = item; + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/keyValMap.js b/node_modules/graphql/jsutils/keyValMap.js new file mode 100644 index 000000000..0b2dab523 --- /dev/null +++ b/node_modules/graphql/jsutils/keyValMap.js @@ -0,0 +1,30 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = keyValMap; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: '555-1234', Jenny: '867-5309' } + * const phonesByName = keyValMap( + * phoneBook, + * entry => entry.name, + * entry => entry.num + * ) + * + */ +function keyValMap(list, keyFn, valFn) { + return list.reduce(function (map, item) { + map[keyFn(item)] = valFn(item); + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/keyValMap.js.flow b/node_modules/graphql/jsutils/keyValMap.js.flow new file mode 100644 index 000000000..6f6e703aa --- /dev/null +++ b/node_modules/graphql/jsutils/keyValMap.js.flow @@ -0,0 +1,31 @@ +// @flow strict + +import { type ObjMap } from './ObjMap'; + +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: '555-1234', Jenny: '867-5309' } + * const phonesByName = keyValMap( + * phoneBook, + * entry => entry.name, + * entry => entry.num + * ) + * + */ +export default function keyValMap( + list: $ReadOnlyArray, + keyFn: (item: T) => string, + valFn: (item: T) => V, +): ObjMap { + return list.reduce((map, item) => { + map[keyFn(item)] = valFn(item); + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/keyValMap.mjs b/node_modules/graphql/jsutils/keyValMap.mjs new file mode 100644 index 000000000..5061c6664 --- /dev/null +++ b/node_modules/graphql/jsutils/keyValMap.mjs @@ -0,0 +1,23 @@ +/** + * Creates a keyed JS object from an array, given a function to produce the keys + * and a function to produce the values from each item in the array. + * + * const phoneBook = [ + * { name: 'Jon', num: '555-1234' }, + * { name: 'Jenny', num: '867-5309' } + * ] + * + * // { Jon: '555-1234', Jenny: '867-5309' } + * const phonesByName = keyValMap( + * phoneBook, + * entry => entry.name, + * entry => entry.num + * ) + * + */ +export default function keyValMap(list, keyFn, valFn) { + return list.reduce(function (map, item) { + map[keyFn(item)] = valFn(item); + return map; + }, Object.create(null)); +} diff --git a/node_modules/graphql/jsutils/mapValue.js b/node_modules/graphql/jsutils/mapValue.js new file mode 100644 index 000000000..6ebcf1866 --- /dev/null +++ b/node_modules/graphql/jsutils/mapValue.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValue; + +var _objectEntries = _interopRequireDefault(require("../polyfills/objectEntries")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ +function mapValue(map, fn) { + var result = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectEntries.default)(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var _key = _ref2[0]; + var _value = _ref2[1]; + result[_key] = fn(_value, _key); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return result; +} diff --git a/node_modules/graphql/jsutils/mapValue.js.flow b/node_modules/graphql/jsutils/mapValue.js.flow new file mode 100644 index 000000000..1f2d4aae3 --- /dev/null +++ b/node_modules/graphql/jsutils/mapValue.js.flow @@ -0,0 +1,20 @@ +// @flow strict + +import { type ObjMap } from './ObjMap'; +import objectEntries from '../polyfills/objectEntries'; + +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ +export default function mapValue( + map: ObjMap, + fn: (value: T, key: string) => V, +): ObjMap { + const result = Object.create(null); + + for (const [key, value] of objectEntries(map)) { + result[key] = fn(value, key); + } + return result; +} diff --git a/node_modules/graphql/jsutils/mapValue.mjs b/node_modules/graphql/jsutils/mapValue.mjs new file mode 100644 index 000000000..05c79382c --- /dev/null +++ b/node_modules/graphql/jsutils/mapValue.mjs @@ -0,0 +1,36 @@ +import objectEntries from '../polyfills/objectEntries'; +/** + * Creates an object map with the same keys as `map` and values generated by + * running each value of `map` thru `fn`. + */ + +export default function mapValue(map, fn) { + var result = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectEntries(map)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var _key = _ref2[0]; + var _value = _ref2[1]; + result[_key] = fn(_value, _key); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return result; +} diff --git a/node_modules/graphql/jsutils/memoize3.js b/node_modules/graphql/jsutils/memoize3.js new file mode 100644 index 000000000..05bef37b4 --- /dev/null +++ b/node_modules/graphql/jsutils/memoize3.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memoize3; + +/** + * Memoizes the provided three-argument function. + */ +function memoize3(fn) { + var cache0; + + function memoized(a1, a2, a3) { + if (!cache0) { + cache0 = new WeakMap(); + } + + var cache1 = cache0.get(a1); + var cache2; + + if (cache1) { + cache2 = cache1.get(a2); + + if (cache2) { + var cachedValue = cache2.get(a3); + + if (cachedValue !== undefined) { + return cachedValue; + } + } + } else { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + + if (!cache2) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + + var newValue = fn(a1, a2, a3); + cache2.set(a3, newValue); + return newValue; + } + + return memoized; +} diff --git a/node_modules/graphql/jsutils/memoize3.js.flow b/node_modules/graphql/jsutils/memoize3.js.flow new file mode 100644 index 000000000..2d5707c5e --- /dev/null +++ b/node_modules/graphql/jsutils/memoize3.js.flow @@ -0,0 +1,42 @@ +// @flow strict + +/** + * Memoizes the provided three-argument function. + */ +export default function memoize3< + A1: { ... } | $ReadOnlyArray, + A2: { ... } | $ReadOnlyArray, + A3: { ... } | $ReadOnlyArray, + R: mixed, +>(fn: (A1, A2, A3) => R): (A1, A2, A3) => R { + let cache0; + + function memoized(a1, a2, a3) { + if (!cache0) { + cache0 = new WeakMap(); + } + let cache1 = cache0.get(a1); + let cache2; + if (cache1) { + cache2 = cache1.get(a2); + if (cache2) { + const cachedValue = cache2.get(a3); + if (cachedValue !== undefined) { + return cachedValue; + } + } + } else { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + if (!cache2) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + const newValue = fn(a1, a2, a3); + cache2.set(a3, newValue); + return newValue; + } + + return memoized; +} diff --git a/node_modules/graphql/jsutils/memoize3.mjs b/node_modules/graphql/jsutils/memoize3.mjs new file mode 100644 index 000000000..3c31e8624 --- /dev/null +++ b/node_modules/graphql/jsutils/memoize3.mjs @@ -0,0 +1,41 @@ +/** + * Memoizes the provided three-argument function. + */ +export default function memoize3(fn) { + var cache0; + + function memoized(a1, a2, a3) { + if (!cache0) { + cache0 = new WeakMap(); + } + + var cache1 = cache0.get(a1); + var cache2; + + if (cache1) { + cache2 = cache1.get(a2); + + if (cache2) { + var cachedValue = cache2.get(a3); + + if (cachedValue !== undefined) { + return cachedValue; + } + } + } else { + cache1 = new WeakMap(); + cache0.set(a1, cache1); + } + + if (!cache2) { + cache2 = new WeakMap(); + cache1.set(a2, cache2); + } + + var newValue = fn(a1, a2, a3); + cache2.set(a3, newValue); + return newValue; + } + + return memoized; +} diff --git a/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js new file mode 100644 index 000000000..9a89bbc72 --- /dev/null +++ b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; +var _default = nodejsCustomInspectSymbol; +exports.default = _default; diff --git a/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow new file mode 100644 index 000000000..1b0aea72c --- /dev/null +++ b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow @@ -0,0 +1,8 @@ +// @flow strict + +const nodejsCustomInspectSymbol = + typeof Symbol === 'function' && typeof Symbol.for === 'function' + ? Symbol.for('nodejs.util.inspect.custom') + : undefined; + +export default nodejsCustomInspectSymbol; diff --git a/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs new file mode 100644 index 000000000..66f09de0d --- /dev/null +++ b/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs @@ -0,0 +1,2 @@ +var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; +export default nodejsCustomInspectSymbol; diff --git a/node_modules/graphql/jsutils/promiseForObject.js b/node_modules/graphql/jsutils/promiseForObject.js new file mode 100644 index 000000000..f291f9bde --- /dev/null +++ b/node_modules/graphql/jsutils/promiseForObject.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = promiseForObject; + +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + */ +function promiseForObject(object) { + var keys = Object.keys(object); + var valuesAndPromises = keys.map(function (name) { + return object[name]; + }); + return Promise.all(valuesAndPromises).then(function (values) { + return values.reduce(function (resolvedObject, value, i) { + resolvedObject[keys[i]] = value; + return resolvedObject; + }, Object.create(null)); + }); +} diff --git a/node_modules/graphql/jsutils/promiseForObject.js.flow b/node_modules/graphql/jsutils/promiseForObject.js.flow new file mode 100644 index 000000000..b0afd8b67 --- /dev/null +++ b/node_modules/graphql/jsutils/promiseForObject.js.flow @@ -0,0 +1,23 @@ +// @flow strict + +import { type ObjMap } from './ObjMap'; + +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + */ +export default function promiseForObject( + object: ObjMap>, +): Promise> { + const keys = Object.keys(object); + const valuesAndPromises = keys.map(name => object[name]); + return Promise.all(valuesAndPromises).then(values => + values.reduce((resolvedObject, value, i) => { + resolvedObject[keys[i]] = value; + return resolvedObject; + }, Object.create(null)), + ); +} diff --git a/node_modules/graphql/jsutils/promiseForObject.mjs b/node_modules/graphql/jsutils/promiseForObject.mjs new file mode 100644 index 000000000..ee36ed45d --- /dev/null +++ b/node_modules/graphql/jsutils/promiseForObject.mjs @@ -0,0 +1,19 @@ +/** + * This function transforms a JS object `ObjMap>` into + * a `Promise>` + * + * This is akin to bluebird's `Promise.props`, but implemented only using + * `Promise.all` so it will work with any implementation of ES6 promises. + */ +export default function promiseForObject(object) { + var keys = Object.keys(object); + var valuesAndPromises = keys.map(function (name) { + return object[name]; + }); + return Promise.all(valuesAndPromises).then(function (values) { + return values.reduce(function (resolvedObject, value, i) { + resolvedObject[keys[i]] = value; + return resolvedObject; + }, Object.create(null)); + }); +} diff --git a/node_modules/graphql/jsutils/promiseReduce.js b/node_modules/graphql/jsutils/promiseReduce.js new file mode 100644 index 000000000..836296a26 --- /dev/null +++ b/node_modules/graphql/jsutils/promiseReduce.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = promiseReduce; + +var _isPromise = _interopRequireDefault(require("./isPromise")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + */ +function promiseReduce(values, callback, initialValue) { + return values.reduce(function (previous, value) { + return (0, _isPromise.default)(previous) ? previous.then(function (resolved) { + return callback(resolved, value); + }) : callback(previous, value); + }, initialValue); +} diff --git a/node_modules/graphql/jsutils/promiseReduce.js.flow b/node_modules/graphql/jsutils/promiseReduce.js.flow new file mode 100644 index 000000000..22abbd55a --- /dev/null +++ b/node_modules/graphql/jsutils/promiseReduce.js.flow @@ -0,0 +1,25 @@ +// @flow strict + +import isPromise from './isPromise'; +import { type PromiseOrValue } from './PromiseOrValue'; + +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + */ +export default function promiseReduce( + values: $ReadOnlyArray, + callback: (U, T) => PromiseOrValue, + initialValue: PromiseOrValue, +): PromiseOrValue { + return values.reduce( + (previous, value) => + isPromise(previous) + ? previous.then(resolved => callback(resolved, value)) + : callback(previous, value), + initialValue, + ); +} diff --git a/node_modules/graphql/jsutils/promiseReduce.mjs b/node_modules/graphql/jsutils/promiseReduce.mjs new file mode 100644 index 000000000..bb318c182 --- /dev/null +++ b/node_modules/graphql/jsutils/promiseReduce.mjs @@ -0,0 +1,16 @@ +import isPromise from './isPromise'; + +/** + * Similar to Array.prototype.reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + */ +export default function promiseReduce(values, callback, initialValue) { + return values.reduce(function (previous, value) { + return isPromise(previous) ? previous.then(function (resolved) { + return callback(resolved, value); + }) : callback(previous, value); + }, initialValue); +} diff --git a/node_modules/graphql/jsutils/suggestionList.js b/node_modules/graphql/jsutils/suggestionList.js new file mode 100644 index 000000000..1ea52cec4 --- /dev/null +++ b/node_modules/graphql/jsutils/suggestionList.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = suggestionList; + +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + */ +function suggestionList(input, options) { + var optionsByDistance = Object.create(null); + var inputThreshold = input.length / 2; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = options[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var option = _step.value; + var distance = lexicalDistance(input, option); + var threshold = Math.max(inputThreshold, option.length / 2, 1); + + if (distance <= threshold) { + optionsByDistance[option] = distance; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return Object.keys(optionsByDistance).sort(function (a, b) { + return optionsByDistance[a] - optionsByDistance[b]; + }); +} +/** + * Computes the lexical distance between strings A and B. + * + * The "distance" between two strings is given by counting the minimum number + * of edits needed to transform string A into string B. An edit can be an + * insertion, deletion, or substitution of a single character, or a swap of two + * adjacent characters. + * + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1. + * + * This distance can be useful for detecting typos in input or sorting + * + * @param {string} a + * @param {string} b + * @return {int} distance in number of edits + */ + + +function lexicalDistance(aStr, bStr) { + if (aStr === bStr) { + return 0; + } + + var i; + var j; + var d = []; + var a = aStr.toLowerCase(); + var b = bStr.toLowerCase(); + var aLength = a.length; + var bLength = b.length; // Any case change counts as a single edit + + if (a === b) { + return 1; + } + + for (i = 0; i <= aLength; i++) { + d[i] = [i]; + } + + for (j = 1; j <= bLength; j++) { + d[0][j] = j; + } + + for (i = 1; i <= aLength; i++) { + for (j = 1; j <= bLength; j++) { + var cost = a[i - 1] === b[j - 1] ? 0 : 1; + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); + } + } + } + + return d[aLength][bLength]; +} diff --git a/node_modules/graphql/jsutils/suggestionList.js.flow b/node_modules/graphql/jsutils/suggestionList.js.flow new file mode 100644 index 000000000..c42dff8f0 --- /dev/null +++ b/node_modules/graphql/jsutils/suggestionList.js.flow @@ -0,0 +1,86 @@ +// @flow strict + +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + */ +export default function suggestionList( + input: string, + options: $ReadOnlyArray, +): Array { + const optionsByDistance = Object.create(null); + const inputThreshold = input.length / 2; + for (const option of options) { + const distance = lexicalDistance(input, option); + const threshold = Math.max(inputThreshold, option.length / 2, 1); + if (distance <= threshold) { + optionsByDistance[option] = distance; + } + } + return Object.keys(optionsByDistance).sort( + (a, b) => optionsByDistance[a] - optionsByDistance[b], + ); +} + +/** + * Computes the lexical distance between strings A and B. + * + * The "distance" between two strings is given by counting the minimum number + * of edits needed to transform string A into string B. An edit can be an + * insertion, deletion, or substitution of a single character, or a swap of two + * adjacent characters. + * + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1. + * + * This distance can be useful for detecting typos in input or sorting + * + * @param {string} a + * @param {string} b + * @return {int} distance in number of edits + */ +function lexicalDistance(aStr, bStr) { + if (aStr === bStr) { + return 0; + } + + let i; + let j; + const d = []; + const a = aStr.toLowerCase(); + const b = bStr.toLowerCase(); + const aLength = a.length; + const bLength = b.length; + + // Any case change counts as a single edit + if (a === b) { + return 1; + } + + for (i = 0; i <= aLength; i++) { + d[i] = [i]; + } + + for (j = 1; j <= bLength; j++) { + d[0][j] = j; + } + + for (i = 1; i <= aLength; i++) { + for (j = 1; j <= bLength; j++) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + + d[i][j] = Math.min( + d[i - 1][j] + 1, + d[i][j - 1] + 1, + d[i - 1][j - 1] + cost, + ); + + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); + } + } + } + + return d[aLength][bLength]; +} diff --git a/node_modules/graphql/jsutils/suggestionList.mjs b/node_modules/graphql/jsutils/suggestionList.mjs new file mode 100644 index 000000000..1729ffe3d --- /dev/null +++ b/node_modules/graphql/jsutils/suggestionList.mjs @@ -0,0 +1,97 @@ +/** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + */ +export default function suggestionList(input, options) { + var optionsByDistance = Object.create(null); + var inputThreshold = input.length / 2; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = options[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var option = _step.value; + var distance = lexicalDistance(input, option); + var threshold = Math.max(inputThreshold, option.length / 2, 1); + + if (distance <= threshold) { + optionsByDistance[option] = distance; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return Object.keys(optionsByDistance).sort(function (a, b) { + return optionsByDistance[a] - optionsByDistance[b]; + }); +} +/** + * Computes the lexical distance between strings A and B. + * + * The "distance" between two strings is given by counting the minimum number + * of edits needed to transform string A into string B. An edit can be an + * insertion, deletion, or substitution of a single character, or a swap of two + * adjacent characters. + * + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1. + * + * This distance can be useful for detecting typos in input or sorting + * + * @param {string} a + * @param {string} b + * @return {int} distance in number of edits + */ + +function lexicalDistance(aStr, bStr) { + if (aStr === bStr) { + return 0; + } + + var i; + var j; + var d = []; + var a = aStr.toLowerCase(); + var b = bStr.toLowerCase(); + var aLength = a.length; + var bLength = b.length; // Any case change counts as a single edit + + if (a === b) { + return 1; + } + + for (i = 0; i <= aLength; i++) { + d[i] = [i]; + } + + for (j = 1; j <= bLength; j++) { + d[0][j] = j; + } + + for (i = 1; i <= aLength; i++) { + for (j = 1; j <= bLength; j++) { + var cost = a[i - 1] === b[j - 1] ? 0 : 1; + d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); + + if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { + d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); + } + } + } + + return d[aLength][bLength]; +} diff --git a/node_modules/graphql/language/ast.js b/node_modules/graphql/language/ast.js new file mode 100644 index 000000000..3918c74e4 --- /dev/null +++ b/node_modules/graphql/language/ast.js @@ -0,0 +1 @@ +"use strict"; diff --git a/node_modules/graphql/language/ast.js.flow b/node_modules/graphql/language/ast.js.flow new file mode 100644 index 000000000..c32a199fd --- /dev/null +++ b/node_modules/graphql/language/ast.js.flow @@ -0,0 +1,622 @@ +// @flow strict + +import { type Source } from './source'; +import { type TokenKindEnum } from './tokenKind'; + +/** + * Contains a range of UTF-8 character offsets and token references that + * identify the region of the source from which the AST derived. + */ +export type Location = { + /** + * The character offset at which this Node begins. + */ + +start: number, + + /** + * The character offset at which this Node ends. + */ + +end: number, + + /** + * The Token at which this Node begins. + */ + +startToken: Token, + + /** + * The Token at which this Node ends. + */ + +endToken: Token, + + /** + * The Source document the AST represents. + */ + +source: Source, + + ... +}; + +/** + * Represents a range of characters represented by a lexical token + * within a Source. + */ +export type Token = { + /** + * The kind of Token. + */ + +kind: TokenKindEnum, + + /** + * The character offset at which this Node begins. + */ + +start: number, + + /** + * The character offset at which this Node ends. + */ + +end: number, + + /** + * The 1-indexed line number on which this Token appears. + */ + +line: number, + + /** + * The 1-indexed column number at which this Token begins. + */ + +column: number, + + /** + * For non-punctuation tokens, represents the interpreted value of the token. + */ + +value: string | void, + + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + */ + +prev: Token | null, + +next: Token | null, + + ... +}; + +/** + * The list of all possible AST node types. + */ +export type ASTNode = + | NameNode + | DocumentNode + | OperationDefinitionNode + | VariableDefinitionNode + | VariableNode + | SelectionSetNode + | FieldNode + | ArgumentNode + | FragmentSpreadNode + | InlineFragmentNode + | FragmentDefinitionNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode + | ObjectFieldNode + | DirectiveNode + | NamedTypeNode + | ListTypeNode + | NonNullTypeNode + | SchemaDefinitionNode + | OperationTypeDefinitionNode + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | FieldDefinitionNode + | InputValueDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | EnumValueDefinitionNode + | InputObjectTypeDefinitionNode + | DirectiveDefinitionNode + | SchemaExtensionNode + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +/** + * Utility type listing all nodes indexed by their kind. + */ +export type ASTKindToNode = {| + Name: NameNode, + Document: DocumentNode, + OperationDefinition: OperationDefinitionNode, + VariableDefinition: VariableDefinitionNode, + Variable: VariableNode, + SelectionSet: SelectionSetNode, + Field: FieldNode, + Argument: ArgumentNode, + FragmentSpread: FragmentSpreadNode, + InlineFragment: InlineFragmentNode, + FragmentDefinition: FragmentDefinitionNode, + IntValue: IntValueNode, + FloatValue: FloatValueNode, + StringValue: StringValueNode, + BooleanValue: BooleanValueNode, + NullValue: NullValueNode, + EnumValue: EnumValueNode, + ListValue: ListValueNode, + ObjectValue: ObjectValueNode, + ObjectField: ObjectFieldNode, + Directive: DirectiveNode, + NamedType: NamedTypeNode, + ListType: ListTypeNode, + NonNullType: NonNullTypeNode, + SchemaDefinition: SchemaDefinitionNode, + OperationTypeDefinition: OperationTypeDefinitionNode, + ScalarTypeDefinition: ScalarTypeDefinitionNode, + ObjectTypeDefinition: ObjectTypeDefinitionNode, + FieldDefinition: FieldDefinitionNode, + InputValueDefinition: InputValueDefinitionNode, + InterfaceTypeDefinition: InterfaceTypeDefinitionNode, + UnionTypeDefinition: UnionTypeDefinitionNode, + EnumTypeDefinition: EnumTypeDefinitionNode, + EnumValueDefinition: EnumValueDefinitionNode, + InputObjectTypeDefinition: InputObjectTypeDefinitionNode, + DirectiveDefinition: DirectiveDefinitionNode, + SchemaExtension: SchemaExtensionNode, + ScalarTypeExtension: ScalarTypeExtensionNode, + ObjectTypeExtension: ObjectTypeExtensionNode, + InterfaceTypeExtension: InterfaceTypeExtensionNode, + UnionTypeExtension: UnionTypeExtensionNode, + EnumTypeExtension: EnumTypeExtensionNode, + InputObjectTypeExtension: InputObjectTypeExtensionNode, +|}; + +// Name + +export type NameNode = { + +kind: 'Name', + +loc?: Location, + +value: string, + ... +}; + +// Document + +export type DocumentNode = { + +kind: 'Document', + +loc?: Location, + +definitions: $ReadOnlyArray, + ... +}; + +export type DefinitionNode = + | ExecutableDefinitionNode + | TypeSystemDefinitionNode + | TypeSystemExtensionNode; + +export type ExecutableDefinitionNode = + | OperationDefinitionNode + | FragmentDefinitionNode; + +export type OperationDefinitionNode = { + +kind: 'OperationDefinition', + +loc?: Location, + +operation: OperationTypeNode, + +name?: NameNode, + +variableDefinitions?: $ReadOnlyArray, + +directives?: $ReadOnlyArray, + +selectionSet: SelectionSetNode, + ... +}; + +export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; + +export type VariableDefinitionNode = { + +kind: 'VariableDefinition', + +loc?: Location, + +variable: VariableNode, + +type: TypeNode, + +defaultValue?: ValueNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type VariableNode = { + +kind: 'Variable', + +loc?: Location, + +name: NameNode, + ... +}; + +export type SelectionSetNode = { + kind: 'SelectionSet', + loc?: Location, + selections: $ReadOnlyArray, + ... +}; + +export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; + +export type FieldNode = { + +kind: 'Field', + +loc?: Location, + +alias?: NameNode, + +name: NameNode, + +arguments?: $ReadOnlyArray, + +directives?: $ReadOnlyArray, + +selectionSet?: SelectionSetNode, + ... +}; + +export type ArgumentNode = { + +kind: 'Argument', + +loc?: Location, + +name: NameNode, + +value: ValueNode, + ... +}; + +// Fragments + +export type FragmentSpreadNode = { + +kind: 'FragmentSpread', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type InlineFragmentNode = { + +kind: 'InlineFragment', + +loc?: Location, + +typeCondition?: NamedTypeNode, + +directives?: $ReadOnlyArray, + +selectionSet: SelectionSetNode, + ... +}; + +export type FragmentDefinitionNode = { + +kind: 'FragmentDefinition', + +loc?: Location, + +name: NameNode, + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + +variableDefinitions?: $ReadOnlyArray, + +typeCondition: NamedTypeNode, + +directives?: $ReadOnlyArray, + +selectionSet: SelectionSetNode, + ... +}; + +// Values + +export type ValueNode = + | VariableNode + | IntValueNode + | FloatValueNode + | StringValueNode + | BooleanValueNode + | NullValueNode + | EnumValueNode + | ListValueNode + | ObjectValueNode; + +export type IntValueNode = { + +kind: 'IntValue', + +loc?: Location, + +value: string, + ... +}; + +export type FloatValueNode = { + +kind: 'FloatValue', + +loc?: Location, + +value: string, + ... +}; + +export type StringValueNode = { + +kind: 'StringValue', + +loc?: Location, + +value: string, + +block?: boolean, + ... +}; + +export type BooleanValueNode = { + +kind: 'BooleanValue', + +loc?: Location, + +value: boolean, + ... +}; + +export type NullValueNode = { + +kind: 'NullValue', + +loc?: Location, + ... +}; + +export type EnumValueNode = { + +kind: 'EnumValue', + +loc?: Location, + +value: string, + ... +}; + +export type ListValueNode = { + +kind: 'ListValue', + +loc?: Location, + +values: $ReadOnlyArray, + ... +}; + +export type ObjectValueNode = { + +kind: 'ObjectValue', + +loc?: Location, + +fields: $ReadOnlyArray, + ... +}; + +export type ObjectFieldNode = { + +kind: 'ObjectField', + +loc?: Location, + +name: NameNode, + +value: ValueNode, + ... +}; + +// Directives + +export type DirectiveNode = { + +kind: 'Directive', + +loc?: Location, + +name: NameNode, + +arguments?: $ReadOnlyArray, + ... +}; + +// Type Reference + +export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; + +export type NamedTypeNode = { + +kind: 'NamedType', + +loc?: Location, + +name: NameNode, + ... +}; + +export type ListTypeNode = { + +kind: 'ListType', + +loc?: Location, + +type: TypeNode, + ... +}; + +export type NonNullTypeNode = { + +kind: 'NonNullType', + +loc?: Location, + +type: NamedTypeNode | ListTypeNode, + ... +}; + +// Type System Definition + +export type TypeSystemDefinitionNode = + | SchemaDefinitionNode + | TypeDefinitionNode + | DirectiveDefinitionNode; + +export type SchemaDefinitionNode = { + +kind: 'SchemaDefinition', + +loc?: Location, + +directives?: $ReadOnlyArray, + +operationTypes: $ReadOnlyArray, + ... +}; + +export type OperationTypeDefinitionNode = { + +kind: 'OperationTypeDefinition', + +loc?: Location, + +operation: OperationTypeNode, + +type: NamedTypeNode, + ... +}; + +// Type Definition + +export type TypeDefinitionNode = + | ScalarTypeDefinitionNode + | ObjectTypeDefinitionNode + | InterfaceTypeDefinitionNode + | UnionTypeDefinitionNode + | EnumTypeDefinitionNode + | InputObjectTypeDefinitionNode; + +export type ScalarTypeDefinitionNode = { + +kind: 'ScalarTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type ObjectTypeDefinitionNode = { + +kind: 'ObjectTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +interfaces?: $ReadOnlyArray, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; + +export type FieldDefinitionNode = { + +kind: 'FieldDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +arguments?: $ReadOnlyArray, + +type: TypeNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type InputValueDefinitionNode = { + +kind: 'InputValueDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +type: TypeNode, + +defaultValue?: ValueNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type InterfaceTypeDefinitionNode = { + +kind: 'InterfaceTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; + +export type UnionTypeDefinitionNode = { + +kind: 'UnionTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + +types?: $ReadOnlyArray, + ... +}; + +export type EnumTypeDefinitionNode = { + +kind: 'EnumTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + +values?: $ReadOnlyArray, + ... +}; + +export type EnumValueDefinitionNode = { + +kind: 'EnumValueDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type InputObjectTypeDefinitionNode = { + +kind: 'InputObjectTypeDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; + +// Directive Definitions + +export type DirectiveDefinitionNode = { + +kind: 'DirectiveDefinition', + +loc?: Location, + +description?: StringValueNode, + +name: NameNode, + +arguments?: $ReadOnlyArray, + +repeatable: boolean, + +locations: $ReadOnlyArray, + ... +}; + +// Type System Extensions + +export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode; + +export type SchemaExtensionNode = { + +kind: 'SchemaExtension', + +loc?: Location, + +directives?: $ReadOnlyArray, + +operationTypes?: $ReadOnlyArray, + ... +}; + +// Type Extensions + +export type TypeExtensionNode = + | ScalarTypeExtensionNode + | ObjectTypeExtensionNode + | InterfaceTypeExtensionNode + | UnionTypeExtensionNode + | EnumTypeExtensionNode + | InputObjectTypeExtensionNode; + +export type ScalarTypeExtensionNode = { + +kind: 'ScalarTypeExtension', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + ... +}; + +export type ObjectTypeExtensionNode = { + +kind: 'ObjectTypeExtension', + +loc?: Location, + +name: NameNode, + +interfaces?: $ReadOnlyArray, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; + +export type InterfaceTypeExtensionNode = { + +kind: 'InterfaceTypeExtension', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; + +export type UnionTypeExtensionNode = { + +kind: 'UnionTypeExtension', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + +types?: $ReadOnlyArray, + ... +}; + +export type EnumTypeExtensionNode = { + +kind: 'EnumTypeExtension', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + +values?: $ReadOnlyArray, + ... +}; + +export type InputObjectTypeExtensionNode = { + +kind: 'InputObjectTypeExtension', + +loc?: Location, + +name: NameNode, + +directives?: $ReadOnlyArray, + +fields?: $ReadOnlyArray, + ... +}; diff --git a/node_modules/graphql/language/ast.mjs b/node_modules/graphql/language/ast.mjs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/node_modules/graphql/language/ast.mjs @@ -0,0 +1 @@ + diff --git a/node_modules/graphql/language/blockString.js b/node_modules/graphql/language/blockString.js new file mode 100644 index 000000000..b40c2e120 --- /dev/null +++ b/node_modules/graphql/language/blockString.js @@ -0,0 +1,105 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dedentBlockStringValue = dedentBlockStringValue; +exports.getBlockStringIndentation = getBlockStringIndentation; +exports.printBlockString = printBlockString; + +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +function dedentBlockStringValue(rawString) { + // Expand a block string's raw value into independent lines. + var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. + + var commonIndent = getBlockStringIndentation(lines); + + if (commonIndent !== 0) { + for (var i = 1; i < lines.length; i++) { + lines[i] = lines[i].slice(commonIndent); + } + } // Remove leading and trailing blank lines. + + + while (lines.length > 0 && isBlank(lines[0])) { + lines.shift(); + } + + while (lines.length > 0 && isBlank(lines[lines.length - 1])) { + lines.pop(); + } // Return a string of the lines joined with U+000A. + + + return lines.join('\n'); +} // @internal + + +function getBlockStringIndentation(lines) { + var commonIndent = null; + + for (var i = 1; i < lines.length; i++) { + var line = lines[i]; + var indent = leadingWhitespace(line); + + if (indent === line.length) { + continue; // skip empty lines + } + + if (commonIndent === null || indent < commonIndent) { + commonIndent = indent; + + if (commonIndent === 0) { + break; + } + } + } + + return commonIndent === null ? 0 : commonIndent; +} + +function leadingWhitespace(str) { + var i = 0; + + while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { + i++; + } + + return i; +} + +function isBlank(str) { + return leadingWhitespace(str) === str.length; +} +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ + + +function printBlockString(value) { + var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var isSingleLine = value.indexOf('\n') === -1; + var hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; + var hasTrailingQuote = value[value.length - 1] === '"'; + var printAsMultipleLines = !isSingleLine || hasTrailingQuote || preferMultipleLines; + var result = ''; // Format a multi-line block quote to account for leading space. + + if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { + result += '\n' + indentation; + } + + result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; + + if (printAsMultipleLines) { + result += '\n'; + } + + return '"""' + result.replace(/"""/g, '\\"""') + '"""'; +} diff --git a/node_modules/graphql/language/blockString.js.flow b/node_modules/graphql/language/blockString.js.flow new file mode 100644 index 000000000..913fad521 --- /dev/null +++ b/node_modules/graphql/language/blockString.js.flow @@ -0,0 +1,97 @@ +// @flow strict + +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +export function dedentBlockStringValue(rawString: string): string { + // Expand a block string's raw value into independent lines. + const lines = rawString.split(/\r\n|[\n\r]/g); + + // Remove common indentation from all lines but first. + const commonIndent = getBlockStringIndentation(lines); + + if (commonIndent !== 0) { + for (let i = 1; i < lines.length; i++) { + lines[i] = lines[i].slice(commonIndent); + } + } + + // Remove leading and trailing blank lines. + while (lines.length > 0 && isBlank(lines[0])) { + lines.shift(); + } + while (lines.length > 0 && isBlank(lines[lines.length - 1])) { + lines.pop(); + } + + // Return a string of the lines joined with U+000A. + return lines.join('\n'); +} + +// @internal +export function getBlockStringIndentation( + lines: $ReadOnlyArray, +): number { + let commonIndent = null; + + for (let i = 1; i < lines.length; i++) { + const line = lines[i]; + const indent = leadingWhitespace(line); + if (indent === line.length) { + continue; // skip empty lines + } + + if (commonIndent === null || indent < commonIndent) { + commonIndent = indent; + if (commonIndent === 0) { + break; + } + } + } + + return commonIndent === null ? 0 : commonIndent; +} + +function leadingWhitespace(str) { + let i = 0; + while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { + i++; + } + return i; +} + +function isBlank(str) { + return leadingWhitespace(str) === str.length; +} + +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ +export function printBlockString( + value: string, + indentation?: string = '', + preferMultipleLines?: boolean = false, +): string { + const isSingleLine = value.indexOf('\n') === -1; + const hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; + const hasTrailingQuote = value[value.length - 1] === '"'; + const printAsMultipleLines = + !isSingleLine || hasTrailingQuote || preferMultipleLines; + + let result = ''; + // Format a multi-line block quote to account for leading space. + if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { + result += '\n' + indentation; + } + result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; + if (printAsMultipleLines) { + result += '\n'; + } + + return '"""' + result.replace(/"""/g, '\\"""') + '"""'; +} diff --git a/node_modules/graphql/language/blockString.mjs b/node_modules/graphql/language/blockString.mjs new file mode 100644 index 000000000..b9d71a035 --- /dev/null +++ b/node_modules/graphql/language/blockString.mjs @@ -0,0 +1,95 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +export function dedentBlockStringValue(rawString) { + // Expand a block string's raw value into independent lines. + var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. + + var commonIndent = getBlockStringIndentation(lines); + + if (commonIndent !== 0) { + for (var i = 1; i < lines.length; i++) { + lines[i] = lines[i].slice(commonIndent); + } + } // Remove leading and trailing blank lines. + + + while (lines.length > 0 && isBlank(lines[0])) { + lines.shift(); + } + + while (lines.length > 0 && isBlank(lines[lines.length - 1])) { + lines.pop(); + } // Return a string of the lines joined with U+000A. + + + return lines.join('\n'); +} // @internal + +export function getBlockStringIndentation(lines) { + var commonIndent = null; + + for (var i = 1; i < lines.length; i++) { + var line = lines[i]; + var indent = leadingWhitespace(line); + + if (indent === line.length) { + continue; // skip empty lines + } + + if (commonIndent === null || indent < commonIndent) { + commonIndent = indent; + + if (commonIndent === 0) { + break; + } + } + } + + return commonIndent === null ? 0 : commonIndent; +} + +function leadingWhitespace(str) { + var i = 0; + + while (i < str.length && (str[i] === ' ' || str[i] === '\t')) { + i++; + } + + return i; +} + +function isBlank(str) { + return leadingWhitespace(str) === str.length; +} +/** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ + + +export function printBlockString(value) { + var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var isSingleLine = value.indexOf('\n') === -1; + var hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; + var hasTrailingQuote = value[value.length - 1] === '"'; + var printAsMultipleLines = !isSingleLine || hasTrailingQuote || preferMultipleLines; + var result = ''; // Format a multi-line block quote to account for leading space. + + if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) { + result += '\n' + indentation; + } + + result += indentation ? value.replace(/\n/g, '\n' + indentation) : value; + + if (printAsMultipleLines) { + result += '\n'; + } + + return '"""' + result.replace(/"""/g, '\\"""') + '"""'; +} diff --git a/node_modules/graphql/language/directiveLocation.js b/node_modules/graphql/language/directiveLocation.js new file mode 100644 index 000000000..57bb417fd --- /dev/null +++ b/node_modules/graphql/language/directiveLocation.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectiveLocation = void 0; + +/** + * The set of allowed directive location values. + */ +var DirectiveLocation = Object.freeze({ + // Request Definitions + QUERY: 'QUERY', + MUTATION: 'MUTATION', + SUBSCRIPTION: 'SUBSCRIPTION', + FIELD: 'FIELD', + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', + INLINE_FRAGMENT: 'INLINE_FRAGMENT', + VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', + // Type System Definitions + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD_DEFINITION: 'FIELD_DEFINITION', + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' +}); +/** + * The enum type representing the directive location values. + */ + +exports.DirectiveLocation = DirectiveLocation; diff --git a/node_modules/graphql/language/directiveLocation.js.flow b/node_modules/graphql/language/directiveLocation.js.flow new file mode 100644 index 000000000..652989886 --- /dev/null +++ b/node_modules/graphql/language/directiveLocation.js.flow @@ -0,0 +1,33 @@ +// @flow strict + +/** + * The set of allowed directive location values. + */ +export const DirectiveLocation = Object.freeze({ + // Request Definitions + QUERY: 'QUERY', + MUTATION: 'MUTATION', + SUBSCRIPTION: 'SUBSCRIPTION', + FIELD: 'FIELD', + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', + INLINE_FRAGMENT: 'INLINE_FRAGMENT', + VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', + // Type System Definitions + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD_DEFINITION: 'FIELD_DEFINITION', + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION', +}); + +/** + * The enum type representing the directive location values. + */ +export type DirectiveLocationEnum = $Values; diff --git a/node_modules/graphql/language/directiveLocation.mjs b/node_modules/graphql/language/directiveLocation.mjs new file mode 100644 index 000000000..82823b7d3 --- /dev/null +++ b/node_modules/graphql/language/directiveLocation.mjs @@ -0,0 +1,29 @@ +/** + * The set of allowed directive location values. + */ +export var DirectiveLocation = Object.freeze({ + // Request Definitions + QUERY: 'QUERY', + MUTATION: 'MUTATION', + SUBSCRIPTION: 'SUBSCRIPTION', + FIELD: 'FIELD', + FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION', + FRAGMENT_SPREAD: 'FRAGMENT_SPREAD', + INLINE_FRAGMENT: 'INLINE_FRAGMENT', + VARIABLE_DEFINITION: 'VARIABLE_DEFINITION', + // Type System Definitions + SCHEMA: 'SCHEMA', + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + FIELD_DEFINITION: 'FIELD_DEFINITION', + ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + ENUM_VALUE: 'ENUM_VALUE', + INPUT_OBJECT: 'INPUT_OBJECT', + INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION' +}); +/** + * The enum type representing the directive location values. + */ diff --git a/node_modules/graphql/language/index.js b/node_modules/graphql/language/index.js new file mode 100644 index 000000000..cb5fe1fb5 --- /dev/null +++ b/node_modules/graphql/language/index.js @@ -0,0 +1,183 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "Source", { + enumerable: true, + get: function get() { + return _source.Source; + } +}); +Object.defineProperty(exports, "getLocation", { + enumerable: true, + get: function get() { + return _location.getLocation; + } +}); +Object.defineProperty(exports, "printLocation", { + enumerable: true, + get: function get() { + return _printLocation.printLocation; + } +}); +Object.defineProperty(exports, "printSourceLocation", { + enumerable: true, + get: function get() { + return _printLocation.printSourceLocation; + } +}); +Object.defineProperty(exports, "Kind", { + enumerable: true, + get: function get() { + return _kinds.Kind; + } +}); +Object.defineProperty(exports, "TokenKind", { + enumerable: true, + get: function get() { + return _tokenKind.TokenKind; + } +}); +Object.defineProperty(exports, "createLexer", { + enumerable: true, + get: function get() { + return _lexer.createLexer; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function get() { + return _parser.parse; + } +}); +Object.defineProperty(exports, "parseValue", { + enumerable: true, + get: function get() { + return _parser.parseValue; + } +}); +Object.defineProperty(exports, "parseType", { + enumerable: true, + get: function get() { + return _parser.parseType; + } +}); +Object.defineProperty(exports, "print", { + enumerable: true, + get: function get() { + return _printer.print; + } +}); +Object.defineProperty(exports, "visit", { + enumerable: true, + get: function get() { + return _visitor.visit; + } +}); +Object.defineProperty(exports, "visitInParallel", { + enumerable: true, + get: function get() { + return _visitor.visitInParallel; + } +}); +Object.defineProperty(exports, "visitWithTypeInfo", { + enumerable: true, + get: function get() { + return _visitor.visitWithTypeInfo; + } +}); +Object.defineProperty(exports, "getVisitFn", { + enumerable: true, + get: function get() { + return _visitor.getVisitFn; + } +}); +Object.defineProperty(exports, "BREAK", { + enumerable: true, + get: function get() { + return _visitor.BREAK; + } +}); +Object.defineProperty(exports, "isDefinitionNode", { + enumerable: true, + get: function get() { + return _predicates.isDefinitionNode; + } +}); +Object.defineProperty(exports, "isExecutableDefinitionNode", { + enumerable: true, + get: function get() { + return _predicates.isExecutableDefinitionNode; + } +}); +Object.defineProperty(exports, "isSelectionNode", { + enumerable: true, + get: function get() { + return _predicates.isSelectionNode; + } +}); +Object.defineProperty(exports, "isValueNode", { + enumerable: true, + get: function get() { + return _predicates.isValueNode; + } +}); +Object.defineProperty(exports, "isTypeNode", { + enumerable: true, + get: function get() { + return _predicates.isTypeNode; + } +}); +Object.defineProperty(exports, "isTypeSystemDefinitionNode", { + enumerable: true, + get: function get() { + return _predicates.isTypeSystemDefinitionNode; + } +}); +Object.defineProperty(exports, "isTypeDefinitionNode", { + enumerable: true, + get: function get() { + return _predicates.isTypeDefinitionNode; + } +}); +Object.defineProperty(exports, "isTypeSystemExtensionNode", { + enumerable: true, + get: function get() { + return _predicates.isTypeSystemExtensionNode; + } +}); +Object.defineProperty(exports, "isTypeExtensionNode", { + enumerable: true, + get: function get() { + return _predicates.isTypeExtensionNode; + } +}); +Object.defineProperty(exports, "DirectiveLocation", { + enumerable: true, + get: function get() { + return _directiveLocation.DirectiveLocation; + } +}); + +var _source = require("./source"); + +var _location = require("./location"); + +var _printLocation = require("./printLocation"); + +var _kinds = require("./kinds"); + +var _tokenKind = require("./tokenKind"); + +var _lexer = require("./lexer"); + +var _parser = require("./parser"); + +var _printer = require("./printer"); + +var _visitor = require("./visitor"); + +var _predicates = require("./predicates"); + +var _directiveLocation = require("./directiveLocation"); diff --git a/node_modules/graphql/language/index.js.flow b/node_modules/graphql/language/index.js.flow new file mode 100644 index 000000000..3d8a82170 --- /dev/null +++ b/node_modules/graphql/language/index.js.flow @@ -0,0 +1,107 @@ +// @flow strict + +export { Source } from './source'; + +export { getLocation } from './location'; +export type { SourceLocation } from './location'; + +export { printLocation, printSourceLocation } from './printLocation'; + +export { Kind } from './kinds'; +export type { KindEnum } from './kinds'; + +export { TokenKind } from './tokenKind'; +export type { TokenKindEnum } from './tokenKind'; + +export { createLexer } from './lexer'; +export type { Lexer } from './lexer'; + +export { parse, parseValue, parseType } from './parser'; +export type { ParseOptions } from './parser'; + +export { print } from './printer'; + +export { + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, +} from './visitor'; +export type { ASTVisitor, Visitor, VisitFn, VisitorKeyMap } from './visitor'; + +export type { + Location, + Token, + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + DirectiveDefinitionNode, + TypeSystemExtensionNode, + SchemaExtensionNode, + TypeExtensionNode, + ScalarTypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, + UnionTypeExtensionNode, + EnumTypeExtensionNode, + InputObjectTypeExtensionNode, +} from './ast'; + +export { + isDefinitionNode, + isExecutableDefinitionNode, + isSelectionNode, + isValueNode, + isTypeNode, + isTypeSystemDefinitionNode, + isTypeDefinitionNode, + isTypeSystemExtensionNode, + isTypeExtensionNode, +} from './predicates'; + +export { DirectiveLocation } from './directiveLocation'; +export type { DirectiveLocationEnum } from './directiveLocation'; diff --git a/node_modules/graphql/language/index.mjs b/node_modules/graphql/language/index.mjs new file mode 100644 index 000000000..f5dcf4035 --- /dev/null +++ b/node_modules/graphql/language/index.mjs @@ -0,0 +1,11 @@ +export { Source } from './source'; +export { getLocation } from './location'; +export { printLocation, printSourceLocation } from './printLocation'; +export { Kind } from './kinds'; +export { TokenKind } from './tokenKind'; +export { createLexer } from './lexer'; +export { parse, parseValue, parseType } from './parser'; +export { print } from './printer'; +export { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from './visitor'; +export { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from './predicates'; +export { DirectiveLocation } from './directiveLocation'; diff --git a/node_modules/graphql/language/kinds.js b/node_modules/graphql/language/kinds.js new file mode 100644 index 000000000..32b90c4a1 --- /dev/null +++ b/node_modules/graphql/language/kinds.js @@ -0,0 +1,71 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Kind = void 0; + +/** + * The set of allowed kind values for AST nodes. + */ +var Kind = Object.freeze({ + // Name + NAME: 'Name', + // Document + DOCUMENT: 'Document', + OPERATION_DEFINITION: 'OperationDefinition', + VARIABLE_DEFINITION: 'VariableDefinition', + SELECTION_SET: 'SelectionSet', + FIELD: 'Field', + ARGUMENT: 'Argument', + // Fragments + FRAGMENT_SPREAD: 'FragmentSpread', + INLINE_FRAGMENT: 'InlineFragment', + FRAGMENT_DEFINITION: 'FragmentDefinition', + // Values + VARIABLE: 'Variable', + INT: 'IntValue', + FLOAT: 'FloatValue', + STRING: 'StringValue', + BOOLEAN: 'BooleanValue', + NULL: 'NullValue', + ENUM: 'EnumValue', + LIST: 'ListValue', + OBJECT: 'ObjectValue', + OBJECT_FIELD: 'ObjectField', + // Directives + DIRECTIVE: 'Directive', + // Types + NAMED_TYPE: 'NamedType', + LIST_TYPE: 'ListType', + NON_NULL_TYPE: 'NonNullType', + // Type System Definitions + SCHEMA_DEFINITION: 'SchemaDefinition', + OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition', + // Type Definitions + SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition', + OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition', + FIELD_DEFINITION: 'FieldDefinition', + INPUT_VALUE_DEFINITION: 'InputValueDefinition', + INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition', + UNION_TYPE_DEFINITION: 'UnionTypeDefinition', + ENUM_TYPE_DEFINITION: 'EnumTypeDefinition', + ENUM_VALUE_DEFINITION: 'EnumValueDefinition', + INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition', + // Directive Definitions + DIRECTIVE_DEFINITION: 'DirectiveDefinition', + // Type System Extensions + SCHEMA_EXTENSION: 'SchemaExtension', + // Type Extensions + SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension', + OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension', + INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension', + UNION_TYPE_EXTENSION: 'UnionTypeExtension', + ENUM_TYPE_EXTENSION: 'EnumTypeExtension', + INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension' +}); +/** + * The enum type representing the possible kind values of AST nodes. + */ + +exports.Kind = Kind; diff --git a/node_modules/graphql/language/kinds.js.flow b/node_modules/graphql/language/kinds.js.flow new file mode 100644 index 000000000..d3292b203 --- /dev/null +++ b/node_modules/graphql/language/kinds.js.flow @@ -0,0 +1,76 @@ +// @flow strict + +/** + * The set of allowed kind values for AST nodes. + */ +export const Kind = Object.freeze({ + // Name + NAME: 'Name', + + // Document + DOCUMENT: 'Document', + OPERATION_DEFINITION: 'OperationDefinition', + VARIABLE_DEFINITION: 'VariableDefinition', + SELECTION_SET: 'SelectionSet', + FIELD: 'Field', + ARGUMENT: 'Argument', + + // Fragments + FRAGMENT_SPREAD: 'FragmentSpread', + INLINE_FRAGMENT: 'InlineFragment', + FRAGMENT_DEFINITION: 'FragmentDefinition', + + // Values + VARIABLE: 'Variable', + INT: 'IntValue', + FLOAT: 'FloatValue', + STRING: 'StringValue', + BOOLEAN: 'BooleanValue', + NULL: 'NullValue', + ENUM: 'EnumValue', + LIST: 'ListValue', + OBJECT: 'ObjectValue', + OBJECT_FIELD: 'ObjectField', + + // Directives + DIRECTIVE: 'Directive', + + // Types + NAMED_TYPE: 'NamedType', + LIST_TYPE: 'ListType', + NON_NULL_TYPE: 'NonNullType', + + // Type System Definitions + SCHEMA_DEFINITION: 'SchemaDefinition', + OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition', + + // Type Definitions + SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition', + OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition', + FIELD_DEFINITION: 'FieldDefinition', + INPUT_VALUE_DEFINITION: 'InputValueDefinition', + INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition', + UNION_TYPE_DEFINITION: 'UnionTypeDefinition', + ENUM_TYPE_DEFINITION: 'EnumTypeDefinition', + ENUM_VALUE_DEFINITION: 'EnumValueDefinition', + INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition', + + // Directive Definitions + DIRECTIVE_DEFINITION: 'DirectiveDefinition', + + // Type System Extensions + SCHEMA_EXTENSION: 'SchemaExtension', + + // Type Extensions + SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension', + OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension', + INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension', + UNION_TYPE_EXTENSION: 'UnionTypeExtension', + ENUM_TYPE_EXTENSION: 'EnumTypeExtension', + INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension', +}); + +/** + * The enum type representing the possible kind values of AST nodes. + */ +export type KindEnum = $Values; diff --git a/node_modules/graphql/language/kinds.mjs b/node_modules/graphql/language/kinds.mjs new file mode 100644 index 000000000..b439c7116 --- /dev/null +++ b/node_modules/graphql/language/kinds.mjs @@ -0,0 +1,62 @@ +/** + * The set of allowed kind values for AST nodes. + */ +export var Kind = Object.freeze({ + // Name + NAME: 'Name', + // Document + DOCUMENT: 'Document', + OPERATION_DEFINITION: 'OperationDefinition', + VARIABLE_DEFINITION: 'VariableDefinition', + SELECTION_SET: 'SelectionSet', + FIELD: 'Field', + ARGUMENT: 'Argument', + // Fragments + FRAGMENT_SPREAD: 'FragmentSpread', + INLINE_FRAGMENT: 'InlineFragment', + FRAGMENT_DEFINITION: 'FragmentDefinition', + // Values + VARIABLE: 'Variable', + INT: 'IntValue', + FLOAT: 'FloatValue', + STRING: 'StringValue', + BOOLEAN: 'BooleanValue', + NULL: 'NullValue', + ENUM: 'EnumValue', + LIST: 'ListValue', + OBJECT: 'ObjectValue', + OBJECT_FIELD: 'ObjectField', + // Directives + DIRECTIVE: 'Directive', + // Types + NAMED_TYPE: 'NamedType', + LIST_TYPE: 'ListType', + NON_NULL_TYPE: 'NonNullType', + // Type System Definitions + SCHEMA_DEFINITION: 'SchemaDefinition', + OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition', + // Type Definitions + SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition', + OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition', + FIELD_DEFINITION: 'FieldDefinition', + INPUT_VALUE_DEFINITION: 'InputValueDefinition', + INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition', + UNION_TYPE_DEFINITION: 'UnionTypeDefinition', + ENUM_TYPE_DEFINITION: 'EnumTypeDefinition', + ENUM_VALUE_DEFINITION: 'EnumValueDefinition', + INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition', + // Directive Definitions + DIRECTIVE_DEFINITION: 'DirectiveDefinition', + // Type System Extensions + SCHEMA_EXTENSION: 'SchemaExtension', + // Type Extensions + SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension', + OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension', + INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension', + UNION_TYPE_EXTENSION: 'UnionTypeExtension', + ENUM_TYPE_EXTENSION: 'EnumTypeExtension', + INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension' +}); +/** + * The enum type representing the possible kind values of AST nodes. + */ diff --git a/node_modules/graphql/language/lexer.js b/node_modules/graphql/language/lexer.js new file mode 100644 index 000000000..4740f39b5 --- /dev/null +++ b/node_modules/graphql/language/lexer.js @@ -0,0 +1,631 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createLexer = createLexer; +exports.isPunctuatorToken = isPunctuatorToken; +exports.getTokenDesc = getTokenDesc; + +var _defineToJSON = _interopRequireDefault(require("../jsutils/defineToJSON")); + +var _tokenKind = require("./tokenKind"); + +var _syntaxError = require("../error/syntaxError"); + +var _blockString = require("./blockString"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Given a Source object, this returns a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ +function createLexer(source, options) { + var startOfFileToken = new Tok(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null); + var lexer = { + source: source, + options: options, + lastToken: startOfFileToken, + token: startOfFileToken, + line: 1, + lineStart: 0, + advance: advanceLexer, + lookahead: lookahead + }; + return lexer; +} + +function advanceLexer() { + this.lastToken = this.token; + var token = this.token = this.lookahead(); + return token; +} + +function lookahead() { + var token = this.token; + + if (token.kind !== _tokenKind.TokenKind.EOF) { + do { + // Note: next is only mutable during parsing, so we cast to allow this. + token = token.next || (token.next = readToken(this, token)); + } while (token.kind === _tokenKind.TokenKind.COMMENT); + } + + return token; +} +/** + * The return type of createLexer. + */ + + +// @internal +function isPunctuatorToken(token) { + var kind = token.kind; + return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R; +} +/** + * A helper function to describe a token as a string for debugging + */ + + +function getTokenDesc(token) { + var value = token.value; + return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; +} +/** + * Helper function for constructing the Token object. + */ + + +function Tok(kind, start, end, line, column, prev, value) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + this.value = value; + this.prev = prev; + this.next = null; +} // Print a simplified form when appearing in JSON/util.inspect. + + +(0, _defineToJSON.default)(Tok, function () { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column + }; +}); + +function printCharCode(code) { + return (// NaN/undefined represents access beyond the end of the file. + isNaN(code) ? _tokenKind.TokenKind.EOF : // Trust JSON for ASCII. + code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form. + "\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"") + ); +} +/** + * Gets the next token from the source starting at the given position. + * + * This skips over whitespace until it finds the next lexable token, then lexes + * punctuators immediately or calls the appropriate helper function for more + * complicated tokens. + */ + + +function readToken(lexer, prev) { + var source = lexer.source; + var body = source.body; + var bodyLength = body.length; + var pos = positionAfterWhitespace(body, prev.end, lexer); + var line = lexer.line; + var col = 1 + pos - lexer.lineStart; + + if (pos >= bodyLength) { + return new Tok(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev); + } + + var code = body.charCodeAt(pos); // SourceCharacter + + switch (code) { + // ! + case 33: + return new Tok(_tokenKind.TokenKind.BANG, pos, pos + 1, line, col, prev); + // # + + case 35: + return readComment(source, pos, line, col, prev); + // $ + + case 36: + return new Tok(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, line, col, prev); + // & + + case 38: + return new Tok(_tokenKind.TokenKind.AMP, pos, pos + 1, line, col, prev); + // ( + + case 40: + return new Tok(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, line, col, prev); + // ) + + case 41: + return new Tok(_tokenKind.TokenKind.PAREN_R, pos, pos + 1, line, col, prev); + // . + + case 46: + if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { + return new Tok(_tokenKind.TokenKind.SPREAD, pos, pos + 3, line, col, prev); + } + + break; + // : + + case 58: + return new Tok(_tokenKind.TokenKind.COLON, pos, pos + 1, line, col, prev); + // = + + case 61: + return new Tok(_tokenKind.TokenKind.EQUALS, pos, pos + 1, line, col, prev); + // @ + + case 64: + return new Tok(_tokenKind.TokenKind.AT, pos, pos + 1, line, col, prev); + // [ + + case 91: + return new Tok(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, line, col, prev); + // ] + + case 93: + return new Tok(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, line, col, prev); + // { + + case 123: + return new Tok(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, line, col, prev); + // | + + case 124: + return new Tok(_tokenKind.TokenKind.PIPE, pos, pos + 1, line, col, prev); + // } + + case 125: + return new Tok(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, line, col, prev); + // A-Z _ a-z + + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 95: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + return readName(source, pos, line, col, prev); + // - 0-9 + + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return readNumber(source, pos, code, line, col, prev); + // " + + case 34: + if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) { + return readBlockString(source, pos, line, col, prev, lexer); + } + + return readString(source, pos, line, col, prev); + } + + throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code)); +} +/** + * Report a message that an unexpected character was encountered. + */ + + +function unexpectedCharacterMessage(code) { + if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { + return "Cannot contain the invalid character ".concat(printCharCode(code), "."); + } + + if (code === 39) { + // ' + return 'Unexpected single quote character (\'), did you mean to use a double quote (")?'; + } + + return "Cannot parse the unexpected character ".concat(printCharCode(code), "."); +} +/** + * Reads from body starting at startPosition until it finds a non-whitespace + * character, then returns the position of that character for lexing. + */ + + +function positionAfterWhitespace(body, startPosition, lexer) { + var bodyLength = body.length; + var position = startPosition; + + while (position < bodyLength) { + var code = body.charCodeAt(position); // tab | space | comma | BOM + + if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { + ++position; + } else if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + + ++lexer.line; + lexer.lineStart = position; + } else { + break; + } + } + + return position; +} +/** + * Reads a comment token from the source file. + * + * #[\u0009\u0020-\uFFFF]* + */ + + +function readComment(source, start, line, col, prev) { + var body = source.body; + var code; + var position = start; + + do { + code = body.charCodeAt(++position); + } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator + code > 0x001f || code === 0x0009)); + + return new Tok(_tokenKind.TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position)); +} +/** + * Reads a number token from the source file, either a float + * or an int depending on whether a decimal point appears. + * + * Int: -?(0|[1-9][0-9]*) + * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? + */ + + +function readNumber(source, start, firstCode, line, col, prev) { + var body = source.body; + var code = firstCode; + var position = start; + var isFloat = false; + + if (code === 45) { + // - + code = body.charCodeAt(++position); + } + + if (code === 48) { + // 0 + code = body.charCodeAt(++position); + + if (code >= 48 && code <= 57) { + throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), ".")); + } + } else { + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 46) { + // . + isFloat = true; + code = body.charCodeAt(++position); + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 69 || code === 101) { + // E e + isFloat = true; + code = body.charCodeAt(++position); + + if (code === 43 || code === 45) { + // + - + code = body.charCodeAt(++position); + } + + position = readDigits(source, position, code); + } + + return new Tok(isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT, start, position, line, col, prev, body.slice(start, position)); +} +/** + * Returns the new position in the source after reading digits. + */ + + +function readDigits(source, start, firstCode) { + var body = source.body; + var position = start; + var code = firstCode; + + if (code >= 48 && code <= 57) { + // 0 - 9 + do { + code = body.charCodeAt(++position); + } while (code >= 48 && code <= 57); // 0 - 9 + + + return position; + } + + throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); +} +/** + * Reads a string token from the source file. + * + * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*" + */ + + +function readString(source, start, line, col, prev) { + var body = source.body; + var position = start + 1; + var chunkStart = position; + var code = 0; + var value = ''; + + while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator + code !== 0x000a && code !== 0x000d) { + // Closing Quote (") + if (code === 34) { + value += body.slice(chunkStart, position); + return new Tok(_tokenKind.TokenKind.STRING, start, position + 1, line, col, prev, value); + } // SourceCharacter + + + if (code < 0x0020 && code !== 0x0009) { + throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); + } + + ++position; + + if (code === 92) { + // \ + value += body.slice(chunkStart, position - 1); + code = body.charCodeAt(position); + + switch (code) { + case 34: + value += '"'; + break; + + case 47: + value += '/'; + break; + + case 92: + value += '\\'; + break; + + case 98: + value += '\b'; + break; + + case 102: + value += '\f'; + break; + + case 110: + value += '\n'; + break; + + case 114: + value += '\r'; + break; + + case 116: + value += '\t'; + break; + + case 117: + { + // uXXXX + var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4)); + + if (charCode < 0) { + var invalidSequence = body.slice(position + 1, position + 5); + throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, ".")); + } + + value += String.fromCharCode(charCode); + position += 4; + break; + } + + default: + throw (0, _syntaxError.syntaxError)(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), ".")); + } + + ++position; + chunkStart = position; + } + } + + throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); +} +/** + * Reads a block string token from the source file. + * + * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" + */ + + +function readBlockString(source, start, line, col, prev, lexer) { + var body = source.body; + var position = start + 3; + var chunkStart = position; + var code = 0; + var rawValue = ''; + + while (position < body.length && !isNaN(code = body.charCodeAt(position))) { + // Closing Triple-Quote (""") + if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { + rawValue += body.slice(chunkStart, position); + return new Tok(_tokenKind.TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, (0, _blockString.dedentBlockStringValue)(rawValue)); + } // SourceCharacter + + + if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { + throw (0, _syntaxError.syntaxError)(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); + } + + if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + + ++lexer.line; + lexer.lineStart = position; + } else if ( // Escape Triple-Quote (\""") + code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) { + rawValue += body.slice(chunkStart, position) + '"""'; + position += 4; + chunkStart = position; + } else { + ++position; + } + } + + throw (0, _syntaxError.syntaxError)(source, position, 'Unterminated string.'); +} +/** + * Converts four hexadecimal chars to the integer that the + * string represents. For example, uniCharCode('0','0','0','f') + * will return 15, and uniCharCode('0','0','f','f') returns 255. + * + * Returns a negative number on error, if a char was invalid. + * + * This is implemented by noting that char2hex() returns -1 on error, + * which means the result of ORing the char2hex() will also be negative. + */ + + +function uniCharCode(a, b, c, d) { + return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); +} +/** + * Converts a hex character to its integer value. + * '0' becomes 0, '9' becomes 9 + * 'A' becomes 10, 'F' becomes 15 + * 'a' becomes 10, 'f' becomes 15 + * + * Returns -1 on error. + */ + + +function char2hex(a) { + return a >= 48 && a <= 57 ? a - 48 // 0-9 + : a >= 65 && a <= 70 ? a - 55 // A-F + : a >= 97 && a <= 102 ? a - 87 // a-f + : -1; +} +/** + * Reads an alphanumeric + underscore name from the source. + * + * [_A-Za-z][_0-9A-Za-z]* + */ + + +function readName(source, start, line, col, prev) { + var body = source.body; + var bodyLength = body.length; + var position = start + 1; + var code = 0; + + while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _ + code >= 48 && code <= 57 || // 0-9 + code >= 65 && code <= 90 || // A-Z + code >= 97 && code <= 122) // a-z + ) { + ++position; + } + + return new Tok(_tokenKind.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); +} diff --git a/node_modules/graphql/language/lexer.js.flow b/node_modules/graphql/language/lexer.js.flow new file mode 100644 index 000000000..af70d6274 --- /dev/null +++ b/node_modules/graphql/language/lexer.js.flow @@ -0,0 +1,736 @@ +// @flow strict + +import defineToJSON from '../jsutils/defineToJSON'; +import { type Token } from './ast'; +import { type Source } from './source'; +import { type TokenKindEnum, TokenKind } from './tokenKind'; +import { syntaxError } from '../error/syntaxError'; +import { dedentBlockStringValue } from './blockString'; + +/** + * Given a Source object, this returns a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ +export function createLexer( + source: Source, + options: TOptions, +): Lexer { + const startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null); + const lexer: Lexer = { + source, + options, + lastToken: startOfFileToken, + token: startOfFileToken, + line: 1, + lineStart: 0, + advance: advanceLexer, + lookahead, + }; + return lexer; +} + +function advanceLexer() { + this.lastToken = this.token; + const token = (this.token = this.lookahead()); + return token; +} + +function lookahead() { + let token = this.token; + if (token.kind !== TokenKind.EOF) { + do { + // Note: next is only mutable during parsing, so we cast to allow this. + token = token.next || ((token: any).next = readToken(this, token)); + } while (token.kind === TokenKind.COMMENT); + } + return token; +} + +/** + * The return type of createLexer. + */ +export type Lexer = { + source: Source, + options: TOptions, + + /** + * The previously focused non-ignored token. + */ + lastToken: Token, + + /** + * The currently focused non-ignored token. + */ + token: Token, + + /** + * The (1-indexed) line containing the current token. + */ + line: number, + + /** + * The character offset at which the current line begins. + */ + lineStart: number, + + /** + * Advances the token stream to the next non-ignored token. + */ + advance(): Token, + + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the Lexer's state. + */ + lookahead(): Token, + + ... +}; + +// @internal +export function isPunctuatorToken(token: Token) { + const kind = token.kind; + return ( + kind === TokenKind.BANG || + kind === TokenKind.DOLLAR || + kind === TokenKind.AMP || + kind === TokenKind.PAREN_L || + kind === TokenKind.PAREN_R || + kind === TokenKind.SPREAD || + kind === TokenKind.COLON || + kind === TokenKind.EQUALS || + kind === TokenKind.AT || + kind === TokenKind.BRACKET_L || + kind === TokenKind.BRACKET_R || + kind === TokenKind.BRACE_L || + kind === TokenKind.PIPE || + kind === TokenKind.BRACE_R + ); +} + +/** + * A helper function to describe a token as a string for debugging + */ +export function getTokenDesc(token: Token): string { + const value = token.value; + return value ? `${token.kind} "${value}"` : token.kind; +} + +/** + * Helper function for constructing the Token object. + */ +function Tok( + kind: TokenKindEnum, + start: number, + end: number, + line: number, + column: number, + prev: Token | null, + value?: string, +) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + this.value = value; + this.prev = prev; + this.next = null; +} + +// Print a simplified form when appearing in JSON/util.inspect. +defineToJSON(Tok, function() { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column, + }; +}); + +function printCharCode(code) { + return ( + // NaN/undefined represents access beyond the end of the file. + isNaN(code) + ? TokenKind.EOF + : // Trust JSON for ASCII. + code < 0x007f + ? JSON.stringify(String.fromCharCode(code)) + : // Otherwise print the escaped form. + `"\\u${('00' + code.toString(16).toUpperCase()).slice(-4)}"` + ); +} + +/** + * Gets the next token from the source starting at the given position. + * + * This skips over whitespace until it finds the next lexable token, then lexes + * punctuators immediately or calls the appropriate helper function for more + * complicated tokens. + */ +function readToken(lexer: Lexer<*>, prev: Token): Token { + const source = lexer.source; + const body = source.body; + const bodyLength = body.length; + + const pos = positionAfterWhitespace(body, prev.end, lexer); + const line = lexer.line; + const col = 1 + pos - lexer.lineStart; + + if (pos >= bodyLength) { + return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev); + } + + const code = body.charCodeAt(pos); + + // SourceCharacter + switch (code) { + // ! + case 33: + return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev); + // # + case 35: + return readComment(source, pos, line, col, prev); + // $ + case 36: + return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev); + // & + case 38: + return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev); + // ( + case 40: + return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev); + // ) + case 41: + return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev); + // . + case 46: + if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { + return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev); + } + break; + // : + case 58: + return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev); + // = + case 61: + return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev); + // @ + case 64: + return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev); + // [ + case 91: + return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev); + // ] + case 93: + return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev); + // { + case 123: + return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev); + // | + case 124: + return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev); + // } + case 125: + return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev); + // A-Z _ a-z + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 95: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + return readName(source, pos, line, col, prev); + // - 0-9 + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return readNumber(source, pos, code, line, col, prev); + // " + case 34: + if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) { + return readBlockString(source, pos, line, col, prev, lexer); + } + return readString(source, pos, line, col, prev); + } + + throw syntaxError(source, pos, unexpectedCharacterMessage(code)); +} + +/** + * Report a message that an unexpected character was encountered. + */ +function unexpectedCharacterMessage(code) { + if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { + return `Cannot contain the invalid character ${printCharCode(code)}.`; + } + + if (code === 39) { + // ' + return 'Unexpected single quote character (\'), did you mean to use a double quote (")?'; + } + + return `Cannot parse the unexpected character ${printCharCode(code)}.`; +} + +/** + * Reads from body starting at startPosition until it finds a non-whitespace + * character, then returns the position of that character for lexing. + */ +function positionAfterWhitespace( + body: string, + startPosition: number, + lexer: Lexer<*>, +): number { + const bodyLength = body.length; + let position = startPosition; + while (position < bodyLength) { + const code = body.charCodeAt(position); + // tab | space | comma | BOM + if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { + ++position; + } else if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + } else { + break; + } + } + return position; +} + +/** + * Reads a comment token from the source file. + * + * #[\u0009\u0020-\uFFFF]* + */ +function readComment(source, start, line, col, prev): Token { + const body = source.body; + let code; + let position = start; + + do { + code = body.charCodeAt(++position); + } while ( + !isNaN(code) && + // SourceCharacter but not LineTerminator + (code > 0x001f || code === 0x0009) + ); + + return new Tok( + TokenKind.COMMENT, + start, + position, + line, + col, + prev, + body.slice(start + 1, position), + ); +} + +/** + * Reads a number token from the source file, either a float + * or an int depending on whether a decimal point appears. + * + * Int: -?(0|[1-9][0-9]*) + * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? + */ +function readNumber(source, start, firstCode, line, col, prev): Token { + const body = source.body; + let code = firstCode; + let position = start; + let isFloat = false; + + if (code === 45) { + // - + code = body.charCodeAt(++position); + } + + if (code === 48) { + // 0 + code = body.charCodeAt(++position); + if (code >= 48 && code <= 57) { + throw syntaxError( + source, + position, + `Invalid number, unexpected digit after 0: ${printCharCode(code)}.`, + ); + } + } else { + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 46) { + // . + isFloat = true; + + code = body.charCodeAt(++position); + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 69 || code === 101) { + // E e + isFloat = true; + + code = body.charCodeAt(++position); + if (code === 43 || code === 45) { + // + - + code = body.charCodeAt(++position); + } + position = readDigits(source, position, code); + } + + return new Tok( + isFloat ? TokenKind.FLOAT : TokenKind.INT, + start, + position, + line, + col, + prev, + body.slice(start, position), + ); +} + +/** + * Returns the new position in the source after reading digits. + */ +function readDigits(source, start, firstCode) { + const body = source.body; + let position = start; + let code = firstCode; + if (code >= 48 && code <= 57) { + // 0 - 9 + do { + code = body.charCodeAt(++position); + } while (code >= 48 && code <= 57); // 0 - 9 + return position; + } + throw syntaxError( + source, + position, + `Invalid number, expected digit but got: ${printCharCode(code)}.`, + ); +} + +/** + * Reads a string token from the source file. + * + * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*" + */ +function readString(source, start, line, col, prev): Token { + const body = source.body; + let position = start + 1; + let chunkStart = position; + let code = 0; + let value = ''; + + while ( + position < body.length && + !isNaN((code = body.charCodeAt(position))) && + // not LineTerminator + code !== 0x000a && + code !== 0x000d + ) { + // Closing Quote (") + if (code === 34) { + value += body.slice(chunkStart, position); + return new Tok( + TokenKind.STRING, + start, + position + 1, + line, + col, + prev, + value, + ); + } + + // SourceCharacter + if (code < 0x0020 && code !== 0x0009) { + throw syntaxError( + source, + position, + `Invalid character within String: ${printCharCode(code)}.`, + ); + } + + ++position; + if (code === 92) { + // \ + value += body.slice(chunkStart, position - 1); + code = body.charCodeAt(position); + switch (code) { + case 34: + value += '"'; + break; + case 47: + value += '/'; + break; + case 92: + value += '\\'; + break; + case 98: + value += '\b'; + break; + case 102: + value += '\f'; + break; + case 110: + value += '\n'; + break; + case 114: + value += '\r'; + break; + case 116: + value += '\t'; + break; + case 117: { + // uXXXX + const charCode = uniCharCode( + body.charCodeAt(position + 1), + body.charCodeAt(position + 2), + body.charCodeAt(position + 3), + body.charCodeAt(position + 4), + ); + if (charCode < 0) { + const invalidSequence = body.slice(position + 1, position + 5); + throw syntaxError( + source, + position, + `Invalid character escape sequence: \\u${invalidSequence}.`, + ); + } + value += String.fromCharCode(charCode); + position += 4; + break; + } + default: + throw syntaxError( + source, + position, + `Invalid character escape sequence: \\${String.fromCharCode( + code, + )}.`, + ); + } + ++position; + chunkStart = position; + } + } + + throw syntaxError(source, position, 'Unterminated string.'); +} + +/** + * Reads a block string token from the source file. + * + * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" + */ +function readBlockString(source, start, line, col, prev, lexer): Token { + const body = source.body; + let position = start + 3; + let chunkStart = position; + let code = 0; + let rawValue = ''; + + while (position < body.length && !isNaN((code = body.charCodeAt(position)))) { + // Closing Triple-Quote (""") + if ( + code === 34 && + body.charCodeAt(position + 1) === 34 && + body.charCodeAt(position + 2) === 34 + ) { + rawValue += body.slice(chunkStart, position); + return new Tok( + TokenKind.BLOCK_STRING, + start, + position + 3, + line, + col, + prev, + dedentBlockStringValue(rawValue), + ); + } + + // SourceCharacter + if ( + code < 0x0020 && + code !== 0x0009 && + code !== 0x000a && + code !== 0x000d + ) { + throw syntaxError( + source, + position, + `Invalid character within String: ${printCharCode(code)}.`, + ); + } + + if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + ++lexer.line; + lexer.lineStart = position; + } else if ( + // Escape Triple-Quote (\""") + code === 92 && + body.charCodeAt(position + 1) === 34 && + body.charCodeAt(position + 2) === 34 && + body.charCodeAt(position + 3) === 34 + ) { + rawValue += body.slice(chunkStart, position) + '"""'; + position += 4; + chunkStart = position; + } else { + ++position; + } + } + + throw syntaxError(source, position, 'Unterminated string.'); +} + +/** + * Converts four hexadecimal chars to the integer that the + * string represents. For example, uniCharCode('0','0','0','f') + * will return 15, and uniCharCode('0','0','f','f') returns 255. + * + * Returns a negative number on error, if a char was invalid. + * + * This is implemented by noting that char2hex() returns -1 on error, + * which means the result of ORing the char2hex() will also be negative. + */ +function uniCharCode(a, b, c, d) { + return ( + (char2hex(a) << 12) | (char2hex(b) << 8) | (char2hex(c) << 4) | char2hex(d) + ); +} + +/** + * Converts a hex character to its integer value. + * '0' becomes 0, '9' becomes 9 + * 'A' becomes 10, 'F' becomes 15 + * 'a' becomes 10, 'f' becomes 15 + * + * Returns -1 on error. + */ +function char2hex(a) { + return a >= 48 && a <= 57 + ? a - 48 // 0-9 + : a >= 65 && a <= 70 + ? a - 55 // A-F + : a >= 97 && a <= 102 + ? a - 87 // a-f + : -1; +} + +/** + * Reads an alphanumeric + underscore name from the source. + * + * [_A-Za-z][_0-9A-Za-z]* + */ +function readName(source, start, line, col, prev): Token { + const body = source.body; + const bodyLength = body.length; + let position = start + 1; + let code = 0; + while ( + position !== bodyLength && + !isNaN((code = body.charCodeAt(position))) && + (code === 95 || // _ + (code >= 48 && code <= 57) || // 0-9 + (code >= 65 && code <= 90) || // A-Z + (code >= 97 && code <= 122)) // a-z + ) { + ++position; + } + return new Tok( + TokenKind.NAME, + start, + position, + line, + col, + prev, + body.slice(start, position), + ); +} diff --git a/node_modules/graphql/language/lexer.mjs b/node_modules/graphql/language/lexer.mjs new file mode 100644 index 000000000..aaebeb172 --- /dev/null +++ b/node_modules/graphql/language/lexer.mjs @@ -0,0 +1,615 @@ +import defineToJSON from '../jsutils/defineToJSON'; +import { TokenKind } from './tokenKind'; +import { syntaxError } from '../error/syntaxError'; +import { dedentBlockStringValue } from './blockString'; +/** + * Given a Source object, this returns a Lexer for that source. + * A Lexer is a stateful stream generator in that every time + * it is advanced, it returns the next token in the Source. Assuming the + * source lexes, the final Token emitted by the lexer will be of kind + * EOF, after which the lexer will repeatedly return the same EOF token + * whenever called. + */ + +export function createLexer(source, options) { + var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null); + var lexer = { + source: source, + options: options, + lastToken: startOfFileToken, + token: startOfFileToken, + line: 1, + lineStart: 0, + advance: advanceLexer, + lookahead: lookahead + }; + return lexer; +} + +function advanceLexer() { + this.lastToken = this.token; + var token = this.token = this.lookahead(); + return token; +} + +function lookahead() { + var token = this.token; + + if (token.kind !== TokenKind.EOF) { + do { + // Note: next is only mutable during parsing, so we cast to allow this. + token = token.next || (token.next = readToken(this, token)); + } while (token.kind === TokenKind.COMMENT); + } + + return token; +} +/** + * The return type of createLexer. + */ + + +// @internal +export function isPunctuatorToken(token) { + var kind = token.kind; + return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R; +} +/** + * A helper function to describe a token as a string for debugging + */ + +export function getTokenDesc(token) { + var value = token.value; + return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; +} +/** + * Helper function for constructing the Token object. + */ + +function Tok(kind, start, end, line, column, prev, value) { + this.kind = kind; + this.start = start; + this.end = end; + this.line = line; + this.column = column; + this.value = value; + this.prev = prev; + this.next = null; +} // Print a simplified form when appearing in JSON/util.inspect. + + +defineToJSON(Tok, function () { + return { + kind: this.kind, + value: this.value, + line: this.line, + column: this.column + }; +}); + +function printCharCode(code) { + return (// NaN/undefined represents access beyond the end of the file. + isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII. + code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form. + "\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"") + ); +} +/** + * Gets the next token from the source starting at the given position. + * + * This skips over whitespace until it finds the next lexable token, then lexes + * punctuators immediately or calls the appropriate helper function for more + * complicated tokens. + */ + + +function readToken(lexer, prev) { + var source = lexer.source; + var body = source.body; + var bodyLength = body.length; + var pos = positionAfterWhitespace(body, prev.end, lexer); + var line = lexer.line; + var col = 1 + pos - lexer.lineStart; + + if (pos >= bodyLength) { + return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev); + } + + var code = body.charCodeAt(pos); // SourceCharacter + + switch (code) { + // ! + case 33: + return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev); + // # + + case 35: + return readComment(source, pos, line, col, prev); + // $ + + case 36: + return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev); + // & + + case 38: + return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev); + // ( + + case 40: + return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev); + // ) + + case 41: + return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev); + // . + + case 46: + if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { + return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev); + } + + break; + // : + + case 58: + return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev); + // = + + case 61: + return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev); + // @ + + case 64: + return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev); + // [ + + case 91: + return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev); + // ] + + case 93: + return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev); + // { + + case 123: + return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev); + // | + + case 124: + return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev); + // } + + case 125: + return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev); + // A-Z _ a-z + + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 95: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + return readName(source, pos, line, col, prev); + // - 0-9 + + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return readNumber(source, pos, code, line, col, prev); + // " + + case 34: + if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) { + return readBlockString(source, pos, line, col, prev, lexer); + } + + return readString(source, pos, line, col, prev); + } + + throw syntaxError(source, pos, unexpectedCharacterMessage(code)); +} +/** + * Report a message that an unexpected character was encountered. + */ + + +function unexpectedCharacterMessage(code) { + if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { + return "Cannot contain the invalid character ".concat(printCharCode(code), "."); + } + + if (code === 39) { + // ' + return 'Unexpected single quote character (\'), did you mean to use a double quote (")?'; + } + + return "Cannot parse the unexpected character ".concat(printCharCode(code), "."); +} +/** + * Reads from body starting at startPosition until it finds a non-whitespace + * character, then returns the position of that character for lexing. + */ + + +function positionAfterWhitespace(body, startPosition, lexer) { + var bodyLength = body.length; + var position = startPosition; + + while (position < bodyLength) { + var code = body.charCodeAt(position); // tab | space | comma | BOM + + if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { + ++position; + } else if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + + ++lexer.line; + lexer.lineStart = position; + } else { + break; + } + } + + return position; +} +/** + * Reads a comment token from the source file. + * + * #[\u0009\u0020-\uFFFF]* + */ + + +function readComment(source, start, line, col, prev) { + var body = source.body; + var code; + var position = start; + + do { + code = body.charCodeAt(++position); + } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator + code > 0x001f || code === 0x0009)); + + return new Tok(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position)); +} +/** + * Reads a number token from the source file, either a float + * or an int depending on whether a decimal point appears. + * + * Int: -?(0|[1-9][0-9]*) + * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? + */ + + +function readNumber(source, start, firstCode, line, col, prev) { + var body = source.body; + var code = firstCode; + var position = start; + var isFloat = false; + + if (code === 45) { + // - + code = body.charCodeAt(++position); + } + + if (code === 48) { + // 0 + code = body.charCodeAt(++position); + + if (code >= 48 && code <= 57) { + throw syntaxError(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), ".")); + } + } else { + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 46) { + // . + isFloat = true; + code = body.charCodeAt(++position); + position = readDigits(source, position, code); + code = body.charCodeAt(position); + } + + if (code === 69 || code === 101) { + // E e + isFloat = true; + code = body.charCodeAt(++position); + + if (code === 43 || code === 45) { + // + - + code = body.charCodeAt(++position); + } + + position = readDigits(source, position, code); + } + + return new Tok(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position)); +} +/** + * Returns the new position in the source after reading digits. + */ + + +function readDigits(source, start, firstCode) { + var body = source.body; + var position = start; + var code = firstCode; + + if (code >= 48 && code <= 57) { + // 0 - 9 + do { + code = body.charCodeAt(++position); + } while (code >= 48 && code <= 57); // 0 - 9 + + + return position; + } + + throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); +} +/** + * Reads a string token from the source file. + * + * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*" + */ + + +function readString(source, start, line, col, prev) { + var body = source.body; + var position = start + 1; + var chunkStart = position; + var code = 0; + var value = ''; + + while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator + code !== 0x000a && code !== 0x000d) { + // Closing Quote (") + if (code === 34) { + value += body.slice(chunkStart, position); + return new Tok(TokenKind.STRING, start, position + 1, line, col, prev, value); + } // SourceCharacter + + + if (code < 0x0020 && code !== 0x0009) { + throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); + } + + ++position; + + if (code === 92) { + // \ + value += body.slice(chunkStart, position - 1); + code = body.charCodeAt(position); + + switch (code) { + case 34: + value += '"'; + break; + + case 47: + value += '/'; + break; + + case 92: + value += '\\'; + break; + + case 98: + value += '\b'; + break; + + case 102: + value += '\f'; + break; + + case 110: + value += '\n'; + break; + + case 114: + value += '\r'; + break; + + case 116: + value += '\t'; + break; + + case 117: + { + // uXXXX + var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4)); + + if (charCode < 0) { + var invalidSequence = body.slice(position + 1, position + 5); + throw syntaxError(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, ".")); + } + + value += String.fromCharCode(charCode); + position += 4; + break; + } + + default: + throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), ".")); + } + + ++position; + chunkStart = position; + } + } + + throw syntaxError(source, position, 'Unterminated string.'); +} +/** + * Reads a block string token from the source file. + * + * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" + */ + + +function readBlockString(source, start, line, col, prev, lexer) { + var body = source.body; + var position = start + 3; + var chunkStart = position; + var code = 0; + var rawValue = ''; + + while (position < body.length && !isNaN(code = body.charCodeAt(position))) { + // Closing Triple-Quote (""") + if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { + rawValue += body.slice(chunkStart, position); + return new Tok(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue)); + } // SourceCharacter + + + if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { + throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), ".")); + } + + if (code === 10) { + // new line + ++position; + ++lexer.line; + lexer.lineStart = position; + } else if (code === 13) { + // carriage return + if (body.charCodeAt(position + 1) === 10) { + position += 2; + } else { + ++position; + } + + ++lexer.line; + lexer.lineStart = position; + } else if ( // Escape Triple-Quote (\""") + code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) { + rawValue += body.slice(chunkStart, position) + '"""'; + position += 4; + chunkStart = position; + } else { + ++position; + } + } + + throw syntaxError(source, position, 'Unterminated string.'); +} +/** + * Converts four hexadecimal chars to the integer that the + * string represents. For example, uniCharCode('0','0','0','f') + * will return 15, and uniCharCode('0','0','f','f') returns 255. + * + * Returns a negative number on error, if a char was invalid. + * + * This is implemented by noting that char2hex() returns -1 on error, + * which means the result of ORing the char2hex() will also be negative. + */ + + +function uniCharCode(a, b, c, d) { + return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); +} +/** + * Converts a hex character to its integer value. + * '0' becomes 0, '9' becomes 9 + * 'A' becomes 10, 'F' becomes 15 + * 'a' becomes 10, 'f' becomes 15 + * + * Returns -1 on error. + */ + + +function char2hex(a) { + return a >= 48 && a <= 57 ? a - 48 // 0-9 + : a >= 65 && a <= 70 ? a - 55 // A-F + : a >= 97 && a <= 102 ? a - 87 // a-f + : -1; +} +/** + * Reads an alphanumeric + underscore name from the source. + * + * [_A-Za-z][_0-9A-Za-z]* + */ + + +function readName(source, start, line, col, prev) { + var body = source.body; + var bodyLength = body.length; + var position = start + 1; + var code = 0; + + while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _ + code >= 48 && code <= 57 || // 0-9 + code >= 65 && code <= 90 || // A-Z + code >= 97 && code <= 122) // a-z + ) { + ++position; + } + + return new Tok(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); +} diff --git a/node_modules/graphql/language/location.js b/node_modules/graphql/language/location.js new file mode 100644 index 000000000..27d87c3d1 --- /dev/null +++ b/node_modules/graphql/language/location.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLocation = getLocation; + +/** + * Represents a location in a Source. + */ + +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ +function getLocation(source, position) { + var lineRegexp = /\r\n|[\n\r]/g; + var line = 1; + var column = position + 1; + var match; + + while ((match = lineRegexp.exec(source.body)) && match.index < position) { + line += 1; + column = position + 1 - (match.index + match[0].length); + } + + return { + line: line, + column: column + }; +} diff --git a/node_modules/graphql/language/location.js.flow b/node_modules/graphql/language/location.js.flow new file mode 100644 index 000000000..391851300 --- /dev/null +++ b/node_modules/graphql/language/location.js.flow @@ -0,0 +1,27 @@ +// @flow strict + +import { type Source } from './source'; + +/** + * Represents a location in a Source. + */ +export type SourceLocation = {| + +line: number, + +column: number, +|}; + +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ +export function getLocation(source: Source, position: number): SourceLocation { + const lineRegexp = /\r\n|[\n\r]/g; + let line = 1; + let column = position + 1; + let match; + while ((match = lineRegexp.exec(source.body)) && match.index < position) { + line += 1; + column = position + 1 - (match.index + match[0].length); + } + return { line, column }; +} diff --git a/node_modules/graphql/language/location.mjs b/node_modules/graphql/language/location.mjs new file mode 100644 index 000000000..e578ef0ba --- /dev/null +++ b/node_modules/graphql/language/location.mjs @@ -0,0 +1,24 @@ +/** + * Represents a location in a Source. + */ + +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ +export function getLocation(source, position) { + var lineRegexp = /\r\n|[\n\r]/g; + var line = 1; + var column = position + 1; + var match; + + while ((match = lineRegexp.exec(source.body)) && match.index < position) { + line += 1; + column = position + 1 - (match.index + match[0].length); + } + + return { + line: line, + column: column + }; +} diff --git a/node_modules/graphql/language/parser.js b/node_modules/graphql/language/parser.js new file mode 100644 index 000000000..1ec23038c --- /dev/null +++ b/node_modules/graphql/language/parser.js @@ -0,0 +1,1522 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse = parse; +exports.parseValue = parseValue; +exports.parseType = parseType; +exports.parseConstValue = parseConstValue; +exports.parseTypeReference = parseTypeReference; +exports.parseNamedType = parseNamedType; + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _defineToJSON = _interopRequireDefault(require("../jsutils/defineToJSON")); + +var _source = require("./source"); + +var _syntaxError = require("../error/syntaxError"); + +var _tokenKind = require("./tokenKind"); + +var _lexer = require("./lexer"); + +var _kinds = require("./kinds"); + +var _directiveLocation = require("./directiveLocation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + */ +function parse(source, options) { + var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; + + if (!(sourceObj instanceof _source.Source)) { + throw new TypeError("Must provide Source. Received: ".concat((0, _inspect.default)(sourceObj))); + } + + var lexer = (0, _lexer.createLexer)(sourceObj, options || {}); + return parseDocument(lexer); +} +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + */ + + +function parseValue(source, options) { + var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; + var lexer = (0, _lexer.createLexer)(sourceObj, options || {}); + expectToken(lexer, _tokenKind.TokenKind.SOF); + var value = parseValueLiteral(lexer, false); + expectToken(lexer, _tokenKind.TokenKind.EOF); + return value; +} +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + */ + + +function parseType(source, options) { + var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; + var lexer = (0, _lexer.createLexer)(sourceObj, options || {}); + expectToken(lexer, _tokenKind.TokenKind.SOF); + var type = parseTypeReference(lexer); + expectToken(lexer, _tokenKind.TokenKind.EOF); + return type; +} +/** + * Converts a name lex token into a name parse node. + */ + + +function parseName(lexer) { + var token = expectToken(lexer, _tokenKind.TokenKind.NAME); + return { + kind: _kinds.Kind.NAME, + value: token.value, + loc: loc(lexer, token) + }; +} // Implements the parsing rules in the Document section. + +/** + * Document : Definition+ + */ + + +function parseDocument(lexer) { + var start = lexer.token; + return { + kind: _kinds.Kind.DOCUMENT, + definitions: many(lexer, _tokenKind.TokenKind.SOF, parseDefinition, _tokenKind.TokenKind.EOF), + loc: loc(lexer, start) + }; +} +/** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + */ + + +function parseDefinition(lexer) { + if (peek(lexer, _tokenKind.TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + case 'fragment': + return parseExecutableDefinition(lexer); + + case 'schema': + case 'scalar': + case 'type': + case 'interface': + case 'union': + case 'enum': + case 'input': + case 'directive': + return parseTypeSystemDefinition(lexer); + + case 'extend': + return parseTypeSystemExtension(lexer); + } + } else if (peek(lexer, _tokenKind.TokenKind.BRACE_L)) { + return parseExecutableDefinition(lexer); + } else if (peekDescription(lexer)) { + return parseTypeSystemDefinition(lexer); + } + + throw unexpected(lexer); +} +/** + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + */ + + +function parseExecutableDefinition(lexer) { + if (peek(lexer, _tokenKind.TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + return parseOperationDefinition(lexer); + + case 'fragment': + return parseFragmentDefinition(lexer); + } + } else if (peek(lexer, _tokenKind.TokenKind.BRACE_L)) { + return parseOperationDefinition(lexer); + } + + throw unexpected(lexer); +} // Implements the parsing rules in the Operations section. + +/** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + */ + + +function parseOperationDefinition(lexer) { + var start = lexer.token; + + if (peek(lexer, _tokenKind.TokenKind.BRACE_L)) { + return { + kind: _kinds.Kind.OPERATION_DEFINITION, + operation: 'query', + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; + } + + var operation = parseOperationType(lexer); + var name; + + if (peek(lexer, _tokenKind.TokenKind.NAME)) { + name = parseName(lexer); + } + + return { + kind: _kinds.Kind.OPERATION_DEFINITION, + operation: operation, + name: name, + variableDefinitions: parseVariableDefinitions(lexer), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * OperationType : one of query mutation subscription + */ + + +function parseOperationType(lexer) { + var operationToken = expectToken(lexer, _tokenKind.TokenKind.NAME); + + switch (operationToken.value) { + case 'query': + return 'query'; + + case 'mutation': + return 'mutation'; + + case 'subscription': + return 'subscription'; + } + + throw unexpected(lexer, operationToken); +} +/** + * VariableDefinitions : ( VariableDefinition+ ) + */ + + +function parseVariableDefinitions(lexer) { + return peek(lexer, _tokenKind.TokenKind.PAREN_L) ? many(lexer, _tokenKind.TokenKind.PAREN_L, parseVariableDefinition, _tokenKind.TokenKind.PAREN_R) : []; +} +/** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + */ + + +function parseVariableDefinition(lexer) { + var start = lexer.token; + return { + kind: _kinds.Kind.VARIABLE_DEFINITION, + variable: parseVariable(lexer), + type: (expectToken(lexer, _tokenKind.TokenKind.COLON), parseTypeReference(lexer)), + defaultValue: expectOptionalToken(lexer, _tokenKind.TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined, + directives: parseDirectives(lexer, true), + loc: loc(lexer, start) + }; +} +/** + * Variable : $ Name + */ + + +function parseVariable(lexer) { + var start = lexer.token; + expectToken(lexer, _tokenKind.TokenKind.DOLLAR); + return { + kind: _kinds.Kind.VARIABLE, + name: parseName(lexer), + loc: loc(lexer, start) + }; +} +/** + * SelectionSet : { Selection+ } + */ + + +function parseSelectionSet(lexer) { + var start = lexer.token; + return { + kind: _kinds.Kind.SELECTION_SET, + selections: many(lexer, _tokenKind.TokenKind.BRACE_L, parseSelection, _tokenKind.TokenKind.BRACE_R), + loc: loc(lexer, start) + }; +} +/** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ + + +function parseSelection(lexer) { + return peek(lexer, _tokenKind.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer); +} +/** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + */ + + +function parseField(lexer) { + var start = lexer.token; + var nameOrAlias = parseName(lexer); + var alias; + var name; + + if (expectOptionalToken(lexer, _tokenKind.TokenKind.COLON)) { + alias = nameOrAlias; + name = parseName(lexer); + } else { + name = nameOrAlias; + } + + return { + kind: _kinds.Kind.FIELD, + alias: alias, + name: name, + arguments: parseArguments(lexer, false), + directives: parseDirectives(lexer, false), + selectionSet: peek(lexer, _tokenKind.TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined, + loc: loc(lexer, start) + }; +} +/** + * Arguments[Const] : ( Argument[?Const]+ ) + */ + + +function parseArguments(lexer, isConst) { + var item = isConst ? parseConstArgument : parseArgument; + return peek(lexer, _tokenKind.TokenKind.PAREN_L) ? many(lexer, _tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R) : []; +} +/** + * Argument[Const] : Name : Value[?Const] + */ + + +function parseArgument(lexer) { + var start = lexer.token; + var name = parseName(lexer); + expectToken(lexer, _tokenKind.TokenKind.COLON); + return { + kind: _kinds.Kind.ARGUMENT, + name: name, + value: parseValueLiteral(lexer, false), + loc: loc(lexer, start) + }; +} + +function parseConstArgument(lexer) { + var start = lexer.token; + return { + kind: _kinds.Kind.ARGUMENT, + name: parseName(lexer), + value: (expectToken(lexer, _tokenKind.TokenKind.COLON), parseConstValue(lexer)), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Fragments section. + +/** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + */ + + +function parseFragment(lexer) { + var start = lexer.token; + expectToken(lexer, _tokenKind.TokenKind.SPREAD); + var hasTypeCondition = expectOptionalKeyword(lexer, 'on'); + + if (!hasTypeCondition && peek(lexer, _tokenKind.TokenKind.NAME)) { + return { + kind: _kinds.Kind.FRAGMENT_SPREAD, + name: parseFragmentName(lexer), + directives: parseDirectives(lexer, false), + loc: loc(lexer, start) + }; + } + + return { + kind: _kinds.Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? parseNamedType(lexer) : undefined, + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * FragmentDefinition : + * - fragment FragmentName on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + */ + + +function parseFragmentDefinition(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'fragment'); // Experimental support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + + if (lexer.options.experimentalFragmentVariables) { + return { + kind: _kinds.Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + variableDefinitions: parseVariableDefinitions(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; + } + + return { + kind: _kinds.Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * FragmentName : Name but not `on` + */ + + +function parseFragmentName(lexer) { + if (lexer.token.value === 'on') { + throw unexpected(lexer); + } + + return parseName(lexer); +} // Implements the parsing rules in the Values section. + +/** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + */ + + +function parseValueLiteral(lexer, isConst) { + var token = lexer.token; + + switch (token.kind) { + case _tokenKind.TokenKind.BRACKET_L: + return parseList(lexer, isConst); + + case _tokenKind.TokenKind.BRACE_L: + return parseObject(lexer, isConst); + + case _tokenKind.TokenKind.INT: + lexer.advance(); + return { + kind: _kinds.Kind.INT, + value: token.value, + loc: loc(lexer, token) + }; + + case _tokenKind.TokenKind.FLOAT: + lexer.advance(); + return { + kind: _kinds.Kind.FLOAT, + value: token.value, + loc: loc(lexer, token) + }; + + case _tokenKind.TokenKind.STRING: + case _tokenKind.TokenKind.BLOCK_STRING: + return parseStringLiteral(lexer); + + case _tokenKind.TokenKind.NAME: + if (token.value === 'true' || token.value === 'false') { + lexer.advance(); + return { + kind: _kinds.Kind.BOOLEAN, + value: token.value === 'true', + loc: loc(lexer, token) + }; + } else if (token.value === 'null') { + lexer.advance(); + return { + kind: _kinds.Kind.NULL, + loc: loc(lexer, token) + }; + } + + lexer.advance(); + return { + kind: _kinds.Kind.ENUM, + value: token.value, + loc: loc(lexer, token) + }; + + case _tokenKind.TokenKind.DOLLAR: + if (!isConst) { + return parseVariable(lexer); + } + + break; + } + + throw unexpected(lexer); +} + +function parseStringLiteral(lexer) { + var token = lexer.token; + lexer.advance(); + return { + kind: _kinds.Kind.STRING, + value: token.value, + block: token.kind === _tokenKind.TokenKind.BLOCK_STRING, + loc: loc(lexer, token) + }; +} + +function parseConstValue(lexer) { + return parseValueLiteral(lexer, true); +} + +function parseValueValue(lexer) { + return parseValueLiteral(lexer, false); +} +/** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + */ + + +function parseList(lexer, isConst) { + var start = lexer.token; + var item = isConst ? parseConstValue : parseValueValue; + return { + kind: _kinds.Kind.LIST, + values: any(lexer, _tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R), + loc: loc(lexer, start) + }; +} +/** + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + */ + + +function parseObject(lexer, isConst) { + var start = lexer.token; + + var item = function item() { + return parseObjectField(lexer, isConst); + }; + + return { + kind: _kinds.Kind.OBJECT, + fields: any(lexer, _tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R), + loc: loc(lexer, start) + }; +} +/** + * ObjectField[Const] : Name : Value[?Const] + */ + + +function parseObjectField(lexer, isConst) { + var start = lexer.token; + var name = parseName(lexer); + expectToken(lexer, _tokenKind.TokenKind.COLON); + return { + kind: _kinds.Kind.OBJECT_FIELD, + name: name, + value: parseValueLiteral(lexer, isConst), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Directives section. + +/** + * Directives[Const] : Directive[?Const]+ + */ + + +function parseDirectives(lexer, isConst) { + var directives = []; + + while (peek(lexer, _tokenKind.TokenKind.AT)) { + directives.push(parseDirective(lexer, isConst)); + } + + return directives; +} +/** + * Directive[Const] : @ Name Arguments[?Const]? + */ + + +function parseDirective(lexer, isConst) { + var start = lexer.token; + expectToken(lexer, _tokenKind.TokenKind.AT); + return { + kind: _kinds.Kind.DIRECTIVE, + name: parseName(lexer), + arguments: parseArguments(lexer, isConst), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Types section. + +/** + * Type : + * - NamedType + * - ListType + * - NonNullType + */ + + +function parseTypeReference(lexer) { + var start = lexer.token; + var type; + + if (expectOptionalToken(lexer, _tokenKind.TokenKind.BRACKET_L)) { + type = parseTypeReference(lexer); + expectToken(lexer, _tokenKind.TokenKind.BRACKET_R); + type = { + kind: _kinds.Kind.LIST_TYPE, + type: type, + loc: loc(lexer, start) + }; + } else { + type = parseNamedType(lexer); + } + + if (expectOptionalToken(lexer, _tokenKind.TokenKind.BANG)) { + return { + kind: _kinds.Kind.NON_NULL_TYPE, + type: type, + loc: loc(lexer, start) + }; + } + + return type; +} +/** + * NamedType : Name + */ + + +function parseNamedType(lexer) { + var start = lexer.token; + return { + kind: _kinds.Kind.NAMED_TYPE, + name: parseName(lexer), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Type Definition section. + +/** + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + */ + + +function parseTypeSystemDefinition(lexer) { + // Many definitions begin with a description and require a lookahead. + var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token; + + if (keywordToken.kind === _tokenKind.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaDefinition(lexer); + + case 'scalar': + return parseScalarTypeDefinition(lexer); + + case 'type': + return parseObjectTypeDefinition(lexer); + + case 'interface': + return parseInterfaceTypeDefinition(lexer); + + case 'union': + return parseUnionTypeDefinition(lexer); + + case 'enum': + return parseEnumTypeDefinition(lexer); + + case 'input': + return parseInputObjectTypeDefinition(lexer); + + case 'directive': + return parseDirectiveDefinition(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} + +function peekDescription(lexer) { + return peek(lexer, _tokenKind.TokenKind.STRING) || peek(lexer, _tokenKind.TokenKind.BLOCK_STRING); +} +/** + * Description : StringValue + */ + + +function parseDescription(lexer) { + if (peekDescription(lexer)) { + return parseStringLiteral(lexer); + } +} +/** + * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ } + */ + + +function parseSchemaDefinition(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'schema'); + var directives = parseDirectives(lexer, true); + var operationTypes = many(lexer, _tokenKind.TokenKind.BRACE_L, parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); + return { + kind: _kinds.Kind.SCHEMA_DEFINITION, + directives: directives, + operationTypes: operationTypes, + loc: loc(lexer, start) + }; +} +/** + * OperationTypeDefinition : OperationType : NamedType + */ + + +function parseOperationTypeDefinition(lexer) { + var start = lexer.token; + var operation = parseOperationType(lexer); + expectToken(lexer, _tokenKind.TokenKind.COLON); + var type = parseNamedType(lexer); + return { + kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, + operation: operation, + type: type, + loc: loc(lexer, start) + }; +} +/** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + */ + + +function parseScalarTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'scalar'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + */ + + +function parseObjectTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'type'); + var name = parseName(lexer); + var interfaces = parseImplementsInterfaces(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + return { + kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, + description: description, + name: name, + interfaces: interfaces, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ + + +function parseImplementsInterfaces(lexer) { + var types = []; + + if (expectOptionalKeyword(lexer, 'implements')) { + // Optional leading ampersand + expectOptionalToken(lexer, _tokenKind.TokenKind.AMP); + + do { + types.push(parseNamedType(lexer)); + } while (expectOptionalToken(lexer, _tokenKind.TokenKind.AMP) || // Legacy support for the SDL? + lexer.options.allowLegacySDLImplementsInterfaces && peek(lexer, _tokenKind.TokenKind.NAME)); + } + + return types; +} +/** + * FieldsDefinition : { FieldDefinition+ } + */ + + +function parseFieldsDefinition(lexer) { + // Legacy support for the SDL? + if (lexer.options.allowLegacySDLEmptyFields && peek(lexer, _tokenKind.TokenKind.BRACE_L) && lexer.lookahead().kind === _tokenKind.TokenKind.BRACE_R) { + lexer.advance(); + lexer.advance(); + return []; + } + + return peek(lexer, _tokenKind.TokenKind.BRACE_L) ? many(lexer, _tokenKind.TokenKind.BRACE_L, parseFieldDefinition, _tokenKind.TokenKind.BRACE_R) : []; +} +/** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + */ + + +function parseFieldDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + var args = parseArgumentDefs(lexer); + expectToken(lexer, _tokenKind.TokenKind.COLON); + var type = parseTypeReference(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: _kinds.Kind.FIELD_DEFINITION, + description: description, + name: name, + arguments: args, + type: type, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ArgumentsDefinition : ( InputValueDefinition+ ) + */ + + +function parseArgumentDefs(lexer) { + if (!peek(lexer, _tokenKind.TokenKind.PAREN_L)) { + return []; + } + + return many(lexer, _tokenKind.TokenKind.PAREN_L, parseInputValueDef, _tokenKind.TokenKind.PAREN_R); +} +/** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + */ + + +function parseInputValueDef(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + expectToken(lexer, _tokenKind.TokenKind.COLON); + var type = parseTypeReference(lexer); + var defaultValue; + + if (expectOptionalToken(lexer, _tokenKind.TokenKind.EQUALS)) { + defaultValue = parseConstValue(lexer); + } + + var directives = parseDirectives(lexer, true); + return { + kind: _kinds.Kind.INPUT_VALUE_DEFINITION, + description: description, + name: name, + type: type, + defaultValue: defaultValue, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + */ + + +function parseInterfaceTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'interface'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + return { + kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + */ + + +function parseUnionTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'union'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var types = parseUnionMemberTypes(lexer); + return { + kind: _kinds.Kind.UNION_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + types: types, + loc: loc(lexer, start) + }; +} +/** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ + + +function parseUnionMemberTypes(lexer) { + var types = []; + + if (expectOptionalToken(lexer, _tokenKind.TokenKind.EQUALS)) { + // Optional leading pipe + expectOptionalToken(lexer, _tokenKind.TokenKind.PIPE); + + do { + types.push(parseNamedType(lexer)); + } while (expectOptionalToken(lexer, _tokenKind.TokenKind.PIPE)); + } + + return types; +} +/** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + */ + + +function parseEnumTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'enum'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var values = parseEnumValuesDefinition(lexer); + return { + kind: _kinds.Kind.ENUM_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + values: values, + loc: loc(lexer, start) + }; +} +/** + * EnumValuesDefinition : { EnumValueDefinition+ } + */ + + +function parseEnumValuesDefinition(lexer) { + return peek(lexer, _tokenKind.TokenKind.BRACE_L) ? many(lexer, _tokenKind.TokenKind.BRACE_L, parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R) : []; +} +/** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + * + * EnumValue : Name + */ + + +function parseEnumValueDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: _kinds.Kind.ENUM_VALUE_DEFINITION, + description: description, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + */ + + +function parseInputObjectTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'input'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseInputFieldsDefinition(lexer); + return { + kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * InputFieldsDefinition : { InputValueDefinition+ } + */ + + +function parseInputFieldsDefinition(lexer) { + return peek(lexer, _tokenKind.TokenKind.BRACE_L) ? many(lexer, _tokenKind.TokenKind.BRACE_L, parseInputValueDef, _tokenKind.TokenKind.BRACE_R) : []; +} +/** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + */ + + +function parseTypeSystemExtension(lexer) { + var keywordToken = lexer.lookahead(); + + if (keywordToken.kind === _tokenKind.TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaExtension(lexer); + + case 'scalar': + return parseScalarTypeExtension(lexer); + + case 'type': + return parseObjectTypeExtension(lexer); + + case 'interface': + return parseInterfaceTypeExtension(lexer); + + case 'union': + return parseUnionTypeExtension(lexer); + + case 'enum': + return parseEnumTypeExtension(lexer); + + case 'input': + return parseInputObjectTypeExtension(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} +/** + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + */ + + +function parseSchemaExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'schema'); + var directives = parseDirectives(lexer, true); + var operationTypes = peek(lexer, _tokenKind.TokenKind.BRACE_L) ? many(lexer, _tokenKind.TokenKind.BRACE_L, parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R) : []; + + if (directives.length === 0 && operationTypes.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.SCHEMA_EXTENSION, + directives: directives, + operationTypes: operationTypes, + loc: loc(lexer, start) + }; +} +/** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + */ + + +function parseScalarTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'scalar'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + + if (directives.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + */ + + +function parseObjectTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'type'); + var name = parseName(lexer); + var interfaces = parseImplementsInterfaces(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + + if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, + name: name, + interfaces: interfaces, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * InterfaceTypeExtension : + * - extend interface Name Directives[Const]? FieldsDefinition + * - extend interface Name Directives[Const] + */ + + +function parseInterfaceTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'interface'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + */ + + +function parseUnionTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'union'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var types = parseUnionMemberTypes(lexer); + + if (directives.length === 0 && types.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.UNION_TYPE_EXTENSION, + name: name, + directives: directives, + types: types, + loc: loc(lexer, start) + }; +} +/** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + */ + + +function parseEnumTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'enum'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var values = parseEnumValuesDefinition(lexer); + + if (directives.length === 0 && values.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.ENUM_TYPE_EXTENSION, + name: name, + directives: directives, + values: values, + loc: loc(lexer, start) + }; +} +/** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + */ + + +function parseInputObjectTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'input'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseInputFieldsDefinition(lexer); + + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + */ + + +function parseDirectiveDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'directive'); + expectToken(lexer, _tokenKind.TokenKind.AT); + var name = parseName(lexer); + var args = parseArgumentDefs(lexer); + var repeatable = expectOptionalKeyword(lexer, 'repeatable'); + expectKeyword(lexer, 'on'); + var locations = parseDirectiveLocations(lexer); + return { + kind: _kinds.Kind.DIRECTIVE_DEFINITION, + description: description, + name: name, + arguments: args, + repeatable: repeatable, + locations: locations, + loc: loc(lexer, start) + }; +} +/** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + */ + + +function parseDirectiveLocations(lexer) { + // Optional leading pipe + expectOptionalToken(lexer, _tokenKind.TokenKind.PIPE); + var locations = []; + + do { + locations.push(parseDirectiveLocation(lexer)); + } while (expectOptionalToken(lexer, _tokenKind.TokenKind.PIPE)); + + return locations; +} +/* + * DirectiveLocation : + * - ExecutableDirectiveLocation + * - TypeSystemDirectiveLocation + * + * ExecutableDirectiveLocation : one of + * `QUERY` + * `MUTATION` + * `SUBSCRIPTION` + * `FIELD` + * `FRAGMENT_DEFINITION` + * `FRAGMENT_SPREAD` + * `INLINE_FRAGMENT` + * + * TypeSystemDirectiveLocation : one of + * `SCHEMA` + * `SCALAR` + * `OBJECT` + * `FIELD_DEFINITION` + * `ARGUMENT_DEFINITION` + * `INTERFACE` + * `UNION` + * `ENUM` + * `ENUM_VALUE` + * `INPUT_OBJECT` + * `INPUT_FIELD_DEFINITION` + */ + + +function parseDirectiveLocation(lexer) { + var start = lexer.token; + var name = parseName(lexer); + + if (_directiveLocation.DirectiveLocation[name.value] !== undefined) { + return name; + } + + throw unexpected(lexer, start); +} // Core parsing utility functions + +/** + * Returns a location object, used to identify the place in + * the source that created a given parsed object. + */ + + +function loc(lexer, startToken) { + if (!lexer.options.noLocation) { + return new Loc(startToken, lexer.lastToken, lexer.source); + } +} + +function Loc(startToken, endToken, source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; +} // Print a simplified form when appearing in JSON/util.inspect. + + +(0, _defineToJSON.default)(Loc, function () { + return { + start: this.start, + end: this.end + }; +}); +/** + * Determines if the next token is of a given kind + */ + +function peek(lexer, kind) { + return lexer.token.kind === kind; +} +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and throw an error. + */ + + +function expectToken(lexer, kind) { + var token = lexer.token; + + if (token.kind === kind) { + lexer.advance(); + return token; + } + + throw (0, _syntaxError.syntaxError)(lexer.source, token.start, "Expected ".concat(kind, ", found ").concat((0, _lexer.getTokenDesc)(token))); +} +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and return undefined. + */ + + +function expectOptionalToken(lexer, kind) { + var token = lexer.token; + + if (token.kind === kind) { + lexer.advance(); + return token; + } + + return undefined; +} +/** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + */ + + +function expectKeyword(lexer, value) { + var token = lexer.token; + + if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { + lexer.advance(); + } else { + throw (0, _syntaxError.syntaxError)(lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat((0, _lexer.getTokenDesc)(token))); + } +} +/** + * If the next token is a given keyword, return "true" after advancing + * the lexer. Otherwise, do not change the parser state and return "false". + */ + + +function expectOptionalKeyword(lexer, value) { + var token = lexer.token; + + if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { + lexer.advance(); + return true; + } + + return false; +} +/** + * Helper function for creating an error when an unexpected lexed token + * is encountered. + */ + + +function unexpected(lexer, atToken) { + var token = atToken || lexer.token; + return (0, _syntaxError.syntaxError)(lexer.source, token.start, "Unexpected ".concat((0, _lexer.getTokenDesc)(token))); +} +/** + * Returns a possibly empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ + + +function any(lexer, openKind, parseFn, closeKind) { + expectToken(lexer, openKind); + var nodes = []; + + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + + return nodes; +} +/** + * Returns a non-empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ + + +function many(lexer, openKind, parseFn, closeKind) { + expectToken(lexer, openKind); + var nodes = [parseFn(lexer)]; + + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + + return nodes; +} diff --git a/node_modules/graphql/language/parser.js.flow b/node_modules/graphql/language/parser.js.flow new file mode 100644 index 000000000..45d31ca71 --- /dev/null +++ b/node_modules/graphql/language/parser.js.flow @@ -0,0 +1,1570 @@ +// @flow strict + +import inspect from '../jsutils/inspect'; +import defineToJSON from '../jsutils/defineToJSON'; +import { Source } from './source'; +import { type GraphQLError } from '../error/GraphQLError'; +import { syntaxError } from '../error/syntaxError'; +import { type TokenKindEnum, TokenKind } from './tokenKind'; +import { type Lexer, getTokenDesc, createLexer } from './lexer'; +import { + type Location, + type Token, + type NameNode, + type VariableNode, + type DocumentNode, + type DefinitionNode, + type ExecutableDefinitionNode, + type OperationDefinitionNode, + type OperationTypeNode, + type VariableDefinitionNode, + type SelectionSetNode, + type SelectionNode, + type FieldNode, + type ArgumentNode, + type FragmentSpreadNode, + type InlineFragmentNode, + type FragmentDefinitionNode, + type ValueNode, + type StringValueNode, + type ListValueNode, + type ObjectValueNode, + type ObjectFieldNode, + type DirectiveNode, + type TypeNode, + type NamedTypeNode, + type ListTypeNode, + type NonNullTypeNode, + type TypeSystemDefinitionNode, + type SchemaDefinitionNode, + type OperationTypeDefinitionNode, + type ScalarTypeDefinitionNode, + type ObjectTypeDefinitionNode, + type FieldDefinitionNode, + type InputValueDefinitionNode, + type InterfaceTypeDefinitionNode, + type UnionTypeDefinitionNode, + type EnumTypeDefinitionNode, + type EnumValueDefinitionNode, + type InputObjectTypeDefinitionNode, + type DirectiveDefinitionNode, + type TypeSystemExtensionNode, + type SchemaExtensionNode, + type ScalarTypeExtensionNode, + type ObjectTypeExtensionNode, + type InterfaceTypeExtensionNode, + type UnionTypeExtensionNode, + type EnumTypeExtensionNode, + type InputObjectTypeExtensionNode, +} from './ast'; + +import { Kind } from './kinds'; +import { DirectiveLocation } from './directiveLocation'; + +/** + * Configuration options to control parser behavior + */ +export type ParseOptions = { + /** + * By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing. + */ + noLocation?: boolean, + + /** + * If enabled, the parser will parse empty fields sets in the Schema + * Definition Language. Otherwise, the parser will follow the current + * specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in v16. + */ + allowLegacySDLEmptyFields?: boolean, + + /** + * If enabled, the parser will parse implemented interfaces with no `&` + * character between each interface. Otherwise, the parser will follow the + * current specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in v16. + */ + allowLegacySDLImplementsInterfaces?: boolean, + + /** + * EXPERIMENTAL: + * + * If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * fragment A($var: Boolean = false) on T { + * ... + * } + * + * Note: this feature is experimental and may change or be removed in the + * future. + */ + experimentalFragmentVariables?: boolean, + + ... +}; + +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + */ +export function parse( + source: string | Source, + options?: ParseOptions, +): DocumentNode { + const sourceObj = typeof source === 'string' ? new Source(source) : source; + if (!(sourceObj instanceof Source)) { + throw new TypeError(`Must provide Source. Received: ${inspect(sourceObj)}`); + } + const lexer = createLexer(sourceObj, options || {}); + return parseDocument(lexer); +} + +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + */ +export function parseValue( + source: string | Source, + options?: ParseOptions, +): ValueNode { + const sourceObj = typeof source === 'string' ? new Source(source) : source; + const lexer = createLexer(sourceObj, options || {}); + expectToken(lexer, TokenKind.SOF); + const value = parseValueLiteral(lexer, false); + expectToken(lexer, TokenKind.EOF); + return value; +} + +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + */ +export function parseType( + source: string | Source, + options?: ParseOptions, +): TypeNode { + const sourceObj = typeof source === 'string' ? new Source(source) : source; + const lexer = createLexer(sourceObj, options || {}); + expectToken(lexer, TokenKind.SOF); + const type = parseTypeReference(lexer); + expectToken(lexer, TokenKind.EOF); + return type; +} + +/** + * Converts a name lex token into a name parse node. + */ +function parseName(lexer: Lexer<*>): NameNode { + const token = expectToken(lexer, TokenKind.NAME); + return { + kind: Kind.NAME, + value: ((token.value: any): string), + loc: loc(lexer, token), + }; +} + +// Implements the parsing rules in the Document section. + +/** + * Document : Definition+ + */ +function parseDocument(lexer: Lexer<*>): DocumentNode { + const start = lexer.token; + return { + kind: Kind.DOCUMENT, + definitions: many(lexer, TokenKind.SOF, parseDefinition, TokenKind.EOF), + loc: loc(lexer, start), + }; +} + +/** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + */ +function parseDefinition(lexer: Lexer<*>): DefinitionNode { + if (peek(lexer, TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + case 'fragment': + return parseExecutableDefinition(lexer); + case 'schema': + case 'scalar': + case 'type': + case 'interface': + case 'union': + case 'enum': + case 'input': + case 'directive': + return parseTypeSystemDefinition(lexer); + case 'extend': + return parseTypeSystemExtension(lexer); + } + } else if (peek(lexer, TokenKind.BRACE_L)) { + return parseExecutableDefinition(lexer); + } else if (peekDescription(lexer)) { + return parseTypeSystemDefinition(lexer); + } + + throw unexpected(lexer); +} + +/** + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + */ +function parseExecutableDefinition(lexer: Lexer<*>): ExecutableDefinitionNode { + if (peek(lexer, TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + return parseOperationDefinition(lexer); + + case 'fragment': + return parseFragmentDefinition(lexer); + } + } else if (peek(lexer, TokenKind.BRACE_L)) { + return parseOperationDefinition(lexer); + } + + throw unexpected(lexer); +} + +// Implements the parsing rules in the Operations section. + +/** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + */ +function parseOperationDefinition(lexer: Lexer<*>): OperationDefinitionNode { + const start = lexer.token; + if (peek(lexer, TokenKind.BRACE_L)) { + return { + kind: Kind.OPERATION_DEFINITION, + operation: 'query', + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start), + }; + } + const operation = parseOperationType(lexer); + let name; + if (peek(lexer, TokenKind.NAME)) { + name = parseName(lexer); + } + return { + kind: Kind.OPERATION_DEFINITION, + operation, + name, + variableDefinitions: parseVariableDefinitions(lexer), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start), + }; +} + +/** + * OperationType : one of query mutation subscription + */ +function parseOperationType(lexer: Lexer<*>): OperationTypeNode { + const operationToken = expectToken(lexer, TokenKind.NAME); + switch (operationToken.value) { + case 'query': + return 'query'; + case 'mutation': + return 'mutation'; + case 'subscription': + return 'subscription'; + } + + throw unexpected(lexer, operationToken); +} + +/** + * VariableDefinitions : ( VariableDefinition+ ) + */ +function parseVariableDefinitions( + lexer: Lexer<*>, +): Array { + return peek(lexer, TokenKind.PAREN_L) + ? many(lexer, TokenKind.PAREN_L, parseVariableDefinition, TokenKind.PAREN_R) + : []; +} + +/** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + */ +function parseVariableDefinition(lexer: Lexer<*>): VariableDefinitionNode { + const start = lexer.token; + return { + kind: Kind.VARIABLE_DEFINITION, + variable: parseVariable(lexer), + type: (expectToken(lexer, TokenKind.COLON), parseTypeReference(lexer)), + defaultValue: expectOptionalToken(lexer, TokenKind.EQUALS) + ? parseValueLiteral(lexer, true) + : undefined, + directives: parseDirectives(lexer, true), + loc: loc(lexer, start), + }; +} + +/** + * Variable : $ Name + */ +function parseVariable(lexer: Lexer<*>): VariableNode { + const start = lexer.token; + expectToken(lexer, TokenKind.DOLLAR); + return { + kind: Kind.VARIABLE, + name: parseName(lexer), + loc: loc(lexer, start), + }; +} + +/** + * SelectionSet : { Selection+ } + */ +function parseSelectionSet(lexer: Lexer<*>): SelectionSetNode { + const start = lexer.token; + return { + kind: Kind.SELECTION_SET, + selections: many( + lexer, + TokenKind.BRACE_L, + parseSelection, + TokenKind.BRACE_R, + ), + loc: loc(lexer, start), + }; +} + +/** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ +function parseSelection(lexer: Lexer<*>): SelectionNode { + return peek(lexer, TokenKind.SPREAD) + ? parseFragment(lexer) + : parseField(lexer); +} + +/** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + */ +function parseField(lexer: Lexer<*>): FieldNode { + const start = lexer.token; + + const nameOrAlias = parseName(lexer); + let alias; + let name; + if (expectOptionalToken(lexer, TokenKind.COLON)) { + alias = nameOrAlias; + name = parseName(lexer); + } else { + name = nameOrAlias; + } + + return { + kind: Kind.FIELD, + alias, + name, + arguments: parseArguments(lexer, false), + directives: parseDirectives(lexer, false), + selectionSet: peek(lexer, TokenKind.BRACE_L) + ? parseSelectionSet(lexer) + : undefined, + loc: loc(lexer, start), + }; +} + +/** + * Arguments[Const] : ( Argument[?Const]+ ) + */ +function parseArguments( + lexer: Lexer<*>, + isConst: boolean, +): Array { + const item = isConst ? parseConstArgument : parseArgument; + return peek(lexer, TokenKind.PAREN_L) + ? many(lexer, TokenKind.PAREN_L, item, TokenKind.PAREN_R) + : []; +} + +/** + * Argument[Const] : Name : Value[?Const] + */ +function parseArgument(lexer: Lexer<*>): ArgumentNode { + const start = lexer.token; + const name = parseName(lexer); + + expectToken(lexer, TokenKind.COLON); + return { + kind: Kind.ARGUMENT, + name, + value: parseValueLiteral(lexer, false), + loc: loc(lexer, start), + }; +} + +function parseConstArgument(lexer: Lexer<*>): ArgumentNode { + const start = lexer.token; + return { + kind: Kind.ARGUMENT, + name: parseName(lexer), + value: (expectToken(lexer, TokenKind.COLON), parseConstValue(lexer)), + loc: loc(lexer, start), + }; +} + +// Implements the parsing rules in the Fragments section. + +/** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + */ +function parseFragment( + lexer: Lexer<*>, +): FragmentSpreadNode | InlineFragmentNode { + const start = lexer.token; + expectToken(lexer, TokenKind.SPREAD); + + const hasTypeCondition = expectOptionalKeyword(lexer, 'on'); + if (!hasTypeCondition && peek(lexer, TokenKind.NAME)) { + return { + kind: Kind.FRAGMENT_SPREAD, + name: parseFragmentName(lexer), + directives: parseDirectives(lexer, false), + loc: loc(lexer, start), + }; + } + return { + kind: Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? parseNamedType(lexer) : undefined, + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start), + }; +} + +/** + * FragmentDefinition : + * - fragment FragmentName on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + */ +function parseFragmentDefinition(lexer: Lexer<*>): FragmentDefinitionNode { + const start = lexer.token; + expectKeyword(lexer, 'fragment'); + // Experimental support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + if (lexer.options.experimentalFragmentVariables) { + return { + kind: Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + variableDefinitions: parseVariableDefinitions(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start), + }; + } + return { + kind: Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start), + }; +} + +/** + * FragmentName : Name but not `on` + */ +function parseFragmentName(lexer: Lexer<*>): NameNode { + if (lexer.token.value === 'on') { + throw unexpected(lexer); + } + return parseName(lexer); +} + +// Implements the parsing rules in the Values section. + +/** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + */ +function parseValueLiteral(lexer: Lexer<*>, isConst: boolean): ValueNode { + const token = lexer.token; + switch (token.kind) { + case TokenKind.BRACKET_L: + return parseList(lexer, isConst); + case TokenKind.BRACE_L: + return parseObject(lexer, isConst); + case TokenKind.INT: + lexer.advance(); + return { + kind: Kind.INT, + value: ((token.value: any): string), + loc: loc(lexer, token), + }; + case TokenKind.FLOAT: + lexer.advance(); + return { + kind: Kind.FLOAT, + value: ((token.value: any): string), + loc: loc(lexer, token), + }; + case TokenKind.STRING: + case TokenKind.BLOCK_STRING: + return parseStringLiteral(lexer); + case TokenKind.NAME: + if (token.value === 'true' || token.value === 'false') { + lexer.advance(); + return { + kind: Kind.BOOLEAN, + value: token.value === 'true', + loc: loc(lexer, token), + }; + } else if (token.value === 'null') { + lexer.advance(); + return { + kind: Kind.NULL, + loc: loc(lexer, token), + }; + } + lexer.advance(); + return { + kind: Kind.ENUM, + value: ((token.value: any): string), + loc: loc(lexer, token), + }; + case TokenKind.DOLLAR: + if (!isConst) { + return parseVariable(lexer); + } + break; + } + throw unexpected(lexer); +} + +function parseStringLiteral(lexer: Lexer<*>): StringValueNode { + const token = lexer.token; + lexer.advance(); + return { + kind: Kind.STRING, + value: ((token.value: any): string), + block: token.kind === TokenKind.BLOCK_STRING, + loc: loc(lexer, token), + }; +} + +export function parseConstValue(lexer: Lexer<*>): ValueNode { + return parseValueLiteral(lexer, true); +} + +function parseValueValue(lexer: Lexer<*>): ValueNode { + return parseValueLiteral(lexer, false); +} + +/** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + */ +function parseList(lexer: Lexer<*>, isConst: boolean): ListValueNode { + const start = lexer.token; + const item = isConst ? parseConstValue : parseValueValue; + return { + kind: Kind.LIST, + values: any(lexer, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), + loc: loc(lexer, start), + }; +} + +/** + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + */ +function parseObject(lexer: Lexer<*>, isConst: boolean): ObjectValueNode { + const start = lexer.token; + const item = () => parseObjectField(lexer, isConst); + return { + kind: Kind.OBJECT, + fields: any(lexer, TokenKind.BRACE_L, item, TokenKind.BRACE_R), + loc: loc(lexer, start), + }; +} + +/** + * ObjectField[Const] : Name : Value[?Const] + */ +function parseObjectField(lexer: Lexer<*>, isConst: boolean): ObjectFieldNode { + const start = lexer.token; + const name = parseName(lexer); + expectToken(lexer, TokenKind.COLON); + + return { + kind: Kind.OBJECT_FIELD, + name, + value: parseValueLiteral(lexer, isConst), + loc: loc(lexer, start), + }; +} + +// Implements the parsing rules in the Directives section. + +/** + * Directives[Const] : Directive[?Const]+ + */ +function parseDirectives( + lexer: Lexer<*>, + isConst: boolean, +): Array { + const directives = []; + while (peek(lexer, TokenKind.AT)) { + directives.push(parseDirective(lexer, isConst)); + } + return directives; +} + +/** + * Directive[Const] : @ Name Arguments[?Const]? + */ +function parseDirective(lexer: Lexer<*>, isConst: boolean): DirectiveNode { + const start = lexer.token; + expectToken(lexer, TokenKind.AT); + return { + kind: Kind.DIRECTIVE, + name: parseName(lexer), + arguments: parseArguments(lexer, isConst), + loc: loc(lexer, start), + }; +} + +// Implements the parsing rules in the Types section. + +/** + * Type : + * - NamedType + * - ListType + * - NonNullType + */ +export function parseTypeReference(lexer: Lexer<*>): TypeNode { + const start = lexer.token; + let type; + if (expectOptionalToken(lexer, TokenKind.BRACKET_L)) { + type = parseTypeReference(lexer); + expectToken(lexer, TokenKind.BRACKET_R); + type = ({ + kind: Kind.LIST_TYPE, + type, + loc: loc(lexer, start), + }: ListTypeNode); + } else { + type = parseNamedType(lexer); + } + if (expectOptionalToken(lexer, TokenKind.BANG)) { + return ({ + kind: Kind.NON_NULL_TYPE, + type, + loc: loc(lexer, start), + }: NonNullTypeNode); + } + return type; +} + +/** + * NamedType : Name + */ +export function parseNamedType(lexer: Lexer<*>): NamedTypeNode { + const start = lexer.token; + return { + kind: Kind.NAMED_TYPE, + name: parseName(lexer), + loc: loc(lexer, start), + }; +} + +// Implements the parsing rules in the Type Definition section. + +/** + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + */ +function parseTypeSystemDefinition(lexer: Lexer<*>): TypeSystemDefinitionNode { + // Many definitions begin with a description and require a lookahead. + const keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token; + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaDefinition(lexer); + case 'scalar': + return parseScalarTypeDefinition(lexer); + case 'type': + return parseObjectTypeDefinition(lexer); + case 'interface': + return parseInterfaceTypeDefinition(lexer); + case 'union': + return parseUnionTypeDefinition(lexer); + case 'enum': + return parseEnumTypeDefinition(lexer); + case 'input': + return parseInputObjectTypeDefinition(lexer); + case 'directive': + return parseDirectiveDefinition(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} + +function peekDescription(lexer: Lexer<*>): boolean { + return peek(lexer, TokenKind.STRING) || peek(lexer, TokenKind.BLOCK_STRING); +} + +/** + * Description : StringValue + */ +function parseDescription(lexer: Lexer<*>): void | StringValueNode { + if (peekDescription(lexer)) { + return parseStringLiteral(lexer); + } +} + +/** + * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ } + */ +function parseSchemaDefinition(lexer: Lexer<*>): SchemaDefinitionNode { + const start = lexer.token; + expectKeyword(lexer, 'schema'); + const directives = parseDirectives(lexer, true); + const operationTypes = many( + lexer, + TokenKind.BRACE_L, + parseOperationTypeDefinition, + TokenKind.BRACE_R, + ); + return { + kind: Kind.SCHEMA_DEFINITION, + directives, + operationTypes, + loc: loc(lexer, start), + }; +} + +/** + * OperationTypeDefinition : OperationType : NamedType + */ +function parseOperationTypeDefinition( + lexer: Lexer<*>, +): OperationTypeDefinitionNode { + const start = lexer.token; + const operation = parseOperationType(lexer); + expectToken(lexer, TokenKind.COLON); + const type = parseNamedType(lexer); + return { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation, + type, + loc: loc(lexer, start), + }; +} + +/** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + */ +function parseScalarTypeDefinition(lexer: Lexer<*>): ScalarTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'scalar'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + return { + kind: Kind.SCALAR_TYPE_DEFINITION, + description, + name, + directives, + loc: loc(lexer, start), + }; +} + +/** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + */ +function parseObjectTypeDefinition(lexer: Lexer<*>): ObjectTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'type'); + const name = parseName(lexer); + const interfaces = parseImplementsInterfaces(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseFieldsDefinition(lexer); + return { + kind: Kind.OBJECT_TYPE_DEFINITION, + description, + name, + interfaces, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ +function parseImplementsInterfaces(lexer: Lexer<*>): Array { + const types = []; + if (expectOptionalKeyword(lexer, 'implements')) { + // Optional leading ampersand + expectOptionalToken(lexer, TokenKind.AMP); + do { + types.push(parseNamedType(lexer)); + } while ( + expectOptionalToken(lexer, TokenKind.AMP) || + // Legacy support for the SDL? + (lexer.options.allowLegacySDLImplementsInterfaces && + peek(lexer, TokenKind.NAME)) + ); + } + return types; +} + +/** + * FieldsDefinition : { FieldDefinition+ } + */ +function parseFieldsDefinition(lexer: Lexer<*>): Array { + // Legacy support for the SDL? + if ( + lexer.options.allowLegacySDLEmptyFields && + peek(lexer, TokenKind.BRACE_L) && + lexer.lookahead().kind === TokenKind.BRACE_R + ) { + lexer.advance(); + lexer.advance(); + return []; + } + return peek(lexer, TokenKind.BRACE_L) + ? many(lexer, TokenKind.BRACE_L, parseFieldDefinition, TokenKind.BRACE_R) + : []; +} + +/** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + */ +function parseFieldDefinition(lexer: Lexer<*>): FieldDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + const name = parseName(lexer); + const args = parseArgumentDefs(lexer); + expectToken(lexer, TokenKind.COLON); + const type = parseTypeReference(lexer); + const directives = parseDirectives(lexer, true); + return { + kind: Kind.FIELD_DEFINITION, + description, + name, + arguments: args, + type, + directives, + loc: loc(lexer, start), + }; +} + +/** + * ArgumentsDefinition : ( InputValueDefinition+ ) + */ +function parseArgumentDefs(lexer: Lexer<*>): Array { + if (!peek(lexer, TokenKind.PAREN_L)) { + return []; + } + return many(lexer, TokenKind.PAREN_L, parseInputValueDef, TokenKind.PAREN_R); +} + +/** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + */ +function parseInputValueDef(lexer: Lexer<*>): InputValueDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + const name = parseName(lexer); + expectToken(lexer, TokenKind.COLON); + const type = parseTypeReference(lexer); + let defaultValue; + if (expectOptionalToken(lexer, TokenKind.EQUALS)) { + defaultValue = parseConstValue(lexer); + } + const directives = parseDirectives(lexer, true); + return { + kind: Kind.INPUT_VALUE_DEFINITION, + description, + name, + type, + defaultValue, + directives, + loc: loc(lexer, start), + }; +} + +/** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + */ +function parseInterfaceTypeDefinition( + lexer: Lexer<*>, +): InterfaceTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'interface'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseFieldsDefinition(lexer); + return { + kind: Kind.INTERFACE_TYPE_DEFINITION, + description, + name, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + */ +function parseUnionTypeDefinition(lexer: Lexer<*>): UnionTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'union'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const types = parseUnionMemberTypes(lexer); + return { + kind: Kind.UNION_TYPE_DEFINITION, + description, + name, + directives, + types, + loc: loc(lexer, start), + }; +} + +/** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ +function parseUnionMemberTypes(lexer: Lexer<*>): Array { + const types = []; + if (expectOptionalToken(lexer, TokenKind.EQUALS)) { + // Optional leading pipe + expectOptionalToken(lexer, TokenKind.PIPE); + do { + types.push(parseNamedType(lexer)); + } while (expectOptionalToken(lexer, TokenKind.PIPE)); + } + return types; +} + +/** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + */ +function parseEnumTypeDefinition(lexer: Lexer<*>): EnumTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'enum'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const values = parseEnumValuesDefinition(lexer); + return { + kind: Kind.ENUM_TYPE_DEFINITION, + description, + name, + directives, + values, + loc: loc(lexer, start), + }; +} + +/** + * EnumValuesDefinition : { EnumValueDefinition+ } + */ +function parseEnumValuesDefinition( + lexer: Lexer<*>, +): Array { + return peek(lexer, TokenKind.BRACE_L) + ? many( + lexer, + TokenKind.BRACE_L, + parseEnumValueDefinition, + TokenKind.BRACE_R, + ) + : []; +} + +/** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + * + * EnumValue : Name + */ +function parseEnumValueDefinition(lexer: Lexer<*>): EnumValueDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + return { + kind: Kind.ENUM_VALUE_DEFINITION, + description, + name, + directives, + loc: loc(lexer, start), + }; +} + +/** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + */ +function parseInputObjectTypeDefinition( + lexer: Lexer<*>, +): InputObjectTypeDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'input'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseInputFieldsDefinition(lexer); + return { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + description, + name, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * InputFieldsDefinition : { InputValueDefinition+ } + */ +function parseInputFieldsDefinition( + lexer: Lexer<*>, +): Array { + return peek(lexer, TokenKind.BRACE_L) + ? many(lexer, TokenKind.BRACE_L, parseInputValueDef, TokenKind.BRACE_R) + : []; +} + +/** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + */ +function parseTypeSystemExtension(lexer: Lexer<*>): TypeSystemExtensionNode { + const keywordToken = lexer.lookahead(); + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaExtension(lexer); + case 'scalar': + return parseScalarTypeExtension(lexer); + case 'type': + return parseObjectTypeExtension(lexer); + case 'interface': + return parseInterfaceTypeExtension(lexer); + case 'union': + return parseUnionTypeExtension(lexer); + case 'enum': + return parseEnumTypeExtension(lexer); + case 'input': + return parseInputObjectTypeExtension(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} + +/** + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + */ +function parseSchemaExtension(lexer: Lexer<*>): SchemaExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'schema'); + const directives = parseDirectives(lexer, true); + const operationTypes = peek(lexer, TokenKind.BRACE_L) + ? many( + lexer, + TokenKind.BRACE_L, + parseOperationTypeDefinition, + TokenKind.BRACE_R, + ) + : []; + if (directives.length === 0 && operationTypes.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.SCHEMA_EXTENSION, + directives, + operationTypes, + loc: loc(lexer, start), + }; +} + +/** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + */ +function parseScalarTypeExtension(lexer: Lexer<*>): ScalarTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'scalar'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + if (directives.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.SCALAR_TYPE_EXTENSION, + name, + directives, + loc: loc(lexer, start), + }; +} + +/** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + */ +function parseObjectTypeExtension(lexer: Lexer<*>): ObjectTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'type'); + const name = parseName(lexer); + const interfaces = parseImplementsInterfaces(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseFieldsDefinition(lexer); + if ( + interfaces.length === 0 && + directives.length === 0 && + fields.length === 0 + ) { + throw unexpected(lexer); + } + return { + kind: Kind.OBJECT_TYPE_EXTENSION, + name, + interfaces, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * InterfaceTypeExtension : + * - extend interface Name Directives[Const]? FieldsDefinition + * - extend interface Name Directives[Const] + */ +function parseInterfaceTypeExtension( + lexer: Lexer<*>, +): InterfaceTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'interface'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseFieldsDefinition(lexer); + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.INTERFACE_TYPE_EXTENSION, + name, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + */ +function parseUnionTypeExtension(lexer: Lexer<*>): UnionTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'union'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const types = parseUnionMemberTypes(lexer); + if (directives.length === 0 && types.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.UNION_TYPE_EXTENSION, + name, + directives, + types, + loc: loc(lexer, start), + }; +} + +/** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + */ +function parseEnumTypeExtension(lexer: Lexer<*>): EnumTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'enum'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const values = parseEnumValuesDefinition(lexer); + if (directives.length === 0 && values.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.ENUM_TYPE_EXTENSION, + name, + directives, + values, + loc: loc(lexer, start), + }; +} + +/** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + */ +function parseInputObjectTypeExtension( + lexer: Lexer<*>, +): InputObjectTypeExtensionNode { + const start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'input'); + const name = parseName(lexer); + const directives = parseDirectives(lexer, true); + const fields = parseInputFieldsDefinition(lexer); + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + return { + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, + name, + directives, + fields, + loc: loc(lexer, start), + }; +} + +/** + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + */ +function parseDirectiveDefinition(lexer: Lexer<*>): DirectiveDefinitionNode { + const start = lexer.token; + const description = parseDescription(lexer); + expectKeyword(lexer, 'directive'); + expectToken(lexer, TokenKind.AT); + const name = parseName(lexer); + const args = parseArgumentDefs(lexer); + const repeatable = expectOptionalKeyword(lexer, 'repeatable'); + expectKeyword(lexer, 'on'); + const locations = parseDirectiveLocations(lexer); + return { + kind: Kind.DIRECTIVE_DEFINITION, + description, + name, + arguments: args, + repeatable, + locations, + loc: loc(lexer, start), + }; +} + +/** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + */ +function parseDirectiveLocations(lexer: Lexer<*>): Array { + // Optional leading pipe + expectOptionalToken(lexer, TokenKind.PIPE); + const locations = []; + do { + locations.push(parseDirectiveLocation(lexer)); + } while (expectOptionalToken(lexer, TokenKind.PIPE)); + return locations; +} + +/* + * DirectiveLocation : + * - ExecutableDirectiveLocation + * - TypeSystemDirectiveLocation + * + * ExecutableDirectiveLocation : one of + * `QUERY` + * `MUTATION` + * `SUBSCRIPTION` + * `FIELD` + * `FRAGMENT_DEFINITION` + * `FRAGMENT_SPREAD` + * `INLINE_FRAGMENT` + * + * TypeSystemDirectiveLocation : one of + * `SCHEMA` + * `SCALAR` + * `OBJECT` + * `FIELD_DEFINITION` + * `ARGUMENT_DEFINITION` + * `INTERFACE` + * `UNION` + * `ENUM` + * `ENUM_VALUE` + * `INPUT_OBJECT` + * `INPUT_FIELD_DEFINITION` + */ +function parseDirectiveLocation(lexer: Lexer<*>): NameNode { + const start = lexer.token; + const name = parseName(lexer); + if (DirectiveLocation[name.value] !== undefined) { + return name; + } + throw unexpected(lexer, start); +} + +// Core parsing utility functions + +/** + * Returns a location object, used to identify the place in + * the source that created a given parsed object. + */ +function loc(lexer: Lexer<*>, startToken: Token): Location | void { + if (!lexer.options.noLocation) { + return new Loc(startToken, lexer.lastToken, lexer.source); + } +} + +function Loc(startToken: Token, endToken: Token, source: Source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; +} + +// Print a simplified form when appearing in JSON/util.inspect. +defineToJSON(Loc, function() { + return { start: this.start, end: this.end }; +}); + +/** + * Determines if the next token is of a given kind + */ +function peek(lexer: Lexer<*>, kind: TokenKindEnum): boolean { + return lexer.token.kind === kind; +} + +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and throw an error. + */ +function expectToken(lexer: Lexer<*>, kind: TokenKindEnum): Token { + const token = lexer.token; + if (token.kind === kind) { + lexer.advance(); + return token; + } + + throw syntaxError( + lexer.source, + token.start, + `Expected ${kind}, found ${getTokenDesc(token)}`, + ); +} + +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and return undefined. + */ +function expectOptionalToken(lexer: Lexer<*>, kind: TokenKindEnum): ?Token { + const token = lexer.token; + if (token.kind === kind) { + lexer.advance(); + return token; + } + return undefined; +} + +/** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + */ +function expectKeyword(lexer: Lexer<*>, value: string) { + const token = lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + lexer.advance(); + } else { + throw syntaxError( + lexer.source, + token.start, + `Expected "${value}", found ${getTokenDesc(token)}`, + ); + } +} + +/** + * If the next token is a given keyword, return "true" after advancing + * the lexer. Otherwise, do not change the parser state and return "false". + */ +function expectOptionalKeyword(lexer: Lexer<*>, value: string): boolean { + const token = lexer.token; + if (token.kind === TokenKind.NAME && token.value === value) { + lexer.advance(); + return true; + } + return false; +} + +/** + * Helper function for creating an error when an unexpected lexed token + * is encountered. + */ +function unexpected(lexer: Lexer<*>, atToken?: ?Token): GraphQLError { + const token = atToken || lexer.token; + return syntaxError( + lexer.source, + token.start, + `Unexpected ${getTokenDesc(token)}`, + ); +} + +/** + * Returns a possibly empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ +function any( + lexer: Lexer<*>, + openKind: TokenKindEnum, + parseFn: (lexer: Lexer<*>) => T, + closeKind: TokenKindEnum, +): Array { + expectToken(lexer, openKind); + const nodes = []; + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + return nodes; +} + +/** + * Returns a non-empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ +function many( + lexer: Lexer<*>, + openKind: TokenKindEnum, + parseFn: (lexer: Lexer<*>) => T, + closeKind: TokenKindEnum, +): Array { + expectToken(lexer, openKind); + const nodes = [parseFn(lexer)]; + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + return nodes; +} diff --git a/node_modules/graphql/language/parser.mjs b/node_modules/graphql/language/parser.mjs new file mode 100644 index 000000000..93c87e56f --- /dev/null +++ b/node_modules/graphql/language/parser.mjs @@ -0,0 +1,1499 @@ +import inspect from '../jsutils/inspect'; +import defineToJSON from '../jsutils/defineToJSON'; +import { Source } from './source'; +import { syntaxError } from '../error/syntaxError'; +import { TokenKind } from './tokenKind'; +import { getTokenDesc, createLexer } from './lexer'; +import { Kind } from './kinds'; +import { DirectiveLocation } from './directiveLocation'; +/** + * Configuration options to control parser behavior + */ + +/** + * Given a GraphQL source, parses it into a Document. + * Throws GraphQLError if a syntax error is encountered. + */ +export function parse(source, options) { + var sourceObj = typeof source === 'string' ? new Source(source) : source; + + if (!(sourceObj instanceof Source)) { + throw new TypeError("Must provide Source. Received: ".concat(inspect(sourceObj))); + } + + var lexer = createLexer(sourceObj, options || {}); + return parseDocument(lexer); +} +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: valueFromAST(). + */ + +export function parseValue(source, options) { + var sourceObj = typeof source === 'string' ? new Source(source) : source; + var lexer = createLexer(sourceObj, options || {}); + expectToken(lexer, TokenKind.SOF); + var value = parseValueLiteral(lexer, false); + expectToken(lexer, TokenKind.EOF); + return value; +} +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws GraphQLError if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: typeFromAST(). + */ + +export function parseType(source, options) { + var sourceObj = typeof source === 'string' ? new Source(source) : source; + var lexer = createLexer(sourceObj, options || {}); + expectToken(lexer, TokenKind.SOF); + var type = parseTypeReference(lexer); + expectToken(lexer, TokenKind.EOF); + return type; +} +/** + * Converts a name lex token into a name parse node. + */ + +function parseName(lexer) { + var token = expectToken(lexer, TokenKind.NAME); + return { + kind: Kind.NAME, + value: token.value, + loc: loc(lexer, token) + }; +} // Implements the parsing rules in the Document section. + +/** + * Document : Definition+ + */ + + +function parseDocument(lexer) { + var start = lexer.token; + return { + kind: Kind.DOCUMENT, + definitions: many(lexer, TokenKind.SOF, parseDefinition, TokenKind.EOF), + loc: loc(lexer, start) + }; +} +/** + * Definition : + * - ExecutableDefinition + * - TypeSystemDefinition + * - TypeSystemExtension + */ + + +function parseDefinition(lexer) { + if (peek(lexer, TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + case 'fragment': + return parseExecutableDefinition(lexer); + + case 'schema': + case 'scalar': + case 'type': + case 'interface': + case 'union': + case 'enum': + case 'input': + case 'directive': + return parseTypeSystemDefinition(lexer); + + case 'extend': + return parseTypeSystemExtension(lexer); + } + } else if (peek(lexer, TokenKind.BRACE_L)) { + return parseExecutableDefinition(lexer); + } else if (peekDescription(lexer)) { + return parseTypeSystemDefinition(lexer); + } + + throw unexpected(lexer); +} +/** + * ExecutableDefinition : + * - OperationDefinition + * - FragmentDefinition + */ + + +function parseExecutableDefinition(lexer) { + if (peek(lexer, TokenKind.NAME)) { + switch (lexer.token.value) { + case 'query': + case 'mutation': + case 'subscription': + return parseOperationDefinition(lexer); + + case 'fragment': + return parseFragmentDefinition(lexer); + } + } else if (peek(lexer, TokenKind.BRACE_L)) { + return parseOperationDefinition(lexer); + } + + throw unexpected(lexer); +} // Implements the parsing rules in the Operations section. + +/** + * OperationDefinition : + * - SelectionSet + * - OperationType Name? VariableDefinitions? Directives? SelectionSet + */ + + +function parseOperationDefinition(lexer) { + var start = lexer.token; + + if (peek(lexer, TokenKind.BRACE_L)) { + return { + kind: Kind.OPERATION_DEFINITION, + operation: 'query', + name: undefined, + variableDefinitions: [], + directives: [], + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; + } + + var operation = parseOperationType(lexer); + var name; + + if (peek(lexer, TokenKind.NAME)) { + name = parseName(lexer); + } + + return { + kind: Kind.OPERATION_DEFINITION, + operation: operation, + name: name, + variableDefinitions: parseVariableDefinitions(lexer), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * OperationType : one of query mutation subscription + */ + + +function parseOperationType(lexer) { + var operationToken = expectToken(lexer, TokenKind.NAME); + + switch (operationToken.value) { + case 'query': + return 'query'; + + case 'mutation': + return 'mutation'; + + case 'subscription': + return 'subscription'; + } + + throw unexpected(lexer, operationToken); +} +/** + * VariableDefinitions : ( VariableDefinition+ ) + */ + + +function parseVariableDefinitions(lexer) { + return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, parseVariableDefinition, TokenKind.PAREN_R) : []; +} +/** + * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? + */ + + +function parseVariableDefinition(lexer) { + var start = lexer.token; + return { + kind: Kind.VARIABLE_DEFINITION, + variable: parseVariable(lexer), + type: (expectToken(lexer, TokenKind.COLON), parseTypeReference(lexer)), + defaultValue: expectOptionalToken(lexer, TokenKind.EQUALS) ? parseValueLiteral(lexer, true) : undefined, + directives: parseDirectives(lexer, true), + loc: loc(lexer, start) + }; +} +/** + * Variable : $ Name + */ + + +function parseVariable(lexer) { + var start = lexer.token; + expectToken(lexer, TokenKind.DOLLAR); + return { + kind: Kind.VARIABLE, + name: parseName(lexer), + loc: loc(lexer, start) + }; +} +/** + * SelectionSet : { Selection+ } + */ + + +function parseSelectionSet(lexer) { + var start = lexer.token; + return { + kind: Kind.SELECTION_SET, + selections: many(lexer, TokenKind.BRACE_L, parseSelection, TokenKind.BRACE_R), + loc: loc(lexer, start) + }; +} +/** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ + + +function parseSelection(lexer) { + return peek(lexer, TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer); +} +/** + * Field : Alias? Name Arguments? Directives? SelectionSet? + * + * Alias : Name : + */ + + +function parseField(lexer) { + var start = lexer.token; + var nameOrAlias = parseName(lexer); + var alias; + var name; + + if (expectOptionalToken(lexer, TokenKind.COLON)) { + alias = nameOrAlias; + name = parseName(lexer); + } else { + name = nameOrAlias; + } + + return { + kind: Kind.FIELD, + alias: alias, + name: name, + arguments: parseArguments(lexer, false), + directives: parseDirectives(lexer, false), + selectionSet: peek(lexer, TokenKind.BRACE_L) ? parseSelectionSet(lexer) : undefined, + loc: loc(lexer, start) + }; +} +/** + * Arguments[Const] : ( Argument[?Const]+ ) + */ + + +function parseArguments(lexer, isConst) { + var item = isConst ? parseConstArgument : parseArgument; + return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, item, TokenKind.PAREN_R) : []; +} +/** + * Argument[Const] : Name : Value[?Const] + */ + + +function parseArgument(lexer) { + var start = lexer.token; + var name = parseName(lexer); + expectToken(lexer, TokenKind.COLON); + return { + kind: Kind.ARGUMENT, + name: name, + value: parseValueLiteral(lexer, false), + loc: loc(lexer, start) + }; +} + +function parseConstArgument(lexer) { + var start = lexer.token; + return { + kind: Kind.ARGUMENT, + name: parseName(lexer), + value: (expectToken(lexer, TokenKind.COLON), parseConstValue(lexer)), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Fragments section. + +/** + * Corresponds to both FragmentSpread and InlineFragment in the spec. + * + * FragmentSpread : ... FragmentName Directives? + * + * InlineFragment : ... TypeCondition? Directives? SelectionSet + */ + + +function parseFragment(lexer) { + var start = lexer.token; + expectToken(lexer, TokenKind.SPREAD); + var hasTypeCondition = expectOptionalKeyword(lexer, 'on'); + + if (!hasTypeCondition && peek(lexer, TokenKind.NAME)) { + return { + kind: Kind.FRAGMENT_SPREAD, + name: parseFragmentName(lexer), + directives: parseDirectives(lexer, false), + loc: loc(lexer, start) + }; + } + + return { + kind: Kind.INLINE_FRAGMENT, + typeCondition: hasTypeCondition ? parseNamedType(lexer) : undefined, + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * FragmentDefinition : + * - fragment FragmentName on TypeCondition Directives? SelectionSet + * + * TypeCondition : NamedType + */ + + +function parseFragmentDefinition(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'fragment'); // Experimental support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + + if (lexer.options.experimentalFragmentVariables) { + return { + kind: Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + variableDefinitions: parseVariableDefinitions(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; + } + + return { + kind: Kind.FRAGMENT_DEFINITION, + name: parseFragmentName(lexer), + typeCondition: (expectKeyword(lexer, 'on'), parseNamedType(lexer)), + directives: parseDirectives(lexer, false), + selectionSet: parseSelectionSet(lexer), + loc: loc(lexer, start) + }; +} +/** + * FragmentName : Name but not `on` + */ + + +function parseFragmentName(lexer) { + if (lexer.token.value === 'on') { + throw unexpected(lexer); + } + + return parseName(lexer); +} // Implements the parsing rules in the Values section. + +/** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + */ + + +function parseValueLiteral(lexer, isConst) { + var token = lexer.token; + + switch (token.kind) { + case TokenKind.BRACKET_L: + return parseList(lexer, isConst); + + case TokenKind.BRACE_L: + return parseObject(lexer, isConst); + + case TokenKind.INT: + lexer.advance(); + return { + kind: Kind.INT, + value: token.value, + loc: loc(lexer, token) + }; + + case TokenKind.FLOAT: + lexer.advance(); + return { + kind: Kind.FLOAT, + value: token.value, + loc: loc(lexer, token) + }; + + case TokenKind.STRING: + case TokenKind.BLOCK_STRING: + return parseStringLiteral(lexer); + + case TokenKind.NAME: + if (token.value === 'true' || token.value === 'false') { + lexer.advance(); + return { + kind: Kind.BOOLEAN, + value: token.value === 'true', + loc: loc(lexer, token) + }; + } else if (token.value === 'null') { + lexer.advance(); + return { + kind: Kind.NULL, + loc: loc(lexer, token) + }; + } + + lexer.advance(); + return { + kind: Kind.ENUM, + value: token.value, + loc: loc(lexer, token) + }; + + case TokenKind.DOLLAR: + if (!isConst) { + return parseVariable(lexer); + } + + break; + } + + throw unexpected(lexer); +} + +function parseStringLiteral(lexer) { + var token = lexer.token; + lexer.advance(); + return { + kind: Kind.STRING, + value: token.value, + block: token.kind === TokenKind.BLOCK_STRING, + loc: loc(lexer, token) + }; +} + +export function parseConstValue(lexer) { + return parseValueLiteral(lexer, true); +} + +function parseValueValue(lexer) { + return parseValueLiteral(lexer, false); +} +/** + * ListValue[Const] : + * - [ ] + * - [ Value[?Const]+ ] + */ + + +function parseList(lexer, isConst) { + var start = lexer.token; + var item = isConst ? parseConstValue : parseValueValue; + return { + kind: Kind.LIST, + values: any(lexer, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), + loc: loc(lexer, start) + }; +} +/** + * ObjectValue[Const] : + * - { } + * - { ObjectField[?Const]+ } + */ + + +function parseObject(lexer, isConst) { + var start = lexer.token; + + var item = function item() { + return parseObjectField(lexer, isConst); + }; + + return { + kind: Kind.OBJECT, + fields: any(lexer, TokenKind.BRACE_L, item, TokenKind.BRACE_R), + loc: loc(lexer, start) + }; +} +/** + * ObjectField[Const] : Name : Value[?Const] + */ + + +function parseObjectField(lexer, isConst) { + var start = lexer.token; + var name = parseName(lexer); + expectToken(lexer, TokenKind.COLON); + return { + kind: Kind.OBJECT_FIELD, + name: name, + value: parseValueLiteral(lexer, isConst), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Directives section. + +/** + * Directives[Const] : Directive[?Const]+ + */ + + +function parseDirectives(lexer, isConst) { + var directives = []; + + while (peek(lexer, TokenKind.AT)) { + directives.push(parseDirective(lexer, isConst)); + } + + return directives; +} +/** + * Directive[Const] : @ Name Arguments[?Const]? + */ + + +function parseDirective(lexer, isConst) { + var start = lexer.token; + expectToken(lexer, TokenKind.AT); + return { + kind: Kind.DIRECTIVE, + name: parseName(lexer), + arguments: parseArguments(lexer, isConst), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Types section. + +/** + * Type : + * - NamedType + * - ListType + * - NonNullType + */ + + +export function parseTypeReference(lexer) { + var start = lexer.token; + var type; + + if (expectOptionalToken(lexer, TokenKind.BRACKET_L)) { + type = parseTypeReference(lexer); + expectToken(lexer, TokenKind.BRACKET_R); + type = { + kind: Kind.LIST_TYPE, + type: type, + loc: loc(lexer, start) + }; + } else { + type = parseNamedType(lexer); + } + + if (expectOptionalToken(lexer, TokenKind.BANG)) { + return { + kind: Kind.NON_NULL_TYPE, + type: type, + loc: loc(lexer, start) + }; + } + + return type; +} +/** + * NamedType : Name + */ + +export function parseNamedType(lexer) { + var start = lexer.token; + return { + kind: Kind.NAMED_TYPE, + name: parseName(lexer), + loc: loc(lexer, start) + }; +} // Implements the parsing rules in the Type Definition section. + +/** + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + */ + +function parseTypeSystemDefinition(lexer) { + // Many definitions begin with a description and require a lookahead. + var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token; + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaDefinition(lexer); + + case 'scalar': + return parseScalarTypeDefinition(lexer); + + case 'type': + return parseObjectTypeDefinition(lexer); + + case 'interface': + return parseInterfaceTypeDefinition(lexer); + + case 'union': + return parseUnionTypeDefinition(lexer); + + case 'enum': + return parseEnumTypeDefinition(lexer); + + case 'input': + return parseInputObjectTypeDefinition(lexer); + + case 'directive': + return parseDirectiveDefinition(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} + +function peekDescription(lexer) { + return peek(lexer, TokenKind.STRING) || peek(lexer, TokenKind.BLOCK_STRING); +} +/** + * Description : StringValue + */ + + +function parseDescription(lexer) { + if (peekDescription(lexer)) { + return parseStringLiteral(lexer); + } +} +/** + * SchemaDefinition : schema Directives[Const]? { OperationTypeDefinition+ } + */ + + +function parseSchemaDefinition(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'schema'); + var directives = parseDirectives(lexer, true); + var operationTypes = many(lexer, TokenKind.BRACE_L, parseOperationTypeDefinition, TokenKind.BRACE_R); + return { + kind: Kind.SCHEMA_DEFINITION, + directives: directives, + operationTypes: operationTypes, + loc: loc(lexer, start) + }; +} +/** + * OperationTypeDefinition : OperationType : NamedType + */ + + +function parseOperationTypeDefinition(lexer) { + var start = lexer.token; + var operation = parseOperationType(lexer); + expectToken(lexer, TokenKind.COLON); + var type = parseNamedType(lexer); + return { + kind: Kind.OPERATION_TYPE_DEFINITION, + operation: operation, + type: type, + loc: loc(lexer, start) + }; +} +/** + * ScalarTypeDefinition : Description? scalar Name Directives[Const]? + */ + + +function parseScalarTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'scalar'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: Kind.SCALAR_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ObjectTypeDefinition : + * Description? + * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? + */ + + +function parseObjectTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'type'); + var name = parseName(lexer); + var interfaces = parseImplementsInterfaces(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + return { + kind: Kind.OBJECT_TYPE_DEFINITION, + description: description, + name: name, + interfaces: interfaces, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ + + +function parseImplementsInterfaces(lexer) { + var types = []; + + if (expectOptionalKeyword(lexer, 'implements')) { + // Optional leading ampersand + expectOptionalToken(lexer, TokenKind.AMP); + + do { + types.push(parseNamedType(lexer)); + } while (expectOptionalToken(lexer, TokenKind.AMP) || // Legacy support for the SDL? + lexer.options.allowLegacySDLImplementsInterfaces && peek(lexer, TokenKind.NAME)); + } + + return types; +} +/** + * FieldsDefinition : { FieldDefinition+ } + */ + + +function parseFieldsDefinition(lexer) { + // Legacy support for the SDL? + if (lexer.options.allowLegacySDLEmptyFields && peek(lexer, TokenKind.BRACE_L) && lexer.lookahead().kind === TokenKind.BRACE_R) { + lexer.advance(); + lexer.advance(); + return []; + } + + return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseFieldDefinition, TokenKind.BRACE_R) : []; +} +/** + * FieldDefinition : + * - Description? Name ArgumentsDefinition? : Type Directives[Const]? + */ + + +function parseFieldDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + var args = parseArgumentDefs(lexer); + expectToken(lexer, TokenKind.COLON); + var type = parseTypeReference(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: Kind.FIELD_DEFINITION, + description: description, + name: name, + arguments: args, + type: type, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ArgumentsDefinition : ( InputValueDefinition+ ) + */ + + +function parseArgumentDefs(lexer) { + if (!peek(lexer, TokenKind.PAREN_L)) { + return []; + } + + return many(lexer, TokenKind.PAREN_L, parseInputValueDef, TokenKind.PAREN_R); +} +/** + * InputValueDefinition : + * - Description? Name : Type DefaultValue? Directives[Const]? + */ + + +function parseInputValueDef(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + expectToken(lexer, TokenKind.COLON); + var type = parseTypeReference(lexer); + var defaultValue; + + if (expectOptionalToken(lexer, TokenKind.EQUALS)) { + defaultValue = parseConstValue(lexer); + } + + var directives = parseDirectives(lexer, true); + return { + kind: Kind.INPUT_VALUE_DEFINITION, + description: description, + name: name, + type: type, + defaultValue: defaultValue, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * InterfaceTypeDefinition : + * - Description? interface Name Directives[Const]? FieldsDefinition? + */ + + +function parseInterfaceTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'interface'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + return { + kind: Kind.INTERFACE_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + */ + + +function parseUnionTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'union'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var types = parseUnionMemberTypes(lexer); + return { + kind: Kind.UNION_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + types: types, + loc: loc(lexer, start) + }; +} +/** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ + + +function parseUnionMemberTypes(lexer) { + var types = []; + + if (expectOptionalToken(lexer, TokenKind.EQUALS)) { + // Optional leading pipe + expectOptionalToken(lexer, TokenKind.PIPE); + + do { + types.push(parseNamedType(lexer)); + } while (expectOptionalToken(lexer, TokenKind.PIPE)); + } + + return types; +} +/** + * EnumTypeDefinition : + * - Description? enum Name Directives[Const]? EnumValuesDefinition? + */ + + +function parseEnumTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'enum'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var values = parseEnumValuesDefinition(lexer); + return { + kind: Kind.ENUM_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + values: values, + loc: loc(lexer, start) + }; +} +/** + * EnumValuesDefinition : { EnumValueDefinition+ } + */ + + +function parseEnumValuesDefinition(lexer) { + return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseEnumValueDefinition, TokenKind.BRACE_R) : []; +} +/** + * EnumValueDefinition : Description? EnumValue Directives[Const]? + * + * EnumValue : Name + */ + + +function parseEnumValueDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + return { + kind: Kind.ENUM_VALUE_DEFINITION, + description: description, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * InputObjectTypeDefinition : + * - Description? input Name Directives[Const]? InputFieldsDefinition? + */ + + +function parseInputObjectTypeDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'input'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseInputFieldsDefinition(lexer); + return { + kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, + description: description, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * InputFieldsDefinition : { InputValueDefinition+ } + */ + + +function parseInputFieldsDefinition(lexer) { + return peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseInputValueDef, TokenKind.BRACE_R) : []; +} +/** + * TypeSystemExtension : + * - SchemaExtension + * - TypeExtension + * + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + */ + + +function parseTypeSystemExtension(lexer) { + var keywordToken = lexer.lookahead(); + + if (keywordToken.kind === TokenKind.NAME) { + switch (keywordToken.value) { + case 'schema': + return parseSchemaExtension(lexer); + + case 'scalar': + return parseScalarTypeExtension(lexer); + + case 'type': + return parseObjectTypeExtension(lexer); + + case 'interface': + return parseInterfaceTypeExtension(lexer); + + case 'union': + return parseUnionTypeExtension(lexer); + + case 'enum': + return parseEnumTypeExtension(lexer); + + case 'input': + return parseInputObjectTypeExtension(lexer); + } + } + + throw unexpected(lexer, keywordToken); +} +/** + * SchemaExtension : + * - extend schema Directives[Const]? { OperationTypeDefinition+ } + * - extend schema Directives[Const] + */ + + +function parseSchemaExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'schema'); + var directives = parseDirectives(lexer, true); + var operationTypes = peek(lexer, TokenKind.BRACE_L) ? many(lexer, TokenKind.BRACE_L, parseOperationTypeDefinition, TokenKind.BRACE_R) : []; + + if (directives.length === 0 && operationTypes.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.SCHEMA_EXTENSION, + directives: directives, + operationTypes: operationTypes, + loc: loc(lexer, start) + }; +} +/** + * ScalarTypeExtension : + * - extend scalar Name Directives[Const] + */ + + +function parseScalarTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'scalar'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + + if (directives.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.SCALAR_TYPE_EXTENSION, + name: name, + directives: directives, + loc: loc(lexer, start) + }; +} +/** + * ObjectTypeExtension : + * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition + * - extend type Name ImplementsInterfaces? Directives[Const] + * - extend type Name ImplementsInterfaces + */ + + +function parseObjectTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'type'); + var name = parseName(lexer); + var interfaces = parseImplementsInterfaces(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + + if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.OBJECT_TYPE_EXTENSION, + name: name, + interfaces: interfaces, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * InterfaceTypeExtension : + * - extend interface Name Directives[Const]? FieldsDefinition + * - extend interface Name Directives[Const] + */ + + +function parseInterfaceTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'interface'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseFieldsDefinition(lexer); + + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.INTERFACE_TYPE_EXTENSION, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + */ + + +function parseUnionTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'union'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var types = parseUnionMemberTypes(lexer); + + if (directives.length === 0 && types.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.UNION_TYPE_EXTENSION, + name: name, + directives: directives, + types: types, + loc: loc(lexer, start) + }; +} +/** + * EnumTypeExtension : + * - extend enum Name Directives[Const]? EnumValuesDefinition + * - extend enum Name Directives[Const] + */ + + +function parseEnumTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'enum'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var values = parseEnumValuesDefinition(lexer); + + if (directives.length === 0 && values.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.ENUM_TYPE_EXTENSION, + name: name, + directives: directives, + values: values, + loc: loc(lexer, start) + }; +} +/** + * InputObjectTypeExtension : + * - extend input Name Directives[Const]? InputFieldsDefinition + * - extend input Name Directives[Const] + */ + + +function parseInputObjectTypeExtension(lexer) { + var start = lexer.token; + expectKeyword(lexer, 'extend'); + expectKeyword(lexer, 'input'); + var name = parseName(lexer); + var directives = parseDirectives(lexer, true); + var fields = parseInputFieldsDefinition(lexer); + + if (directives.length === 0 && fields.length === 0) { + throw unexpected(lexer); + } + + return { + kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, + name: name, + directives: directives, + fields: fields, + loc: loc(lexer, start) + }; +} +/** + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + */ + + +function parseDirectiveDefinition(lexer) { + var start = lexer.token; + var description = parseDescription(lexer); + expectKeyword(lexer, 'directive'); + expectToken(lexer, TokenKind.AT); + var name = parseName(lexer); + var args = parseArgumentDefs(lexer); + var repeatable = expectOptionalKeyword(lexer, 'repeatable'); + expectKeyword(lexer, 'on'); + var locations = parseDirectiveLocations(lexer); + return { + kind: Kind.DIRECTIVE_DEFINITION, + description: description, + name: name, + arguments: args, + repeatable: repeatable, + locations: locations, + loc: loc(lexer, start) + }; +} +/** + * DirectiveLocations : + * - `|`? DirectiveLocation + * - DirectiveLocations | DirectiveLocation + */ + + +function parseDirectiveLocations(lexer) { + // Optional leading pipe + expectOptionalToken(lexer, TokenKind.PIPE); + var locations = []; + + do { + locations.push(parseDirectiveLocation(lexer)); + } while (expectOptionalToken(lexer, TokenKind.PIPE)); + + return locations; +} +/* + * DirectiveLocation : + * - ExecutableDirectiveLocation + * - TypeSystemDirectiveLocation + * + * ExecutableDirectiveLocation : one of + * `QUERY` + * `MUTATION` + * `SUBSCRIPTION` + * `FIELD` + * `FRAGMENT_DEFINITION` + * `FRAGMENT_SPREAD` + * `INLINE_FRAGMENT` + * + * TypeSystemDirectiveLocation : one of + * `SCHEMA` + * `SCALAR` + * `OBJECT` + * `FIELD_DEFINITION` + * `ARGUMENT_DEFINITION` + * `INTERFACE` + * `UNION` + * `ENUM` + * `ENUM_VALUE` + * `INPUT_OBJECT` + * `INPUT_FIELD_DEFINITION` + */ + + +function parseDirectiveLocation(lexer) { + var start = lexer.token; + var name = parseName(lexer); + + if (DirectiveLocation[name.value] !== undefined) { + return name; + } + + throw unexpected(lexer, start); +} // Core parsing utility functions + +/** + * Returns a location object, used to identify the place in + * the source that created a given parsed object. + */ + + +function loc(lexer, startToken) { + if (!lexer.options.noLocation) { + return new Loc(startToken, lexer.lastToken, lexer.source); + } +} + +function Loc(startToken, endToken, source) { + this.start = startToken.start; + this.end = endToken.end; + this.startToken = startToken; + this.endToken = endToken; + this.source = source; +} // Print a simplified form when appearing in JSON/util.inspect. + + +defineToJSON(Loc, function () { + return { + start: this.start, + end: this.end + }; +}); +/** + * Determines if the next token is of a given kind + */ + +function peek(lexer, kind) { + return lexer.token.kind === kind; +} +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and throw an error. + */ + + +function expectToken(lexer, kind) { + var token = lexer.token; + + if (token.kind === kind) { + lexer.advance(); + return token; + } + + throw syntaxError(lexer.source, token.start, "Expected ".concat(kind, ", found ").concat(getTokenDesc(token))); +} +/** + * If the next token is of the given kind, return that token after advancing + * the lexer. Otherwise, do not change the parser state and return undefined. + */ + + +function expectOptionalToken(lexer, kind) { + var token = lexer.token; + + if (token.kind === kind) { + lexer.advance(); + return token; + } + + return undefined; +} +/** + * If the next token is a given keyword, advance the lexer. + * Otherwise, do not change the parser state and throw an error. + */ + + +function expectKeyword(lexer, value) { + var token = lexer.token; + + if (token.kind === TokenKind.NAME && token.value === value) { + lexer.advance(); + } else { + throw syntaxError(lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token))); + } +} +/** + * If the next token is a given keyword, return "true" after advancing + * the lexer. Otherwise, do not change the parser state and return "false". + */ + + +function expectOptionalKeyword(lexer, value) { + var token = lexer.token; + + if (token.kind === TokenKind.NAME && token.value === value) { + lexer.advance(); + return true; + } + + return false; +} +/** + * Helper function for creating an error when an unexpected lexed token + * is encountered. + */ + + +function unexpected(lexer, atToken) { + var token = atToken || lexer.token; + return syntaxError(lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token))); +} +/** + * Returns a possibly empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ + + +function any(lexer, openKind, parseFn, closeKind) { + expectToken(lexer, openKind); + var nodes = []; + + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + + return nodes; +} +/** + * Returns a non-empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + */ + + +function many(lexer, openKind, parseFn, closeKind) { + expectToken(lexer, openKind); + var nodes = [parseFn(lexer)]; + + while (!expectOptionalToken(lexer, closeKind)) { + nodes.push(parseFn(lexer)); + } + + return nodes; +} diff --git a/node_modules/graphql/language/predicates.js b/node_modules/graphql/language/predicates.js new file mode 100644 index 000000000..f17a94ccb --- /dev/null +++ b/node_modules/graphql/language/predicates.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isDefinitionNode = isDefinitionNode; +exports.isExecutableDefinitionNode = isExecutableDefinitionNode; +exports.isSelectionNode = isSelectionNode; +exports.isValueNode = isValueNode; +exports.isTypeNode = isTypeNode; +exports.isTypeSystemDefinitionNode = isTypeSystemDefinitionNode; +exports.isTypeDefinitionNode = isTypeDefinitionNode; +exports.isTypeSystemExtensionNode = isTypeSystemExtensionNode; +exports.isTypeExtensionNode = isTypeExtensionNode; + +var _kinds = require("./kinds"); + +function isDefinitionNode(node) { + return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); +} + +function isExecutableDefinitionNode(node) { + return node.kind === _kinds.Kind.OPERATION_DEFINITION || node.kind === _kinds.Kind.FRAGMENT_DEFINITION; +} + +function isSelectionNode(node) { + return node.kind === _kinds.Kind.FIELD || node.kind === _kinds.Kind.FRAGMENT_SPREAD || node.kind === _kinds.Kind.INLINE_FRAGMENT; +} + +function isValueNode(node) { + return node.kind === _kinds.Kind.VARIABLE || node.kind === _kinds.Kind.INT || node.kind === _kinds.Kind.FLOAT || node.kind === _kinds.Kind.STRING || node.kind === _kinds.Kind.BOOLEAN || node.kind === _kinds.Kind.NULL || node.kind === _kinds.Kind.ENUM || node.kind === _kinds.Kind.LIST || node.kind === _kinds.Kind.OBJECT; +} + +function isTypeNode(node) { + return node.kind === _kinds.Kind.NAMED_TYPE || node.kind === _kinds.Kind.LIST_TYPE || node.kind === _kinds.Kind.NON_NULL_TYPE; +} + +function isTypeSystemDefinitionNode(node) { + return node.kind === _kinds.Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === _kinds.Kind.DIRECTIVE_DEFINITION; +} + +function isTypeDefinitionNode(node) { + return node.kind === _kinds.Kind.SCALAR_TYPE_DEFINITION || node.kind === _kinds.Kind.OBJECT_TYPE_DEFINITION || node.kind === _kinds.Kind.INTERFACE_TYPE_DEFINITION || node.kind === _kinds.Kind.UNION_TYPE_DEFINITION || node.kind === _kinds.Kind.ENUM_TYPE_DEFINITION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION; +} + +function isTypeSystemExtensionNode(node) { + return node.kind === _kinds.Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +} + +function isTypeExtensionNode(node) { + return node.kind === _kinds.Kind.SCALAR_TYPE_EXTENSION || node.kind === _kinds.Kind.OBJECT_TYPE_EXTENSION || node.kind === _kinds.Kind.INTERFACE_TYPE_EXTENSION || node.kind === _kinds.Kind.UNION_TYPE_EXTENSION || node.kind === _kinds.Kind.ENUM_TYPE_EXTENSION || node.kind === _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; +} diff --git a/node_modules/graphql/language/predicates.js.flow b/node_modules/graphql/language/predicates.js.flow new file mode 100644 index 000000000..02583c6b8 --- /dev/null +++ b/node_modules/graphql/language/predicates.js.flow @@ -0,0 +1,83 @@ +// @flow strict + +import { type ASTNode } from './ast'; +import { Kind } from './kinds'; + +export function isDefinitionNode(node: ASTNode): boolean %checks { + return ( + isExecutableDefinitionNode(node) || + isTypeSystemDefinitionNode(node) || + isTypeSystemExtensionNode(node) + ); +} + +export function isExecutableDefinitionNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.OPERATION_DEFINITION || + node.kind === Kind.FRAGMENT_DEFINITION + ); +} + +export function isSelectionNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.FIELD || + node.kind === Kind.FRAGMENT_SPREAD || + node.kind === Kind.INLINE_FRAGMENT + ); +} + +export function isValueNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.VARIABLE || + node.kind === Kind.INT || + node.kind === Kind.FLOAT || + node.kind === Kind.STRING || + node.kind === Kind.BOOLEAN || + node.kind === Kind.NULL || + node.kind === Kind.ENUM || + node.kind === Kind.LIST || + node.kind === Kind.OBJECT + ); +} + +export function isTypeNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.NAMED_TYPE || + node.kind === Kind.LIST_TYPE || + node.kind === Kind.NON_NULL_TYPE + ); +} + +export function isTypeSystemDefinitionNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.SCHEMA_DEFINITION || + isTypeDefinitionNode(node) || + node.kind === Kind.DIRECTIVE_DEFINITION + ); +} + +export function isTypeDefinitionNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.SCALAR_TYPE_DEFINITION || + node.kind === Kind.OBJECT_TYPE_DEFINITION || + node.kind === Kind.INTERFACE_TYPE_DEFINITION || + node.kind === Kind.UNION_TYPE_DEFINITION || + node.kind === Kind.ENUM_TYPE_DEFINITION || + node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION + ); +} + +export function isTypeSystemExtensionNode(node: ASTNode): boolean %checks { + return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +} + +export function isTypeExtensionNode(node: ASTNode): boolean %checks { + return ( + node.kind === Kind.SCALAR_TYPE_EXTENSION || + node.kind === Kind.OBJECT_TYPE_EXTENSION || + node.kind === Kind.INTERFACE_TYPE_EXTENSION || + node.kind === Kind.UNION_TYPE_EXTENSION || + node.kind === Kind.ENUM_TYPE_EXTENSION || + node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION + ); +} diff --git a/node_modules/graphql/language/predicates.mjs b/node_modules/graphql/language/predicates.mjs new file mode 100644 index 000000000..320e20841 --- /dev/null +++ b/node_modules/graphql/language/predicates.mjs @@ -0,0 +1,28 @@ +import { Kind } from './kinds'; +export function isDefinitionNode(node) { + return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); +} +export function isExecutableDefinitionNode(node) { + return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION; +} +export function isSelectionNode(node) { + return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT; +} +export function isValueNode(node) { + return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT; +} +export function isTypeNode(node) { + return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE; +} +export function isTypeSystemDefinitionNode(node) { + return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION; +} +export function isTypeDefinitionNode(node) { + return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION; +} +export function isTypeSystemExtensionNode(node) { + return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); +} +export function isTypeExtensionNode(node) { + return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION; +} diff --git a/node_modules/graphql/language/printLocation.js b/node_modules/graphql/language/printLocation.js new file mode 100644 index 000000000..75dd62f52 --- /dev/null +++ b/node_modules/graphql/language/printLocation.js @@ -0,0 +1,75 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printLocation = printLocation; +exports.printSourceLocation = printSourceLocation; + +var _location = require("../language/location"); + +/** + * Render a helpful description of the location in the GraphQL Source document. + */ +function printLocation(location) { + return printSourceLocation(location.source, (0, _location.getLocation)(location.source, location.start)); +} +/** + * Render a helpful description of the location in the GraphQL Source document. + */ + + +function printSourceLocation(source, sourceLocation) { + var firstLineColumnOffset = source.locationOffset.column - 1; + var body = whitespace(firstLineColumnOffset) + source.body; + var lineIndex = sourceLocation.line - 1; + var lineOffset = source.locationOffset.line - 1; + var lineNum = sourceLocation.line + lineOffset; + var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + var columnNum = sourceLocation.column + columnOffset; + var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n"); + var lines = body.split(/\r\n|[\n\r]/g); + var locationLine = lines[lineIndex]; // Special case for minified documents + + if (locationLine.length > 120) { + var sublineIndex = Math.floor(columnNum / 80); + var sublineColumnNum = columnNum % 80; + var sublines = []; + + for (var i = 0; i < locationLine.length; i += 80) { + sublines.push(locationLine.slice(i, i + 80)); + } + + return locationStr + printPrefixedLines([["".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) { + return ['', subline]; + }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]])); + } + + return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"], + ["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]); +} + +function printPrefixedLines(lines) { + var existingLines = lines.filter(function (_ref) { + var _ = _ref[0], + line = _ref[1]; + return line !== undefined; + }); + var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) { + var prefix = _ref2[0]; + return prefix.length; + })); + return existingLines.map(function (_ref3) { + var prefix = _ref3[0], + line = _ref3[1]; + return lpad(padLen, prefix) + ' | ' + line; + }).join('\n'); +} + +function whitespace(len) { + return Array(len + 1).join(' '); +} + +function lpad(len, str) { + return whitespace(len - str.length) + str; +} diff --git a/node_modules/graphql/language/printLocation.js.flow b/node_modules/graphql/language/printLocation.js.flow new file mode 100644 index 000000000..5180fec10 --- /dev/null +++ b/node_modules/graphql/language/printLocation.js.flow @@ -0,0 +1,85 @@ +// @flow strict + +import { type Source } from '../language/source'; +import { type Location } from '../language/ast'; +import { type SourceLocation, getLocation } from '../language/location'; + +/** + * Render a helpful description of the location in the GraphQL Source document. + */ +export function printLocation(location: Location): string { + return printSourceLocation( + location.source, + getLocation(location.source, location.start), + ); +} + +/** + * Render a helpful description of the location in the GraphQL Source document. + */ +export function printSourceLocation( + source: Source, + sourceLocation: SourceLocation, +): string { + const firstLineColumnOffset = source.locationOffset.column - 1; + const body = whitespace(firstLineColumnOffset) + source.body; + + const lineIndex = sourceLocation.line - 1; + const lineOffset = source.locationOffset.line - 1; + const lineNum = sourceLocation.line + lineOffset; + + const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + const columnNum = sourceLocation.column + columnOffset; + const locationStr = `${source.name}:${lineNum}:${columnNum}\n`; + + const lines = body.split(/\r\n|[\n\r]/g); + const locationLine = lines[lineIndex]; + + // Special case for minified documents + if (locationLine.length > 120) { + const sublineIndex = Math.floor(columnNum / 80); + const sublineColumnNum = columnNum % 80; + const sublines = []; + for (let i = 0; i < locationLine.length; i += 80) { + sublines.push(locationLine.slice(i, i + 80)); + } + + return ( + locationStr + + printPrefixedLines([ + [`${lineNum}`, sublines[0]], + ...sublines.slice(1, sublineIndex + 1).map(subline => ['', subline]), + [' ', whitespace(sublineColumnNum - 1) + '^'], + ['', sublines[sublineIndex + 1]], + ]) + ); + } + + return ( + locationStr + + printPrefixedLines([ + // Lines specified like this: ["prefix", "string"], + [`${lineNum - 1}`, lines[lineIndex - 1]], + [`${lineNum}`, locationLine], + ['', whitespace(columnNum - 1) + '^'], + [`${lineNum + 1}`, lines[lineIndex + 1]], + ]) + ); +} + +function printPrefixedLines(lines: $ReadOnlyArray<[string, string]>): string { + const existingLines = lines.filter(([_, line]) => line !== undefined); + + const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); + return existingLines + .map(([prefix, line]) => lpad(padLen, prefix) + ' | ' + line) + .join('\n'); +} + +function whitespace(len: number): string { + return Array(len + 1).join(' '); +} + +function lpad(len: number, str: string): string { + return whitespace(len - str.length) + str; +} diff --git a/node_modules/graphql/language/printLocation.mjs b/node_modules/graphql/language/printLocation.mjs new file mode 100644 index 000000000..d321dee38 --- /dev/null +++ b/node_modules/graphql/language/printLocation.mjs @@ -0,0 +1,66 @@ +import { getLocation } from '../language/location'; +/** + * Render a helpful description of the location in the GraphQL Source document. + */ + +export function printLocation(location) { + return printSourceLocation(location.source, getLocation(location.source, location.start)); +} +/** + * Render a helpful description of the location in the GraphQL Source document. + */ + +export function printSourceLocation(source, sourceLocation) { + var firstLineColumnOffset = source.locationOffset.column - 1; + var body = whitespace(firstLineColumnOffset) + source.body; + var lineIndex = sourceLocation.line - 1; + var lineOffset = source.locationOffset.line - 1; + var lineNum = sourceLocation.line + lineOffset; + var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0; + var columnNum = sourceLocation.column + columnOffset; + var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n"); + var lines = body.split(/\r\n|[\n\r]/g); + var locationLine = lines[lineIndex]; // Special case for minified documents + + if (locationLine.length > 120) { + var sublineIndex = Math.floor(columnNum / 80); + var sublineColumnNum = columnNum % 80; + var sublines = []; + + for (var i = 0; i < locationLine.length; i += 80) { + sublines.push(locationLine.slice(i, i + 80)); + } + + return locationStr + printPrefixedLines([["".concat(lineNum), sublines[0]]].concat(sublines.slice(1, sublineIndex + 1).map(function (subline) { + return ['', subline]; + }), [[' ', whitespace(sublineColumnNum - 1) + '^'], ['', sublines[sublineIndex + 1]]])); + } + + return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"], + ["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]); +} + +function printPrefixedLines(lines) { + var existingLines = lines.filter(function (_ref) { + var _ = _ref[0], + line = _ref[1]; + return line !== undefined; + }); + var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) { + var prefix = _ref2[0]; + return prefix.length; + })); + return existingLines.map(function (_ref3) { + var prefix = _ref3[0], + line = _ref3[1]; + return lpad(padLen, prefix) + ' | ' + line; + }).join('\n'); +} + +function whitespace(len) { + return Array(len + 1).join(' '); +} + +function lpad(len, str) { + return whitespace(len - str.length) + str; +} diff --git a/node_modules/graphql/language/printer.js b/node_modules/graphql/language/printer.js new file mode 100644 index 000000000..a46eb34ca --- /dev/null +++ b/node_modules/graphql/language/printer.js @@ -0,0 +1,309 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.print = print; + +var _visitor = require("./visitor"); + +var _blockString = require("./blockString"); + +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +function print(ast) { + return (0, _visitor.visit)(ast, { + leave: printDocASTReducer + }); +} // TODO: provide better type coverage in future + + +var printDocASTReducer = { + Name: function Name(node) { + return node.value; + }, + Variable: function Variable(node) { + return '$' + node.name; + }, + // Document + Document: function Document(node) { + return join(node.definitions, '\n\n') + '\n'; + }, + OperationDefinition: function OperationDefinition(node) { + var op = node.operation; + var name = node.name; + var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + var directives = join(node.directives, ' '); + var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use + // the query short form. + + return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' '); + }, + VariableDefinition: function VariableDefinition(_ref) { + var variable = _ref.variable, + type = _ref.type, + defaultValue = _ref.defaultValue, + directives = _ref.directives; + return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')); + }, + SelectionSet: function SelectionSet(_ref2) { + var selections = _ref2.selections; + return block(selections); + }, + Field: function Field(_ref3) { + var alias = _ref3.alias, + name = _ref3.name, + args = _ref3.arguments, + directives = _ref3.directives, + selectionSet = _ref3.selectionSet; + return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' '); + }, + Argument: function Argument(_ref4) { + var name = _ref4.name, + value = _ref4.value; + return name + ': ' + value; + }, + // Fragments + FragmentSpread: function FragmentSpread(_ref5) { + var name = _ref5.name, + directives = _ref5.directives; + return '...' + name + wrap(' ', join(directives, ' ')); + }, + InlineFragment: function InlineFragment(_ref6) { + var typeCondition = _ref6.typeCondition, + directives = _ref6.directives, + selectionSet = _ref6.selectionSet; + return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '); + }, + FragmentDefinition: function FragmentDefinition(_ref7) { + var name = _ref7.name, + typeCondition = _ref7.typeCondition, + variableDefinitions = _ref7.variableDefinitions, + directives = _ref7.directives, + selectionSet = _ref7.selectionSet; + return (// Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + "fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet + ); + }, + // Value + IntValue: function IntValue(_ref8) { + var value = _ref8.value; + return value; + }, + FloatValue: function FloatValue(_ref9) { + var value = _ref9.value; + return value; + }, + StringValue: function StringValue(_ref10, key) { + var value = _ref10.value, + isBlockString = _ref10.block; + return isBlockString ? (0, _blockString.printBlockString)(value, key === 'description' ? '' : ' ') : JSON.stringify(value); + }, + BooleanValue: function BooleanValue(_ref11) { + var value = _ref11.value; + return value ? 'true' : 'false'; + }, + NullValue: function NullValue() { + return 'null'; + }, + EnumValue: function EnumValue(_ref12) { + var value = _ref12.value; + return value; + }, + ListValue: function ListValue(_ref13) { + var values = _ref13.values; + return '[' + join(values, ', ') + ']'; + }, + ObjectValue: function ObjectValue(_ref14) { + var fields = _ref14.fields; + return '{' + join(fields, ', ') + '}'; + }, + ObjectField: function ObjectField(_ref15) { + var name = _ref15.name, + value = _ref15.value; + return name + ': ' + value; + }, + // Directive + Directive: function Directive(_ref16) { + var name = _ref16.name, + args = _ref16.arguments; + return '@' + name + wrap('(', join(args, ', '), ')'); + }, + // Type + NamedType: function NamedType(_ref17) { + var name = _ref17.name; + return name; + }, + ListType: function ListType(_ref18) { + var type = _ref18.type; + return '[' + type + ']'; + }, + NonNullType: function NonNullType(_ref19) { + var type = _ref19.type; + return type + '!'; + }, + // Type System Definitions + SchemaDefinition: function SchemaDefinition(_ref20) { + var directives = _ref20.directives, + operationTypes = _ref20.operationTypes; + return join(['schema', join(directives, ' '), block(operationTypes)], ' '); + }, + OperationTypeDefinition: function OperationTypeDefinition(_ref21) { + var operation = _ref21.operation, + type = _ref21.type; + return operation + ': ' + type; + }, + ScalarTypeDefinition: addDescription(function (_ref22) { + var name = _ref22.name, + directives = _ref22.directives; + return join(['scalar', name, join(directives, ' ')], ' '); + }), + ObjectTypeDefinition: addDescription(function (_ref23) { + var name = _ref23.name, + interfaces = _ref23.interfaces, + directives = _ref23.directives, + fields = _ref23.fields; + return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); + }), + FieldDefinition: addDescription(function (_ref24) { + var name = _ref24.name, + args = _ref24.arguments, + type = _ref24.type, + directives = _ref24.directives; + return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')); + }), + InputValueDefinition: addDescription(function (_ref25) { + var name = _ref25.name, + type = _ref25.type, + defaultValue = _ref25.defaultValue, + directives = _ref25.directives; + return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '); + }), + InterfaceTypeDefinition: addDescription(function (_ref26) { + var name = _ref26.name, + directives = _ref26.directives, + fields = _ref26.fields; + return join(['interface', name, join(directives, ' '), block(fields)], ' '); + }), + UnionTypeDefinition: addDescription(function (_ref27) { + var name = _ref27.name, + directives = _ref27.directives, + types = _ref27.types; + return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); + }), + EnumTypeDefinition: addDescription(function (_ref28) { + var name = _ref28.name, + directives = _ref28.directives, + values = _ref28.values; + return join(['enum', name, join(directives, ' '), block(values)], ' '); + }), + EnumValueDefinition: addDescription(function (_ref29) { + var name = _ref29.name, + directives = _ref29.directives; + return join([name, join(directives, ' ')], ' '); + }), + InputObjectTypeDefinition: addDescription(function (_ref30) { + var name = _ref30.name, + directives = _ref30.directives, + fields = _ref30.fields; + return join(['input', name, join(directives, ' '), block(fields)], ' '); + }), + DirectiveDefinition: addDescription(function (_ref31) { + var name = _ref31.name, + args = _ref31.arguments, + repeatable = _ref31.repeatable, + locations = _ref31.locations; + return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | '); + }), + SchemaExtension: function SchemaExtension(_ref32) { + var directives = _ref32.directives, + operationTypes = _ref32.operationTypes; + return join(['extend schema', join(directives, ' '), block(operationTypes)], ' '); + }, + ScalarTypeExtension: function ScalarTypeExtension(_ref33) { + var name = _ref33.name, + directives = _ref33.directives; + return join(['extend scalar', name, join(directives, ' ')], ' '); + }, + ObjectTypeExtension: function ObjectTypeExtension(_ref34) { + var name = _ref34.name, + interfaces = _ref34.interfaces, + directives = _ref34.directives, + fields = _ref34.fields; + return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); + }, + InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) { + var name = _ref35.name, + directives = _ref35.directives, + fields = _ref35.fields; + return join(['extend interface', name, join(directives, ' '), block(fields)], ' '); + }, + UnionTypeExtension: function UnionTypeExtension(_ref36) { + var name = _ref36.name, + directives = _ref36.directives, + types = _ref36.types; + return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); + }, + EnumTypeExtension: function EnumTypeExtension(_ref37) { + var name = _ref37.name, + directives = _ref37.directives, + values = _ref37.values; + return join(['extend enum', name, join(directives, ' '), block(values)], ' '); + }, + InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) { + var name = _ref38.name, + directives = _ref38.directives, + fields = _ref38.fields; + return join(['extend input', name, join(directives, ' '), block(fields)], ' '); + } +}; + +function addDescription(cb) { + return function (node) { + return join([node.description, cb(node)], '\n'); + }; +} +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ + + +function join(maybeArray, separator) { + return maybeArray ? maybeArray.filter(function (x) { + return x; + }).join(separator || '') : ''; +} +/** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ + + +function block(array) { + return array && array.length !== 0 ? '{\n' + indent(join(array, '\n')) + '\n}' : ''; +} +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ + + +function wrap(start, maybeString, end) { + return maybeString ? start + maybeString + (end || '') : ''; +} + +function indent(maybeString) { + return maybeString && ' ' + maybeString.replace(/\n/g, '\n '); +} + +function isMultiline(string) { + return string.indexOf('\n') !== -1; +} + +function hasMultilineItems(maybeArray) { + return maybeArray && maybeArray.some(isMultiline); +} diff --git a/node_modules/graphql/language/printer.js.flow b/node_modules/graphql/language/printer.js.flow new file mode 100644 index 000000000..b4c2636b4 --- /dev/null +++ b/node_modules/graphql/language/printer.js.flow @@ -0,0 +1,270 @@ +// @flow strict + +import { type ASTNode } from './ast'; +import { visit } from './visitor'; +import { printBlockString } from './blockString'; + +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ +export function print(ast: ASTNode): string { + return visit(ast, { leave: printDocASTReducer }); +} + +// TODO: provide better type coverage in future +const printDocASTReducer: any = { + Name: node => node.value, + Variable: node => '$' + node.name, + + // Document + + Document: node => join(node.definitions, '\n\n') + '\n', + + OperationDefinition(node) { + const op = node.operation; + const name = node.name; + const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + const directives = join(node.directives, ' '); + const selectionSet = node.selectionSet; + // Anonymous queries with no directives or variable definitions can use + // the query short form. + return !name && !directives && !varDefs && op === 'query' + ? selectionSet + : join([op, join([name, varDefs]), directives, selectionSet], ' '); + }, + + VariableDefinition: ({ variable, type, defaultValue, directives }) => + variable + + ': ' + + type + + wrap(' = ', defaultValue) + + wrap(' ', join(directives, ' ')), + SelectionSet: ({ selections }) => block(selections), + + Field: ({ alias, name, arguments: args, directives, selectionSet }) => + join( + [ + wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), + join(directives, ' '), + selectionSet, + ], + ' ', + ), + + Argument: ({ name, value }) => name + ': ' + value, + + // Fragments + + FragmentSpread: ({ name, directives }) => + '...' + name + wrap(' ', join(directives, ' ')), + + InlineFragment: ({ typeCondition, directives, selectionSet }) => + join( + ['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], + ' ', + ), + + FragmentDefinition: ({ + name, + typeCondition, + variableDefinitions, + directives, + selectionSet, + }) => + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` + + `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` + + selectionSet, + + // Value + + IntValue: ({ value }) => value, + FloatValue: ({ value }) => value, + StringValue: ({ value, block: isBlockString }, key) => + isBlockString + ? printBlockString(value, key === 'description' ? '' : ' ') + : JSON.stringify(value), + BooleanValue: ({ value }) => (value ? 'true' : 'false'), + NullValue: () => 'null', + EnumValue: ({ value }) => value, + ListValue: ({ values }) => '[' + join(values, ', ') + ']', + ObjectValue: ({ fields }) => '{' + join(fields, ', ') + '}', + ObjectField: ({ name, value }) => name + ': ' + value, + + // Directive + + Directive: ({ name, arguments: args }) => + '@' + name + wrap('(', join(args, ', '), ')'), + + // Type + + NamedType: ({ name }) => name, + ListType: ({ type }) => '[' + type + ']', + NonNullType: ({ type }) => type + '!', + + // Type System Definitions + + SchemaDefinition: ({ directives, operationTypes }) => + join(['schema', join(directives, ' '), block(operationTypes)], ' '), + + OperationTypeDefinition: ({ operation, type }) => operation + ': ' + type, + + ScalarTypeDefinition: addDescription(({ name, directives }) => + join(['scalar', name, join(directives, ' ')], ' '), + ), + + ObjectTypeDefinition: addDescription( + ({ name, interfaces, directives, fields }) => + join( + [ + 'type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + ), + + FieldDefinition: addDescription( + ({ name, arguments: args, type, directives }) => + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + ': ' + + type + + wrap(' ', join(directives, ' ')), + ), + + InputValueDefinition: addDescription( + ({ name, type, defaultValue, directives }) => + join( + [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], + ' ', + ), + ), + + InterfaceTypeDefinition: addDescription(({ name, directives, fields }) => + join(['interface', name, join(directives, ' '), block(fields)], ' '), + ), + + UnionTypeDefinition: addDescription(({ name, directives, types }) => + join( + [ + 'union', + name, + join(directives, ' '), + types && types.length !== 0 ? '= ' + join(types, ' | ') : '', + ], + ' ', + ), + ), + + EnumTypeDefinition: addDescription(({ name, directives, values }) => + join(['enum', name, join(directives, ' '), block(values)], ' '), + ), + + EnumValueDefinition: addDescription(({ name, directives }) => + join([name, join(directives, ' ')], ' '), + ), + + InputObjectTypeDefinition: addDescription(({ name, directives, fields }) => + join(['input', name, join(directives, ' '), block(fields)], ' '), + ), + + DirectiveDefinition: addDescription( + ({ name, arguments: args, repeatable, locations }) => + 'directive @' + + name + + (hasMultilineItems(args) + ? wrap('(\n', indent(join(args, '\n')), '\n)') + : wrap('(', join(args, ', '), ')')) + + (repeatable ? ' repeatable' : '') + + ' on ' + + join(locations, ' | '), + ), + + SchemaExtension: ({ directives, operationTypes }) => + join(['extend schema', join(directives, ' '), block(operationTypes)], ' '), + + ScalarTypeExtension: ({ name, directives }) => + join(['extend scalar', name, join(directives, ' ')], ' '), + + ObjectTypeExtension: ({ name, interfaces, directives, fields }) => + join( + [ + 'extend type', + name, + wrap('implements ', join(interfaces, ' & ')), + join(directives, ' '), + block(fields), + ], + ' ', + ), + + InterfaceTypeExtension: ({ name, directives, fields }) => + join(['extend interface', name, join(directives, ' '), block(fields)], ' '), + + UnionTypeExtension: ({ name, directives, types }) => + join( + [ + 'extend union', + name, + join(directives, ' '), + types && types.length !== 0 ? '= ' + join(types, ' | ') : '', + ], + ' ', + ), + + EnumTypeExtension: ({ name, directives, values }) => + join(['extend enum', name, join(directives, ' '), block(values)], ' '), + + InputObjectTypeExtension: ({ name, directives, fields }) => + join(['extend input', name, join(directives, ' '), block(fields)], ' '), +}; + +function addDescription(cb) { + return node => join([node.description, cb(node)], '\n'); +} + +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ +function join(maybeArray, separator) { + return maybeArray ? maybeArray.filter(x => x).join(separator || '') : ''; +} + +/** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ +function block(array) { + return array && array.length !== 0 + ? '{\n' + indent(join(array, '\n')) + '\n}' + : ''; +} + +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ +function wrap(start, maybeString, end) { + return maybeString ? start + maybeString + (end || '') : ''; +} + +function indent(maybeString) { + return maybeString && ' ' + maybeString.replace(/\n/g, '\n '); +} + +function isMultiline(string) { + return string.indexOf('\n') !== -1; +} + +function hasMultilineItems(maybeArray) { + return maybeArray && maybeArray.some(isMultiline); +} diff --git a/node_modules/graphql/language/printer.mjs b/node_modules/graphql/language/printer.mjs new file mode 100644 index 000000000..cff94da9b --- /dev/null +++ b/node_modules/graphql/language/printer.mjs @@ -0,0 +1,300 @@ +import { visit } from './visitor'; +import { printBlockString } from './blockString'; +/** + * Converts an AST into a string, using one set of reasonable + * formatting rules. + */ + +export function print(ast) { + return visit(ast, { + leave: printDocASTReducer + }); +} // TODO: provide better type coverage in future + +var printDocASTReducer = { + Name: function Name(node) { + return node.value; + }, + Variable: function Variable(node) { + return '$' + node.name; + }, + // Document + Document: function Document(node) { + return join(node.definitions, '\n\n') + '\n'; + }, + OperationDefinition: function OperationDefinition(node) { + var op = node.operation; + var name = node.name; + var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')'); + var directives = join(node.directives, ' '); + var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use + // the query short form. + + return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' '); + }, + VariableDefinition: function VariableDefinition(_ref) { + var variable = _ref.variable, + type = _ref.type, + defaultValue = _ref.defaultValue, + directives = _ref.directives; + return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' ')); + }, + SelectionSet: function SelectionSet(_ref2) { + var selections = _ref2.selections; + return block(selections); + }, + Field: function Field(_ref3) { + var alias = _ref3.alias, + name = _ref3.name, + args = _ref3.arguments, + directives = _ref3.directives, + selectionSet = _ref3.selectionSet; + return join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' '); + }, + Argument: function Argument(_ref4) { + var name = _ref4.name, + value = _ref4.value; + return name + ': ' + value; + }, + // Fragments + FragmentSpread: function FragmentSpread(_ref5) { + var name = _ref5.name, + directives = _ref5.directives; + return '...' + name + wrap(' ', join(directives, ' ')); + }, + InlineFragment: function InlineFragment(_ref6) { + var typeCondition = _ref6.typeCondition, + directives = _ref6.directives, + selectionSet = _ref6.selectionSet; + return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' '); + }, + FragmentDefinition: function FragmentDefinition(_ref7) { + var name = _ref7.name, + typeCondition = _ref7.typeCondition, + variableDefinitions = _ref7.variableDefinitions, + directives = _ref7.directives, + selectionSet = _ref7.selectionSet; + return (// Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + "fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet + ); + }, + // Value + IntValue: function IntValue(_ref8) { + var value = _ref8.value; + return value; + }, + FloatValue: function FloatValue(_ref9) { + var value = _ref9.value; + return value; + }, + StringValue: function StringValue(_ref10, key) { + var value = _ref10.value, + isBlockString = _ref10.block; + return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value); + }, + BooleanValue: function BooleanValue(_ref11) { + var value = _ref11.value; + return value ? 'true' : 'false'; + }, + NullValue: function NullValue() { + return 'null'; + }, + EnumValue: function EnumValue(_ref12) { + var value = _ref12.value; + return value; + }, + ListValue: function ListValue(_ref13) { + var values = _ref13.values; + return '[' + join(values, ', ') + ']'; + }, + ObjectValue: function ObjectValue(_ref14) { + var fields = _ref14.fields; + return '{' + join(fields, ', ') + '}'; + }, + ObjectField: function ObjectField(_ref15) { + var name = _ref15.name, + value = _ref15.value; + return name + ': ' + value; + }, + // Directive + Directive: function Directive(_ref16) { + var name = _ref16.name, + args = _ref16.arguments; + return '@' + name + wrap('(', join(args, ', '), ')'); + }, + // Type + NamedType: function NamedType(_ref17) { + var name = _ref17.name; + return name; + }, + ListType: function ListType(_ref18) { + var type = _ref18.type; + return '[' + type + ']'; + }, + NonNullType: function NonNullType(_ref19) { + var type = _ref19.type; + return type + '!'; + }, + // Type System Definitions + SchemaDefinition: function SchemaDefinition(_ref20) { + var directives = _ref20.directives, + operationTypes = _ref20.operationTypes; + return join(['schema', join(directives, ' '), block(operationTypes)], ' '); + }, + OperationTypeDefinition: function OperationTypeDefinition(_ref21) { + var operation = _ref21.operation, + type = _ref21.type; + return operation + ': ' + type; + }, + ScalarTypeDefinition: addDescription(function (_ref22) { + var name = _ref22.name, + directives = _ref22.directives; + return join(['scalar', name, join(directives, ' ')], ' '); + }), + ObjectTypeDefinition: addDescription(function (_ref23) { + var name = _ref23.name, + interfaces = _ref23.interfaces, + directives = _ref23.directives, + fields = _ref23.fields; + return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); + }), + FieldDefinition: addDescription(function (_ref24) { + var name = _ref24.name, + args = _ref24.arguments, + type = _ref24.type, + directives = _ref24.directives; + return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' ')); + }), + InputValueDefinition: addDescription(function (_ref25) { + var name = _ref25.name, + type = _ref25.type, + defaultValue = _ref25.defaultValue, + directives = _ref25.directives; + return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' '); + }), + InterfaceTypeDefinition: addDescription(function (_ref26) { + var name = _ref26.name, + directives = _ref26.directives, + fields = _ref26.fields; + return join(['interface', name, join(directives, ' '), block(fields)], ' '); + }), + UnionTypeDefinition: addDescription(function (_ref27) { + var name = _ref27.name, + directives = _ref27.directives, + types = _ref27.types; + return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); + }), + EnumTypeDefinition: addDescription(function (_ref28) { + var name = _ref28.name, + directives = _ref28.directives, + values = _ref28.values; + return join(['enum', name, join(directives, ' '), block(values)], ' '); + }), + EnumValueDefinition: addDescription(function (_ref29) { + var name = _ref29.name, + directives = _ref29.directives; + return join([name, join(directives, ' ')], ' '); + }), + InputObjectTypeDefinition: addDescription(function (_ref30) { + var name = _ref30.name, + directives = _ref30.directives, + fields = _ref30.fields; + return join(['input', name, join(directives, ' '), block(fields)], ' '); + }), + DirectiveDefinition: addDescription(function (_ref31) { + var name = _ref31.name, + args = _ref31.arguments, + repeatable = _ref31.repeatable, + locations = _ref31.locations; + return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | '); + }), + SchemaExtension: function SchemaExtension(_ref32) { + var directives = _ref32.directives, + operationTypes = _ref32.operationTypes; + return join(['extend schema', join(directives, ' '), block(operationTypes)], ' '); + }, + ScalarTypeExtension: function ScalarTypeExtension(_ref33) { + var name = _ref33.name, + directives = _ref33.directives; + return join(['extend scalar', name, join(directives, ' ')], ' '); + }, + ObjectTypeExtension: function ObjectTypeExtension(_ref34) { + var name = _ref34.name, + interfaces = _ref34.interfaces, + directives = _ref34.directives, + fields = _ref34.fields; + return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '); + }, + InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) { + var name = _ref35.name, + directives = _ref35.directives, + fields = _ref35.fields; + return join(['extend interface', name, join(directives, ' '), block(fields)], ' '); + }, + UnionTypeExtension: function UnionTypeExtension(_ref36) { + var name = _ref36.name, + directives = _ref36.directives, + types = _ref36.types; + return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' '); + }, + EnumTypeExtension: function EnumTypeExtension(_ref37) { + var name = _ref37.name, + directives = _ref37.directives, + values = _ref37.values; + return join(['extend enum', name, join(directives, ' '), block(values)], ' '); + }, + InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) { + var name = _ref38.name, + directives = _ref38.directives, + fields = _ref38.fields; + return join(['extend input', name, join(directives, ' '), block(fields)], ' '); + } +}; + +function addDescription(cb) { + return function (node) { + return join([node.description, cb(node)], '\n'); + }; +} +/** + * Given maybeArray, print an empty string if it is null or empty, otherwise + * print all items together separated by separator if provided + */ + + +function join(maybeArray, separator) { + return maybeArray ? maybeArray.filter(function (x) { + return x; + }).join(separator || '') : ''; +} +/** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ + + +function block(array) { + return array && array.length !== 0 ? '{\n' + indent(join(array, '\n')) + '\n}' : ''; +} +/** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ + + +function wrap(start, maybeString, end) { + return maybeString ? start + maybeString + (end || '') : ''; +} + +function indent(maybeString) { + return maybeString && ' ' + maybeString.replace(/\n/g, '\n '); +} + +function isMultiline(string) { + return string.indexOf('\n') !== -1; +} + +function hasMultilineItems(maybeArray) { + return maybeArray && maybeArray.some(isMultiline); +} diff --git a/node_modules/graphql/language/source.js b/node_modules/graphql/language/source.js new file mode 100644 index 000000000..dc4005e26 --- /dev/null +++ b/node_modules/graphql/language/source.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Source = void 0; + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _defineToStringTag = _interopRequireDefault(require("../jsutils/defineToStringTag")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ +var Source = function Source(body, name, locationOffset) { + this.body = body; + this.name = name || 'GraphQL request'; + this.locationOffset = locationOffset || { + line: 1, + column: 1 + }; + !(this.locationOffset.line > 0) ? (0, _invariant.default)(0, 'line in locationOffset is 1-indexed and must be positive') : void 0; + !(this.locationOffset.column > 0) ? (0, _invariant.default)(0, 'column in locationOffset is 1-indexed and must be positive') : void 0; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.Source = Source; +(0, _defineToStringTag.default)(Source); diff --git a/node_modules/graphql/language/source.js.flow b/node_modules/graphql/language/source.js.flow new file mode 100644 index 000000000..914e49061 --- /dev/null +++ b/node_modules/graphql/language/source.js.flow @@ -0,0 +1,40 @@ +// @flow strict + +import invariant from '../jsutils/invariant'; +import defineToStringTag from '../jsutils/defineToStringTag'; + +type Location = {| + line: number, + column: number, +|}; + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ +export class Source { + body: string; + name: string; + locationOffset: Location; + + constructor(body: string, name?: string, locationOffset?: Location): void { + this.body = body; + this.name = name || 'GraphQL request'; + this.locationOffset = locationOffset || { line: 1, column: 1 }; + invariant( + this.locationOffset.line > 0, + 'line in locationOffset is 1-indexed and must be positive', + ); + invariant( + this.locationOffset.column > 0, + 'column in locationOffset is 1-indexed and must be positive', + ); + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(Source); diff --git a/node_modules/graphql/language/source.mjs b/node_modules/graphql/language/source.mjs new file mode 100644 index 000000000..009f685a2 --- /dev/null +++ b/node_modules/graphql/language/source.mjs @@ -0,0 +1,23 @@ +import invariant from '../jsutils/invariant'; +import defineToStringTag from '../jsutils/defineToStringTag'; + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ +export var Source = function Source(body, name, locationOffset) { + this.body = body; + this.name = name || 'GraphQL request'; + this.locationOffset = locationOffset || { + line: 1, + column: 1 + }; + !(this.locationOffset.line > 0) ? invariant(0, 'line in locationOffset is 1-indexed and must be positive') : void 0; + !(this.locationOffset.column > 0) ? invariant(0, 'column in locationOffset is 1-indexed and must be positive') : void 0; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(Source); diff --git a/node_modules/graphql/language/tokenKind.js b/node_modules/graphql/language/tokenKind.js new file mode 100644 index 000000000..3d5532d43 --- /dev/null +++ b/node_modules/graphql/language/tokenKind.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TokenKind = void 0; + +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +var TokenKind = Object.freeze({ + SOF: '', + EOF: '', + BANG: '!', + DOLLAR: '$', + AMP: '&', + PAREN_L: '(', + PAREN_R: ')', + SPREAD: '...', + COLON: ':', + EQUALS: '=', + AT: '@', + BRACKET_L: '[', + BRACKET_R: ']', + BRACE_L: '{', + PIPE: '|', + BRACE_R: '}', + NAME: 'Name', + INT: 'Int', + FLOAT: 'Float', + STRING: 'String', + BLOCK_STRING: 'BlockString', + COMMENT: 'Comment' +}); +/** + * The enum type representing the token kinds values. + */ + +exports.TokenKind = TokenKind; diff --git a/node_modules/graphql/language/tokenKind.js.flow b/node_modules/graphql/language/tokenKind.js.flow new file mode 100644 index 000000000..0dd0afc8c --- /dev/null +++ b/node_modules/graphql/language/tokenKind.js.flow @@ -0,0 +1,35 @@ +// @flow strict + +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export const TokenKind = Object.freeze({ + SOF: '', + EOF: '', + BANG: '!', + DOLLAR: '$', + AMP: '&', + PAREN_L: '(', + PAREN_R: ')', + SPREAD: '...', + COLON: ':', + EQUALS: '=', + AT: '@', + BRACKET_L: '[', + BRACKET_R: ']', + BRACE_L: '{', + PIPE: '|', + BRACE_R: '}', + NAME: 'Name', + INT: 'Int', + FLOAT: 'Float', + STRING: 'String', + BLOCK_STRING: 'BlockString', + COMMENT: 'Comment', +}); + +/** + * The enum type representing the token kinds values. + */ +export type TokenKindEnum = $Values; diff --git a/node_modules/graphql/language/tokenKind.mjs b/node_modules/graphql/language/tokenKind.mjs new file mode 100644 index 000000000..f100b9928 --- /dev/null +++ b/node_modules/graphql/language/tokenKind.mjs @@ -0,0 +1,31 @@ +/** + * An exported enum describing the different kinds of tokens that the + * lexer emits. + */ +export var TokenKind = Object.freeze({ + SOF: '', + EOF: '', + BANG: '!', + DOLLAR: '$', + AMP: '&', + PAREN_L: '(', + PAREN_R: ')', + SPREAD: '...', + COLON: ':', + EQUALS: '=', + AT: '@', + BRACKET_L: '[', + BRACKET_R: ']', + BRACE_L: '{', + PIPE: '|', + BRACE_R: '}', + NAME: 'Name', + INT: 'Int', + FLOAT: 'Float', + STRING: 'String', + BLOCK_STRING: 'BlockString', + COMMENT: 'Comment' +}); +/** + * The enum type representing the token kinds values. + */ diff --git a/node_modules/graphql/language/visitor.js b/node_modules/graphql/language/visitor.js new file mode 100644 index 000000000..dd05a5cd1 --- /dev/null +++ b/node_modules/graphql/language/visitor.js @@ -0,0 +1,441 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.visit = visit; +exports.visitInParallel = visitInParallel; +exports.visitWithTypeInfo = visitWithTypeInfo; +exports.getVisitFn = getVisitFn; +exports.BREAK = exports.QueryDocumentKeys = void 0; + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var QueryDocumentKeys = { + Name: [], + Document: ['definitions'], + OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], + VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + FragmentSpread: ['name', 'directives'], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + Directive: ['name', 'arguments'], + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + SchemaDefinition: ['directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], + InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], + SchemaExtension: ['directives', 'operationTypes'], + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'] +}; +exports.QueryDocumentKeys = QueryDocumentKeys; +var BREAK = Object.freeze({}); +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ + +exports.BREAK = BREAK; + +function visit(root, visitor) { + var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; + + /* eslint-disable no-undef-init */ + var stack = undefined; + var inArray = Array.isArray(root); + var keys = [root]; + var index = -1; + var edits = []; + var node = undefined; + var key = undefined; + var parent = undefined; + var path = []; + var ancestors = []; + var newRoot = root; + /* eslint-enable no-undef-init */ + + do { + index++; + var isLeaving = index === keys.length; + var isEdited = isLeaving && edits.length !== 0; + + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + + if (isEdited) { + if (inArray) { + node = node.slice(); + } else { + var clone = {}; + + for (var _i = 0, _Object$keys = Object.keys(node); _i < _Object$keys.length; _i++) { + var k = _Object$keys[_i]; + clone[k] = node[k]; + } + + node = clone; + } + + var editOffset = 0; + + for (var ii = 0; ii < edits.length; ii++) { + var editKey = edits[ii][0]; + var editValue = edits[ii][1]; + + if (inArray) { + editKey -= editOffset; + } + + if (inArray && editValue === null) { + node.splice(editKey, 1); + editOffset++; + } else { + node[editKey] = editValue; + } + } + } + + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } else { + key = parent ? inArray ? index : keys[index] : undefined; + node = parent ? parent[key] : newRoot; + + if (node === null || node === undefined) { + continue; + } + + if (parent) { + path.push(key); + } + } + + var result = void 0; + + if (!Array.isArray(node)) { + if (!isNode(node)) { + throw new Error('Invalid AST Node: ' + (0, _inspect.default)(node)); + } + + var visitFn = getVisitFn(visitor, node.kind, isLeaving); + + if (visitFn) { + result = visitFn.call(visitor, node, key, parent, path, ancestors); + + if (result === BREAK) { + break; + } + + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } else if (result !== undefined) { + edits.push([key, result]); + + if (!isLeaving) { + if (isNode(result)) { + node = result; + } else { + path.pop(); + continue; + } + } + } + } + } + + if (result === undefined && isEdited) { + edits.push([key, node]); + } + + if (isLeaving) { + path.pop(); + } else { + stack = { + inArray: inArray, + index: index, + keys: keys, + edits: edits, + prev: stack + }; + inArray = Array.isArray(node); + keys = inArray ? node : visitorKeys[node.kind] || []; + index = -1; + edits = []; + + if (parent) { + ancestors.push(parent); + } + + parent = node; + } + } while (stack !== undefined); + + if (edits.length !== 0) { + newRoot = edits[edits.length - 1][1]; + } + + return newRoot; +} + +function isNode(maybeNode) { + return Boolean(maybeNode && typeof maybeNode.kind === 'string'); +} +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ + + +function visitInParallel(visitors) { + var skipping = new Array(visitors.length); + return { + enter: function enter(node) { + for (var i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + var fn = getVisitFn(visitors[i], node.kind, + /* isLeaving */ + false); + + if (fn) { + var result = fn.apply(visitors[i], arguments); + + if (result === false) { + skipping[i] = node; + } else if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined) { + return result; + } + } + } + } + }, + leave: function leave(node) { + for (var i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + var fn = getVisitFn(visitors[i], node.kind, + /* isLeaving */ + true); + + if (fn) { + var result = fn.apply(visitors[i], arguments); + + if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined && result !== false) { + return result; + } + } + } else if (skipping[i] === node) { + skipping[i] = null; + } + } + } + }; +} +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ + + +function visitWithTypeInfo(typeInfo, visitor) { + return { + enter: function enter(node) { + typeInfo.enter(node); + var fn = getVisitFn(visitor, node.kind, + /* isLeaving */ + false); + + if (fn) { + var result = fn.apply(visitor, arguments); + + if (result !== undefined) { + typeInfo.leave(node); + + if (isNode(result)) { + typeInfo.enter(result); + } + } + + return result; + } + }, + leave: function leave(node) { + var fn = getVisitFn(visitor, node.kind, + /* isLeaving */ + true); + var result; + + if (fn) { + result = fn.apply(visitor, arguments); + } + + typeInfo.leave(node); + return result; + } + }; +} +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. + */ + + +function getVisitFn(visitor, kind, isLeaving) { + var kindVisitor = visitor[kind]; + + if (kindVisitor) { + if (!isLeaving && typeof kindVisitor === 'function') { + // { Kind() {} } + return kindVisitor; + } + + var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; + + if (typeof kindSpecificVisitor === 'function') { + // { Kind: { enter() {}, leave() {} } } + return kindSpecificVisitor; + } + } else { + var specificVisitor = isLeaving ? visitor.leave : visitor.enter; + + if (specificVisitor) { + if (typeof specificVisitor === 'function') { + // { enter() {}, leave() {} } + return specificVisitor; + } + + var specificKindVisitor = specificVisitor[kind]; + + if (typeof specificKindVisitor === 'function') { + // { enter: { Kind() {} }, leave: { Kind() {} } } + return specificKindVisitor; + } + } + } +} diff --git a/node_modules/graphql/language/visitor.js.flow b/node_modules/graphql/language/visitor.js.flow new file mode 100644 index 000000000..4665259ba --- /dev/null +++ b/node_modules/graphql/language/visitor.js.flow @@ -0,0 +1,470 @@ +// @flow strict + +import inspect from '../jsutils/inspect'; +import { type ASTNode, type ASTKindToNode } from './ast'; +import { type TypeInfo } from '../utilities/TypeInfo'; + +/** + * A visitor is provided to visit, it contains the collection of + * relevant functions to be called during the visitor's traversal. + */ +export type ASTVisitor = Visitor; +export type Visitor> = + | EnterLeave< + | VisitFn + | ShapeMap(Node) => VisitFn>, + > + | ShapeMap< + KindToNode, + (Node) => VisitFn | EnterLeave>, + >; +type EnterLeave = {| +enter?: T, +leave?: T |}; +type ShapeMap = $Shape<$ObjMap>; + +/** + * A visitor is comprised of visit functions, which are called on each node + * during the visitor's traversal. + */ +export type VisitFn = ( + // The current node being visiting. + node: TVisitedNode, + // The index or key to this node from the parent node or Array. + key: string | number | void, + // The parent immediately above this node, which may be an Array. + parent: TAnyNode | $ReadOnlyArray | void, + // The key path to get to this node from the root node. + path: $ReadOnlyArray, + // All nodes and Arrays visited before reaching parent of this node. + // These correspond to array indices in `path`. + // Note: ancestors includes arrays which contain the parent of visited node. + ancestors: $ReadOnlyArray>, +) => any; + +/** + * A KeyMap describes each the traversable properties of each kind of node. + */ +export type VisitorKeyMap = $ObjMap< + KindToNode, + (T) => $ReadOnlyArray<$Keys>, +>; + +export const QueryDocumentKeys = { + Name: [], + + Document: ['definitions'], + OperationDefinition: [ + 'name', + 'variableDefinitions', + 'directives', + 'selectionSet', + ], + VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + + FragmentSpread: ['name', 'directives'], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: [ + 'name', + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + 'variableDefinitions', + 'typeCondition', + 'directives', + 'selectionSet', + ], + + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + + Directive: ['name', 'arguments'], + + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + + SchemaDefinition: ['directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: [ + 'description', + 'name', + 'interfaces', + 'directives', + 'fields', + ], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: [ + 'description', + 'name', + 'type', + 'defaultValue', + 'directives', + ], + InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + + DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], + + SchemaExtension: ['directives', 'operationTypes'], + + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'], +}; + +export const BREAK = Object.freeze({}); + +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ +export function visit( + root: ASTNode, + visitor: Visitor, + visitorKeys: VisitorKeyMap = QueryDocumentKeys, +): any { + /* eslint-disable no-undef-init */ + let stack: any = undefined; + let inArray = Array.isArray(root); + let keys: any = [root]; + let index = -1; + let edits = []; + let node: any = undefined; + let key: any = undefined; + let parent: any = undefined; + const path: any = []; + const ancestors = []; + let newRoot = root; + /* eslint-enable no-undef-init */ + + do { + index++; + const isLeaving = index === keys.length; + const isEdited = isLeaving && edits.length !== 0; + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + if (isEdited) { + if (inArray) { + node = node.slice(); + } else { + const clone = {}; + for (const k of Object.keys(node)) { + clone[k] = node[k]; + } + node = clone; + } + let editOffset = 0; + for (let ii = 0; ii < edits.length; ii++) { + let editKey: any = edits[ii][0]; + const editValue = edits[ii][1]; + if (inArray) { + editKey -= editOffset; + } + if (inArray && editValue === null) { + node.splice(editKey, 1); + editOffset++; + } else { + node[editKey] = editValue; + } + } + } + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } else { + key = parent ? (inArray ? index : keys[index]) : undefined; + node = parent ? parent[key] : newRoot; + if (node === null || node === undefined) { + continue; + } + if (parent) { + path.push(key); + } + } + + let result; + if (!Array.isArray(node)) { + if (!isNode(node)) { + throw new Error('Invalid AST Node: ' + inspect(node)); + } + const visitFn = getVisitFn(visitor, node.kind, isLeaving); + if (visitFn) { + result = visitFn.call(visitor, node, key, parent, path, ancestors); + + if (result === BREAK) { + break; + } + + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } else if (result !== undefined) { + edits.push([key, result]); + if (!isLeaving) { + if (isNode(result)) { + node = result; + } else { + path.pop(); + continue; + } + } + } + } + } + + if (result === undefined && isEdited) { + edits.push([key, node]); + } + + if (isLeaving) { + path.pop(); + } else { + stack = { inArray, index, keys, edits, prev: stack }; + inArray = Array.isArray(node); + keys = inArray ? node : visitorKeys[node.kind] || []; + index = -1; + edits = []; + if (parent) { + ancestors.push(parent); + } + parent = node; + } + } while (stack !== undefined); + + if (edits.length !== 0) { + newRoot = edits[edits.length - 1][1]; + } + + return newRoot; +} + +function isNode(maybeNode): boolean %checks { + return Boolean(maybeNode && typeof maybeNode.kind === 'string'); +} + +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ +export function visitInParallel( + visitors: $ReadOnlyArray>, +): Visitor { + const skipping = new Array(visitors.length); + + return { + enter(node) { + for (let i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + const fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ false); + if (fn) { + const result = fn.apply(visitors[i], arguments); + if (result === false) { + skipping[i] = node; + } else if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined) { + return result; + } + } + } + } + }, + leave(node) { + for (let i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + const fn = getVisitFn(visitors[i], node.kind, /* isLeaving */ true); + if (fn) { + const result = fn.apply(visitors[i], arguments); + if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined && result !== false) { + return result; + } + } + } else if (skipping[i] === node) { + skipping[i] = null; + } + } + }, + }; +} + +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ +export function visitWithTypeInfo( + typeInfo: TypeInfo, + visitor: Visitor, +): Visitor { + return { + enter(node) { + typeInfo.enter(node); + const fn = getVisitFn(visitor, node.kind, /* isLeaving */ false); + if (fn) { + const result = fn.apply(visitor, arguments); + if (result !== undefined) { + typeInfo.leave(node); + if (isNode(result)) { + typeInfo.enter(result); + } + } + return result; + } + }, + leave(node) { + const fn = getVisitFn(visitor, node.kind, /* isLeaving */ true); + let result; + if (fn) { + result = fn.apply(visitor, arguments); + } + typeInfo.leave(node); + return result; + }, + }; +} + +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. + */ +export function getVisitFn( + visitor: Visitor, + kind: string, + isLeaving: boolean, +): ?VisitFn { + const kindVisitor = visitor[kind]; + if (kindVisitor) { + if (!isLeaving && typeof kindVisitor === 'function') { + // { Kind() {} } + return kindVisitor; + } + const kindSpecificVisitor = isLeaving + ? kindVisitor.leave + : kindVisitor.enter; + if (typeof kindSpecificVisitor === 'function') { + // { Kind: { enter() {}, leave() {} } } + return kindSpecificVisitor; + } + } else { + const specificVisitor = isLeaving ? visitor.leave : visitor.enter; + if (specificVisitor) { + if (typeof specificVisitor === 'function') { + // { enter() {}, leave() {} } + return specificVisitor; + } + const specificKindVisitor = specificVisitor[kind]; + if (typeof specificKindVisitor === 'function') { + // { enter: { Kind() {} }, leave: { Kind() {} } } + return specificKindVisitor; + } + } + } +} diff --git a/node_modules/graphql/language/visitor.mjs b/node_modules/graphql/language/visitor.mjs new file mode 100644 index 000000000..e2042ba96 --- /dev/null +++ b/node_modules/graphql/language/visitor.mjs @@ -0,0 +1,422 @@ +import inspect from '../jsutils/inspect'; +export var QueryDocumentKeys = { + Name: [], + Document: ['definitions'], + OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'], + VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], + Variable: ['name'], + SelectionSet: ['selections'], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + Argument: ['name', 'value'], + FragmentSpread: ['name', 'directives'], + InlineFragment: ['typeCondition', 'directives', 'selectionSet'], + FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'], + IntValue: [], + FloatValue: [], + StringValue: [], + BooleanValue: [], + NullValue: [], + EnumValue: [], + ListValue: ['values'], + ObjectValue: ['fields'], + ObjectField: ['name', 'value'], + Directive: ['name', 'arguments'], + NamedType: ['name'], + ListType: ['type'], + NonNullType: ['type'], + SchemaDefinition: ['directives', 'operationTypes'], + OperationTypeDefinition: ['type'], + ScalarTypeDefinition: ['description', 'name', 'directives'], + ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'], + FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'], + InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'], + InterfaceTypeDefinition: ['description', 'name', 'directives', 'fields'], + UnionTypeDefinition: ['description', 'name', 'directives', 'types'], + EnumTypeDefinition: ['description', 'name', 'directives', 'values'], + EnumValueDefinition: ['description', 'name', 'directives'], + InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'], + DirectiveDefinition: ['description', 'name', 'arguments', 'locations'], + SchemaExtension: ['directives', 'operationTypes'], + ScalarTypeExtension: ['name', 'directives'], + ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'], + InterfaceTypeExtension: ['name', 'directives', 'fields'], + UnionTypeExtension: ['name', 'directives', 'types'], + EnumTypeExtension: ['name', 'directives', 'values'], + InputObjectTypeExtension: ['name', 'directives', 'fields'] +}; +export var BREAK = Object.freeze({}); +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ + +export function visit(root, visitor) { + var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys; + + /* eslint-disable no-undef-init */ + var stack = undefined; + var inArray = Array.isArray(root); + var keys = [root]; + var index = -1; + var edits = []; + var node = undefined; + var key = undefined; + var parent = undefined; + var path = []; + var ancestors = []; + var newRoot = root; + /* eslint-enable no-undef-init */ + + do { + index++; + var isLeaving = index === keys.length; + var isEdited = isLeaving && edits.length !== 0; + + if (isLeaving) { + key = ancestors.length === 0 ? undefined : path[path.length - 1]; + node = parent; + parent = ancestors.pop(); + + if (isEdited) { + if (inArray) { + node = node.slice(); + } else { + var clone = {}; + + for (var _i = 0, _Object$keys = Object.keys(node); _i < _Object$keys.length; _i++) { + var k = _Object$keys[_i]; + clone[k] = node[k]; + } + + node = clone; + } + + var editOffset = 0; + + for (var ii = 0; ii < edits.length; ii++) { + var editKey = edits[ii][0]; + var editValue = edits[ii][1]; + + if (inArray) { + editKey -= editOffset; + } + + if (inArray && editValue === null) { + node.splice(editKey, 1); + editOffset++; + } else { + node[editKey] = editValue; + } + } + } + + index = stack.index; + keys = stack.keys; + edits = stack.edits; + inArray = stack.inArray; + stack = stack.prev; + } else { + key = parent ? inArray ? index : keys[index] : undefined; + node = parent ? parent[key] : newRoot; + + if (node === null || node === undefined) { + continue; + } + + if (parent) { + path.push(key); + } + } + + var result = void 0; + + if (!Array.isArray(node)) { + if (!isNode(node)) { + throw new Error('Invalid AST Node: ' + inspect(node)); + } + + var visitFn = getVisitFn(visitor, node.kind, isLeaving); + + if (visitFn) { + result = visitFn.call(visitor, node, key, parent, path, ancestors); + + if (result === BREAK) { + break; + } + + if (result === false) { + if (!isLeaving) { + path.pop(); + continue; + } + } else if (result !== undefined) { + edits.push([key, result]); + + if (!isLeaving) { + if (isNode(result)) { + node = result; + } else { + path.pop(); + continue; + } + } + } + } + } + + if (result === undefined && isEdited) { + edits.push([key, node]); + } + + if (isLeaving) { + path.pop(); + } else { + stack = { + inArray: inArray, + index: index, + keys: keys, + edits: edits, + prev: stack + }; + inArray = Array.isArray(node); + keys = inArray ? node : visitorKeys[node.kind] || []; + index = -1; + edits = []; + + if (parent) { + ancestors.push(parent); + } + + parent = node; + } + } while (stack !== undefined); + + if (edits.length !== 0) { + newRoot = edits[edits.length - 1][1]; + } + + return newRoot; +} + +function isNode(maybeNode) { + return Boolean(maybeNode && typeof maybeNode.kind === 'string'); +} +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ + + +export function visitInParallel(visitors) { + var skipping = new Array(visitors.length); + return { + enter: function enter(node) { + for (var i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + var fn = getVisitFn(visitors[i], node.kind, + /* isLeaving */ + false); + + if (fn) { + var result = fn.apply(visitors[i], arguments); + + if (result === false) { + skipping[i] = node; + } else if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined) { + return result; + } + } + } + } + }, + leave: function leave(node) { + for (var i = 0; i < visitors.length; i++) { + if (!skipping[i]) { + var fn = getVisitFn(visitors[i], node.kind, + /* isLeaving */ + true); + + if (fn) { + var result = fn.apply(visitors[i], arguments); + + if (result === BREAK) { + skipping[i] = BREAK; + } else if (result !== undefined && result !== false) { + return result; + } + } + } else if (skipping[i] === node) { + skipping[i] = null; + } + } + } + }; +} +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ + +export function visitWithTypeInfo(typeInfo, visitor) { + return { + enter: function enter(node) { + typeInfo.enter(node); + var fn = getVisitFn(visitor, node.kind, + /* isLeaving */ + false); + + if (fn) { + var result = fn.apply(visitor, arguments); + + if (result !== undefined) { + typeInfo.leave(node); + + if (isNode(result)) { + typeInfo.enter(result); + } + } + + return result; + } + }, + leave: function leave(node) { + var fn = getVisitFn(visitor, node.kind, + /* isLeaving */ + true); + var result; + + if (fn) { + result = fn.apply(visitor, arguments); + } + + typeInfo.leave(node); + return result; + } + }; +} +/** + * Given a visitor instance, if it is leaving or not, and a node kind, return + * the function the visitor runtime should call. + */ + +export function getVisitFn(visitor, kind, isLeaving) { + var kindVisitor = visitor[kind]; + + if (kindVisitor) { + if (!isLeaving && typeof kindVisitor === 'function') { + // { Kind() {} } + return kindVisitor; + } + + var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter; + + if (typeof kindSpecificVisitor === 'function') { + // { Kind: { enter() {}, leave() {} } } + return kindSpecificVisitor; + } + } else { + var specificVisitor = isLeaving ? visitor.leave : visitor.enter; + + if (specificVisitor) { + if (typeof specificVisitor === 'function') { + // { enter() {}, leave() {} } + return specificVisitor; + } + + var specificKindVisitor = specificVisitor[kind]; + + if (typeof specificKindVisitor === 'function') { + // { enter: { Kind() {} }, leave: { Kind() {} } } + return specificKindVisitor; + } + } + } +} diff --git a/node_modules/graphql/package.json b/node_modules/graphql/package.json new file mode 100644 index 000000000..416fb681d --- /dev/null +++ b/node_modules/graphql/package.json @@ -0,0 +1,27 @@ +{ + "name": "graphql", + "version": "14.4.2", + "description": "A Query Language and Runtime which can target any service.", + "license": "MIT", + "main": "index", + "module": "index.mjs", + "sideEffects": false, + "homepage": "https://github.com/graphql/graphql-js", + "bugs": { + "url": "https://github.com/graphql/graphql-js/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/graphql/graphql-js.git" + }, + "keywords": [ + "graphql", + "graphql-js" + ], + "engines": { + "node": ">= 6.x" + }, + "dependencies": { + "iterall": "^1.2.2" + } +} \ No newline at end of file diff --git a/node_modules/graphql/polyfills/find.js b/node_modules/graphql/polyfills/find.js new file mode 100644 index 000000000..28b17a0d2 --- /dev/null +++ b/node_modules/graphql/polyfills/find.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe +var find = Array.prototype.find ? function (list, predicate) { + return Array.prototype.find.call(list, predicate); +} : function (list, predicate) { + for (var i = 0; i < list.length; i++) { + var value = list[i]; + + if (predicate(value)) { + return value; + } + } +}; +var _default = find; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/find.js.flow b/node_modules/graphql/polyfills/find.js.flow new file mode 100644 index 000000000..feb0fca36 --- /dev/null +++ b/node_modules/graphql/polyfills/find.js.flow @@ -0,0 +1,22 @@ +// @flow strict + +declare function find( + list: $ReadOnlyArray, + predicate: (item: T) => boolean, +): T | void; + +/* eslint-disable no-redeclare */ +// $FlowFixMe +const find = Array.prototype.find + ? function(list, predicate) { + return Array.prototype.find.call(list, predicate); + } + : function(list, predicate) { + for (let i = 0; i < list.length; i++) { + const value = list[i]; + if (predicate(value)) { + return value; + } + } + }; +export default find; diff --git a/node_modules/graphql/polyfills/find.mjs b/node_modules/graphql/polyfills/find.mjs new file mode 100644 index 000000000..fd0e5ccf2 --- /dev/null +++ b/node_modules/graphql/polyfills/find.mjs @@ -0,0 +1,14 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe +var find = Array.prototype.find ? function (list, predicate) { + return Array.prototype.find.call(list, predicate); +} : function (list, predicate) { + for (var i = 0; i < list.length; i++) { + var value = list[i]; + + if (predicate(value)) { + return value; + } + } +}; +export default find; diff --git a/node_modules/graphql/polyfills/flatMap.js b/node_modules/graphql/polyfills/flatMap.js new file mode 100644 index 000000000..784db6eb8 --- /dev/null +++ b/node_modules/graphql/polyfills/flatMap.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe +var flatMap = Array.prototype.flatMap ? function (list, fn) { + // $FlowFixMe + return Array.prototype.flatMap.call(list, fn); +} : function (list, fn) { + var result = []; + + for (var i = 0; i < list.length; i++) { + var value = fn(list[i]); + + if (Array.isArray(value)) { + result = result.concat(value); + } else { + result.push(value); + } + } + + return result; +}; +var _default = flatMap; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/flatMap.js.flow b/node_modules/graphql/polyfills/flatMap.js.flow new file mode 100644 index 000000000..3dd212a10 --- /dev/null +++ b/node_modules/graphql/polyfills/flatMap.js.flow @@ -0,0 +1,27 @@ +// @flow strict + +declare function flatMap( + list: $ReadOnlyArray, + fn: (item: T, index: number) => $ReadOnlyArray | U, +): Array; + +/* eslint-disable no-redeclare */ +// $FlowFixMe +const flatMap = Array.prototype.flatMap + ? function(list, fn) { + // $FlowFixMe + return Array.prototype.flatMap.call(list, fn); + } + : function(list, fn) { + let result = []; + for (let i = 0; i < list.length; i++) { + const value = fn(list[i]); + if (Array.isArray(value)) { + result = result.concat(value); + } else { + result.push(value); + } + } + return result; + }; +export default flatMap; diff --git a/node_modules/graphql/polyfills/flatMap.mjs b/node_modules/graphql/polyfills/flatMap.mjs new file mode 100644 index 000000000..4923c9672 --- /dev/null +++ b/node_modules/graphql/polyfills/flatMap.mjs @@ -0,0 +1,21 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe +var flatMap = Array.prototype.flatMap ? function (list, fn) { + // $FlowFixMe + return Array.prototype.flatMap.call(list, fn); +} : function (list, fn) { + var result = []; + + for (var i = 0; i < list.length; i++) { + var value = fn(list[i]); + + if (Array.isArray(value)) { + result = result.concat(value); + } else { + result.push(value); + } + } + + return result; +}; +export default flatMap; diff --git a/node_modules/graphql/polyfills/isFinite.js b/node_modules/graphql/polyfills/isFinite.js new file mode 100644 index 000000000..e70e9abd7 --- /dev/null +++ b/node_modules/graphql/polyfills/isFinite.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +var isFinite = Number.isFinite || function (value) { + return typeof value === 'number' && isFinite(value); +}; + +var _default = isFinite; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/isFinite.js.flow b/node_modules/graphql/polyfills/isFinite.js.flow new file mode 100644 index 000000000..62edbac5c --- /dev/null +++ b/node_modules/graphql/polyfills/isFinite.js.flow @@ -0,0 +1,13 @@ +// @flow strict + +declare function isFinite(value: mixed): boolean %checks(typeof value === + 'number'); + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +const isFinite = + Number.isFinite || + function(value) { + return typeof value === 'number' && isFinite(value); + }; +export default isFinite; diff --git a/node_modules/graphql/polyfills/isFinite.mjs b/node_modules/graphql/polyfills/isFinite.mjs new file mode 100644 index 000000000..f7b6e4867 --- /dev/null +++ b/node_modules/graphql/polyfills/isFinite.mjs @@ -0,0 +1,7 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +var isFinite = Number.isFinite || function (value) { + return typeof value === 'number' && isFinite(value); +}; + +export default isFinite; diff --git a/node_modules/graphql/polyfills/isInteger.js b/node_modules/graphql/polyfills/isInteger.js new file mode 100644 index 000000000..3e90e1c1b --- /dev/null +++ b/node_modules/graphql/polyfills/isInteger.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +var isInteger = Number.isInteger || function (value) { + return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; +}; + +var _default = isInteger; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/isInteger.js.flow b/node_modules/graphql/polyfills/isInteger.js.flow new file mode 100644 index 000000000..f4c4639ca --- /dev/null +++ b/node_modules/graphql/polyfills/isInteger.js.flow @@ -0,0 +1,17 @@ +// @flow strict + +declare function isInteger(value: mixed): boolean %checks(typeof value === + 'number'); + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +const isInteger = + Number.isInteger || + function(value) { + return ( + typeof value === 'number' && + isFinite(value) && + Math.floor(value) === value + ); + }; +export default isInteger; diff --git a/node_modules/graphql/polyfills/isInteger.mjs b/node_modules/graphql/polyfills/isInteger.mjs new file mode 100644 index 000000000..6c8033d5f --- /dev/null +++ b/node_modules/graphql/polyfills/isInteger.mjs @@ -0,0 +1,7 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441 +var isInteger = Number.isInteger || function (value) { + return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; +}; + +export default isInteger; diff --git a/node_modules/graphql/polyfills/objectEntries.js b/node_modules/graphql/polyfills/objectEntries.js new file mode 100644 index 000000000..856dba3a4 --- /dev/null +++ b/node_modules/graphql/polyfills/objectEntries.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/5838 +var objectEntries = Object.entries || function (obj) { + return Object.keys(obj).map(function (key) { + return [key, obj[key]]; + }); +}; + +var _default = objectEntries; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/objectEntries.js.flow b/node_modules/graphql/polyfills/objectEntries.js.flow new file mode 100644 index 000000000..ba4f5e1e7 --- /dev/null +++ b/node_modules/graphql/polyfills/objectEntries.js.flow @@ -0,0 +1,12 @@ +// @flow strict + +import { type ObjMap } from '../jsutils/ObjMap'; + +declare function objectEntries(obj: ObjMap): Array<[string, T]>; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/5838 +const objectEntries = + Object.entries || (obj => Object.keys(obj).map(key => [key, obj[key]])); + +export default objectEntries; diff --git a/node_modules/graphql/polyfills/objectEntries.mjs b/node_modules/graphql/polyfills/objectEntries.mjs new file mode 100644 index 000000000..a4767a564 --- /dev/null +++ b/node_modules/graphql/polyfills/objectEntries.mjs @@ -0,0 +1,9 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/5838 +var objectEntries = Object.entries || function (obj) { + return Object.keys(obj).map(function (key) { + return [key, obj[key]]; + }); +}; + +export default objectEntries; diff --git a/node_modules/graphql/polyfills/objectValues.js b/node_modules/graphql/polyfills/objectValues.js new file mode 100644 index 000000000..28282c4a9 --- /dev/null +++ b/node_modules/graphql/polyfills/objectValues.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/2221 +var objectValues = Object.values || function (obj) { + return Object.keys(obj).map(function (key) { + return obj[key]; + }); +}; + +var _default = objectValues; +exports.default = _default; diff --git a/node_modules/graphql/polyfills/objectValues.js.flow b/node_modules/graphql/polyfills/objectValues.js.flow new file mode 100644 index 000000000..8f1d65f52 --- /dev/null +++ b/node_modules/graphql/polyfills/objectValues.js.flow @@ -0,0 +1,11 @@ +// @flow strict + +import { type ObjMap } from '../jsutils/ObjMap'; + +declare function objectValues(obj: ObjMap): Array; + +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/2221 +const objectValues = + Object.values || (obj => Object.keys(obj).map(key => obj[key])); +export default objectValues; diff --git a/node_modules/graphql/polyfills/objectValues.mjs b/node_modules/graphql/polyfills/objectValues.mjs new file mode 100644 index 000000000..49092b435 --- /dev/null +++ b/node_modules/graphql/polyfills/objectValues.mjs @@ -0,0 +1,9 @@ +/* eslint-disable no-redeclare */ +// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/2221 +var objectValues = Object.values || function (obj) { + return Object.keys(obj).map(function (key) { + return obj[key]; + }); +}; + +export default objectValues; diff --git a/node_modules/graphql/subscription/asyncIteratorReject.js b/node_modules/graphql/subscription/asyncIteratorReject.js new file mode 100644 index 000000000..e0bbbd07e --- /dev/null +++ b/node_modules/graphql/subscription/asyncIteratorReject.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncIteratorReject; + +var _iterall = require("iterall"); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * Given an error, returns an AsyncIterable which will fail with that error. + * + * Similar to Promise.reject(error) + */ +function asyncIteratorReject(error) { + var isComplete = false; + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + + return _defineProperty({ + next: function next() { + var result = isComplete ? Promise.resolve({ + value: undefined, + done: true + }) : Promise.reject(error); + isComplete = true; + return result; + }, + return: function _return() { + isComplete = true; + return Promise.resolve({ + value: undefined, + done: true + }); + }, + throw: function _throw() { + isComplete = true; + return Promise.reject(error); + } + }, _iterall.$$asyncIterator, function () { + return this; + }); +} diff --git a/node_modules/graphql/subscription/asyncIteratorReject.js.flow b/node_modules/graphql/subscription/asyncIteratorReject.js.flow new file mode 100644 index 000000000..4dad88da4 --- /dev/null +++ b/node_modules/graphql/subscription/asyncIteratorReject.js.flow @@ -0,0 +1,34 @@ +// @flow strict + +import { $$asyncIterator } from 'iterall'; + +/** + * Given an error, returns an AsyncIterable which will fail with that error. + * + * Similar to Promise.reject(error) + */ +export default function asyncIteratorReject(error: Error): AsyncIterator { + let isComplete = false; + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + return ({ + next() { + const result = isComplete + ? Promise.resolve({ value: undefined, done: true }) + : Promise.reject(error); + isComplete = true; + return result; + }, + return() { + isComplete = true; + return Promise.resolve({ value: undefined, done: true }); + }, + throw() { + isComplete = true; + return Promise.reject(error); + }, + [$$asyncIterator]() { + return this; + }, + }: any); +} diff --git a/node_modules/graphql/subscription/asyncIteratorReject.mjs b/node_modules/graphql/subscription/asyncIteratorReject.mjs new file mode 100644 index 000000000..28a3a1779 --- /dev/null +++ b/node_modules/graphql/subscription/asyncIteratorReject.mjs @@ -0,0 +1,38 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { $$asyncIterator } from 'iterall'; +/** + * Given an error, returns an AsyncIterable which will fail with that error. + * + * Similar to Promise.reject(error) + */ + +export default function asyncIteratorReject(error) { + var isComplete = false; + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + + return _defineProperty({ + next: function next() { + var result = isComplete ? Promise.resolve({ + value: undefined, + done: true + }) : Promise.reject(error); + isComplete = true; + return result; + }, + return: function _return() { + isComplete = true; + return Promise.resolve({ + value: undefined, + done: true + }); + }, + throw: function _throw() { + isComplete = true; + return Promise.reject(error); + } + }, $$asyncIterator, function () { + return this; + }); +} diff --git a/node_modules/graphql/subscription/index.js b/node_modules/graphql/subscription/index.js new file mode 100644 index 000000000..ec052a65c --- /dev/null +++ b/node_modules/graphql/subscription/index.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "subscribe", { + enumerable: true, + get: function get() { + return _subscribe.subscribe; + } +}); +Object.defineProperty(exports, "createSourceEventStream", { + enumerable: true, + get: function get() { + return _subscribe.createSourceEventStream; + } +}); + +var _subscribe = require("./subscribe"); diff --git a/node_modules/graphql/subscription/index.js.flow b/node_modules/graphql/subscription/index.js.flow new file mode 100644 index 000000000..45645edb8 --- /dev/null +++ b/node_modules/graphql/subscription/index.js.flow @@ -0,0 +1,4 @@ +// @flow strict + +export { subscribe, createSourceEventStream } from './subscribe'; +export type { SubscriptionArgs } from './subscribe'; diff --git a/node_modules/graphql/subscription/index.mjs b/node_modules/graphql/subscription/index.mjs new file mode 100644 index 000000000..11b0a7f26 --- /dev/null +++ b/node_modules/graphql/subscription/index.mjs @@ -0,0 +1 @@ +export { subscribe, createSourceEventStream } from './subscribe'; diff --git a/node_modules/graphql/subscription/mapAsyncIterator.js b/node_modules/graphql/subscription/mapAsyncIterator.js new file mode 100644 index 000000000..1a18fd695 --- /dev/null +++ b/node_modules/graphql/subscription/mapAsyncIterator.js @@ -0,0 +1,85 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapAsyncIterator; + +var _iterall = require("iterall"); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +function mapAsyncIterator(iterable, callback, rejectCallback) { + var iterator = (0, _iterall.getAsyncIterator)(iterable); + var $return; + var abruptClose; // $FlowFixMe(>=0.68.0) + + if (typeof iterator.return === 'function') { + $return = iterator.return; + + abruptClose = function abruptClose(error) { + var rethrow = function rethrow() { + return Promise.reject(error); + }; + + return $return.call(iterator).then(rethrow, rethrow); + }; + } + + function mapResult(result) { + return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose); + } + + var mapReject; + + if (rejectCallback) { + // Capture rejectCallback to ensure it cannot be null. + var reject = rejectCallback; + + mapReject = function mapReject(error) { + return asyncMapValue(error, reject).then(iteratorResult, abruptClose); + }; + } + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + + + return _defineProperty({ + next: function next() { + return iterator.next().then(mapResult, mapReject); + }, + return: function _return() { + return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({ + value: undefined, + done: true + }); + }, + throw: function _throw(error) { + // $FlowFixMe(>=0.68.0) + if (typeof iterator.throw === 'function') { + return iterator.throw(error).then(mapResult, mapReject); + } + + return Promise.reject(error).catch(abruptClose); + } + }, _iterall.$$asyncIterator, function () { + return this; + }); +} + +function asyncMapValue(value, callback) { + return new Promise(function (resolve) { + return resolve(callback(value)); + }); +} + +function iteratorResult(value) { + return { + value: value, + done: false + }; +} diff --git a/node_modules/graphql/subscription/mapAsyncIterator.js.flow b/node_modules/graphql/subscription/mapAsyncIterator.js.flow new file mode 100644 index 000000000..d28bcd789 --- /dev/null +++ b/node_modules/graphql/subscription/mapAsyncIterator.js.flow @@ -0,0 +1,74 @@ +// @flow strict + +import { $$asyncIterator, getAsyncIterator } from 'iterall'; +import { type PromiseOrValue } from '../jsutils/PromiseOrValue'; + +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export default function mapAsyncIterator( + iterable: AsyncIterable, + callback: T => PromiseOrValue, + rejectCallback?: any => PromiseOrValue, +): AsyncGenerator { + const iterator = getAsyncIterator(iterable); + let $return; + let abruptClose; + // $FlowFixMe(>=0.68.0) + if (typeof iterator.return === 'function') { + $return = iterator.return; + abruptClose = error => { + const rethrow = () => Promise.reject(error); + return $return.call(iterator).then(rethrow, rethrow); + }; + } + + function mapResult(result) { + return result.done + ? result + : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose); + } + + let mapReject; + if (rejectCallback) { + // Capture rejectCallback to ensure it cannot be null. + const reject = rejectCallback; + mapReject = error => + asyncMapValue(error, reject).then(iteratorResult, abruptClose); + } + + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + return ({ + next() { + return iterator.next().then(mapResult, mapReject); + }, + return() { + return $return + ? $return.call(iterator).then(mapResult, mapReject) + : Promise.resolve({ value: undefined, done: true }); + }, + throw(error) { + // $FlowFixMe(>=0.68.0) + if (typeof iterator.throw === 'function') { + return iterator.throw(error).then(mapResult, mapReject); + } + return Promise.reject(error).catch(abruptClose); + }, + [$$asyncIterator]() { + return this; + }, + }: any); +} + +function asyncMapValue( + value: T, + callback: T => PromiseOrValue, +): Promise { + return new Promise(resolve => resolve(callback(value))); +} + +function iteratorResult(value: T): IteratorResult { + return { value, done: false }; +} diff --git a/node_modules/graphql/subscription/mapAsyncIterator.mjs b/node_modules/graphql/subscription/mapAsyncIterator.mjs new file mode 100644 index 000000000..9a8840715 --- /dev/null +++ b/node_modules/graphql/subscription/mapAsyncIterator.mjs @@ -0,0 +1,78 @@ +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { $$asyncIterator, getAsyncIterator } from 'iterall'; + +/** + * Given an AsyncIterable and a callback function, return an AsyncIterator + * which produces values mapped via calling the callback function. + */ +export default function mapAsyncIterator(iterable, callback, rejectCallback) { + var iterator = getAsyncIterator(iterable); + var $return; + var abruptClose; // $FlowFixMe(>=0.68.0) + + if (typeof iterator.return === 'function') { + $return = iterator.return; + + abruptClose = function abruptClose(error) { + var rethrow = function rethrow() { + return Promise.reject(error); + }; + + return $return.call(iterator).then(rethrow, rethrow); + }; + } + + function mapResult(result) { + return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose); + } + + var mapReject; + + if (rejectCallback) { + // Capture rejectCallback to ensure it cannot be null. + var reject = rejectCallback; + + mapReject = function mapReject(error) { + return asyncMapValue(error, reject).then(iteratorResult, abruptClose); + }; + } + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + + + return _defineProperty({ + next: function next() { + return iterator.next().then(mapResult, mapReject); + }, + return: function _return() { + return $return ? $return.call(iterator).then(mapResult, mapReject) : Promise.resolve({ + value: undefined, + done: true + }); + }, + throw: function _throw(error) { + // $FlowFixMe(>=0.68.0) + if (typeof iterator.throw === 'function') { + return iterator.throw(error).then(mapResult, mapReject); + } + + return Promise.reject(error).catch(abruptClose); + } + }, $$asyncIterator, function () { + return this; + }); +} + +function asyncMapValue(value, callback) { + return new Promise(function (resolve) { + return resolve(callback(value)); + }); +} + +function iteratorResult(value) { + return { + value: value, + done: false + }; +} diff --git a/node_modules/graphql/subscription/subscribe.js b/node_modules/graphql/subscription/subscribe.js new file mode 100644 index 000000000..e14db74ab --- /dev/null +++ b/node_modules/graphql/subscription/subscribe.js @@ -0,0 +1,160 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.subscribe = subscribe; +exports.createSourceEventStream = createSourceEventStream; + +var _iterall = require("iterall"); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _GraphQLError = require("../error/GraphQLError"); + +var _locatedError = require("../error/locatedError"); + +var _execute = require("../execution/execute"); + +var _mapAsyncIterator = _interopRequireDefault(require("./mapAsyncIterator")); + +var _getOperationRootType = require("../utilities/getOperationRootType"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function subscribe(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 ? subscribeImpl(argsOrSchema) : subscribeImpl({ + schema: argsOrSchema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + subscribeFieldResolver: subscribeFieldResolver + }); +} +/** + * This function checks if the error is a GraphQLError. If it is, report it as + * an ExecutionResult, containing only errors and no data. Otherwise treat the + * error as a system-class error and re-throw it. + */ + + +function reportGraphQLError(error) { + if (error instanceof _GraphQLError.GraphQLError) { + return { + errors: [error] + }; + } + + throw error; +} + +function subscribeImpl(args) { + var schema = args.schema, + document = args.document, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + subscribeFieldResolver = args.subscribeFieldResolver; + var sourcePromise = createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); // For each payload yielded from a subscription, map it over the normal + // GraphQL `execute` function, with `payload` as the rootValue. + // This implements the "MapSourceToResponseEvent" algorithm described in + // the GraphQL specification. The `execute` function provides the + // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the + // "ExecuteQuery" algorithm, for which `execute` is also used. + + var mapSourceToResponse = function mapSourceToResponse(payload) { + return (0, _execute.execute)(schema, document, payload, contextValue, variableValues, operationName, fieldResolver); + }; // Resolve the Source Stream, then map every source value to a + // ExecutionResult value as described above. + + + return sourcePromise.then(function (resultOrStream) { + return (// Note: Flow can't refine isAsyncIterable, so explicit casts are used. + (0, _iterall.isAsyncIterable)(resultOrStream) ? (0, _mapAsyncIterator.default)(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream + ); + }, reportGraphQLError); +} +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ + + +function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver) { + // If arguments are missing or incorrectly typed, this is an internal + // developer mistake which should throw an early error. + (0, _execute.assertValidExecutionArguments)(schema, document, variableValues); + + try { + // If a valid context cannot be created due to incorrect arguments, + // this will throw an error. + var exeContext = (0, _execute.buildExecutionContext)(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver); // Return early errors if execution context failed. + + if (Array.isArray(exeContext)) { + return Promise.resolve({ + errors: exeContext + }); + } + + var type = (0, _getOperationRootType.getOperationRootType)(schema, exeContext.operation); + var fields = (0, _execute.collectFields)(exeContext, type, exeContext.operation.selectionSet, Object.create(null), Object.create(null)); + var responseNames = Object.keys(fields); + var responseName = responseNames[0]; + var fieldNodes = fields[responseName]; + var fieldNode = fieldNodes[0]; + var fieldName = fieldNode.name.value; + var fieldDef = (0, _execute.getFieldDef)(schema, type, fieldName); + + if (!fieldDef) { + throw new _GraphQLError.GraphQLError("The subscription field \"".concat(fieldName, "\" is not defined."), fieldNodes); + } // Call the `subscribe()` resolver or the default resolver to produce an + // AsyncIterable yielding raw payloads. + + + var resolveFn = fieldDef.subscribe || exeContext.fieldResolver; + var path = (0, _execute.addPath)(undefined, responseName); + var info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path); // resolveFieldValueOrError implements the "ResolveFieldEventStream" + // algorithm from GraphQL specification. It differs from + // "ResolveFieldValue" due to providing a different `resolveFn`. + + var result = (0, _execute.resolveFieldValueOrError)(exeContext, fieldDef, fieldNodes, resolveFn, rootValue, info); // Coerce to Promise for easier error handling and consistent return type. + + return Promise.resolve(result).then(function (eventStream) { + // If eventStream is an Error, rethrow a located error. + if (eventStream instanceof Error) { + throw (0, _locatedError.locatedError)(eventStream, fieldNodes, (0, _execute.responsePathAsArray)(path)); + } // Assert field returned an event stream, otherwise yield an error. + + + if ((0, _iterall.isAsyncIterable)(eventStream)) { + // Note: isAsyncIterable above ensures this will be correct. + return eventStream; + } + + throw new Error('Subscription field must return Async Iterable. Received: ' + (0, _inspect.default)(eventStream)); + }); + } catch (error) { + return Promise.reject(error); + } +} diff --git a/node_modules/graphql/subscription/subscribe.js.flow b/node_modules/graphql/subscription/subscribe.js.flow new file mode 100644 index 000000000..9c33d6f4e --- /dev/null +++ b/node_modules/graphql/subscription/subscribe.js.flow @@ -0,0 +1,278 @@ +// @flow strict + +import { isAsyncIterable } from 'iterall'; +import inspect from '../jsutils/inspect'; +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; +import { + type ExecutionResult, + addPath, + assertValidExecutionArguments, + buildExecutionContext, + buildResolveInfo, + collectFields, + execute, + getFieldDef, + resolveFieldValueOrError, + responsePathAsArray, +} from '../execution/execute'; +import { type GraphQLSchema } from '../type/schema'; +import mapAsyncIterator from './mapAsyncIterator'; + +import { type DocumentNode } from '../language/ast'; +import { type GraphQLFieldResolver } from '../type/definition'; +import { getOperationRootType } from '../utilities/getOperationRootType'; + +export type SubscriptionArgs = {| + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + subscribeFieldResolver?: ?GraphQLFieldResolver, +|}; + +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (client error). The promise will be rejected if a + * server error occurs. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ +declare function subscribe( + SubscriptionArgs, + ..._: [] +): Promise | ExecutionResult>; +/* eslint-disable no-redeclare */ +declare function subscribe( + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, + subscribeFieldResolver?: ?GraphQLFieldResolver, +): Promise | ExecutionResult>; +export function subscribe( + argsOrSchema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + subscribeFieldResolver, +) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 + ? subscribeImpl(argsOrSchema) + : subscribeImpl({ + schema: argsOrSchema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + subscribeFieldResolver, + }); +} + +/** + * This function checks if the error is a GraphQLError. If it is, report it as + * an ExecutionResult, containing only errors and no data. Otherwise treat the + * error as a system-class error and re-throw it. + */ +function reportGraphQLError(error) { + if (error instanceof GraphQLError) { + return { errors: [error] }; + } + throw error; +} + +function subscribeImpl( + args: SubscriptionArgs, +): Promise | ExecutionResult> { + const { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + subscribeFieldResolver, + } = args; + + const sourcePromise = createSourceEventStream( + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + subscribeFieldResolver, + ); + + // For each payload yielded from a subscription, map it over the normal + // GraphQL `execute` function, with `payload` as the rootValue. + // This implements the "MapSourceToResponseEvent" algorithm described in + // the GraphQL specification. The `execute` function provides the + // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the + // "ExecuteQuery" algorithm, for which `execute` is also used. + const mapSourceToResponse = payload => + execute( + schema, + document, + payload, + contextValue, + variableValues, + operationName, + fieldResolver, + ); + + // Resolve the Source Stream, then map every source value to a + // ExecutionResult value as described above. + return sourcePromise.then( + resultOrStream => + // Note: Flow can't refine isAsyncIterable, so explicit casts are used. + isAsyncIterable(resultOrStream) + ? mapAsyncIterator( + ((resultOrStream: any): AsyncIterable), + mapSourceToResponse, + reportGraphQLError, + ) + : ((resultOrStream: any): ExecutionResult), + reportGraphQLError, + ); +} + +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ +export function createSourceEventStream( + schema: GraphQLSchema, + document: DocumentNode, + rootValue?: mixed, + contextValue?: mixed, + variableValues?: ?{ +[variable: string]: mixed, ... }, + operationName?: ?string, + fieldResolver?: ?GraphQLFieldResolver, +): Promise | ExecutionResult> { + // If arguments are missing or incorrectly typed, this is an internal + // developer mistake which should throw an early error. + assertValidExecutionArguments(schema, document, variableValues); + + try { + // If a valid context cannot be created due to incorrect arguments, + // this will throw an error. + const exeContext = buildExecutionContext( + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + ); + + // Return early errors if execution context failed. + if (Array.isArray(exeContext)) { + return Promise.resolve({ errors: exeContext }); + } + + const type = getOperationRootType(schema, exeContext.operation); + const fields = collectFields( + exeContext, + type, + exeContext.operation.selectionSet, + Object.create(null), + Object.create(null), + ); + const responseNames = Object.keys(fields); + const responseName = responseNames[0]; + const fieldNodes = fields[responseName]; + const fieldNode = fieldNodes[0]; + const fieldName = fieldNode.name.value; + const fieldDef = getFieldDef(schema, type, fieldName); + + if (!fieldDef) { + throw new GraphQLError( + `The subscription field "${fieldName}" is not defined.`, + fieldNodes, + ); + } + + // Call the `subscribe()` resolver or the default resolver to produce an + // AsyncIterable yielding raw payloads. + const resolveFn = fieldDef.subscribe || exeContext.fieldResolver; + + const path = addPath(undefined, responseName); + + const info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); + + // resolveFieldValueOrError implements the "ResolveFieldEventStream" + // algorithm from GraphQL specification. It differs from + // "ResolveFieldValue" due to providing a different `resolveFn`. + const result = resolveFieldValueOrError( + exeContext, + fieldDef, + fieldNodes, + resolveFn, + rootValue, + info, + ); + + // Coerce to Promise for easier error handling and consistent return type. + return Promise.resolve(result).then(eventStream => { + // If eventStream is an Error, rethrow a located error. + if (eventStream instanceof Error) { + throw locatedError(eventStream, fieldNodes, responsePathAsArray(path)); + } + + // Assert field returned an event stream, otherwise yield an error. + if (isAsyncIterable(eventStream)) { + // Note: isAsyncIterable above ensures this will be correct. + return ((eventStream: any): AsyncIterable); + } + throw new Error( + 'Subscription field must return Async Iterable. Received: ' + + inspect(eventStream), + ); + }); + } catch (error) { + return Promise.reject(error); + } +} diff --git a/node_modules/graphql/subscription/subscribe.mjs b/node_modules/graphql/subscription/subscribe.mjs new file mode 100644 index 000000000..3061ed6b4 --- /dev/null +++ b/node_modules/graphql/subscription/subscribe.mjs @@ -0,0 +1,142 @@ +import { isAsyncIterable } from 'iterall'; +import inspect from '../jsutils/inspect'; +import { GraphQLError } from '../error/GraphQLError'; +import { locatedError } from '../error/locatedError'; +import { addPath, assertValidExecutionArguments, buildExecutionContext, buildResolveInfo, collectFields, execute, getFieldDef, resolveFieldValueOrError, responsePathAsArray } from '../execution/execute'; +import mapAsyncIterator from './mapAsyncIterator'; +import { getOperationRootType } from '../utilities/getOperationRootType'; +export function subscribe(argsOrSchema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, subscribeFieldResolver) { + /* eslint-enable no-redeclare */ + // Extract arguments from object args if provided. + return arguments.length === 1 ? subscribeImpl(argsOrSchema) : subscribeImpl({ + schema: argsOrSchema, + document: document, + rootValue: rootValue, + contextValue: contextValue, + variableValues: variableValues, + operationName: operationName, + fieldResolver: fieldResolver, + subscribeFieldResolver: subscribeFieldResolver + }); +} +/** + * This function checks if the error is a GraphQLError. If it is, report it as + * an ExecutionResult, containing only errors and no data. Otherwise treat the + * error as a system-class error and re-throw it. + */ + +function reportGraphQLError(error) { + if (error instanceof GraphQLError) { + return { + errors: [error] + }; + } + + throw error; +} + +function subscribeImpl(args) { + var schema = args.schema, + document = args.document, + rootValue = args.rootValue, + contextValue = args.contextValue, + variableValues = args.variableValues, + operationName = args.operationName, + fieldResolver = args.fieldResolver, + subscribeFieldResolver = args.subscribeFieldResolver; + var sourcePromise = createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); // For each payload yielded from a subscription, map it over the normal + // GraphQL `execute` function, with `payload` as the rootValue. + // This implements the "MapSourceToResponseEvent" algorithm described in + // the GraphQL specification. The `execute` function provides the + // "ExecuteSubscriptionEvent" algorithm, as it is nearly identical to the + // "ExecuteQuery" algorithm, for which `execute` is also used. + + var mapSourceToResponse = function mapSourceToResponse(payload) { + return execute(schema, document, payload, contextValue, variableValues, operationName, fieldResolver); + }; // Resolve the Source Stream, then map every source value to a + // ExecutionResult value as described above. + + + return sourcePromise.then(function (resultOrStream) { + return (// Note: Flow can't refine isAsyncIterable, so explicit casts are used. + isAsyncIterable(resultOrStream) ? mapAsyncIterator(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream + ); + }, reportGraphQLError); +} +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ + + +export function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver) { + // If arguments are missing or incorrectly typed, this is an internal + // developer mistake which should throw an early error. + assertValidExecutionArguments(schema, document, variableValues); + + try { + // If a valid context cannot be created due to incorrect arguments, + // this will throw an error. + var exeContext = buildExecutionContext(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver); // Return early errors if execution context failed. + + if (Array.isArray(exeContext)) { + return Promise.resolve({ + errors: exeContext + }); + } + + var type = getOperationRootType(schema, exeContext.operation); + var fields = collectFields(exeContext, type, exeContext.operation.selectionSet, Object.create(null), Object.create(null)); + var responseNames = Object.keys(fields); + var responseName = responseNames[0]; + var fieldNodes = fields[responseName]; + var fieldNode = fieldNodes[0]; + var fieldName = fieldNode.name.value; + var fieldDef = getFieldDef(schema, type, fieldName); + + if (!fieldDef) { + throw new GraphQLError("The subscription field \"".concat(fieldName, "\" is not defined."), fieldNodes); + } // Call the `subscribe()` resolver or the default resolver to produce an + // AsyncIterable yielding raw payloads. + + + var resolveFn = fieldDef.subscribe || exeContext.fieldResolver; + var path = addPath(undefined, responseName); + var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); // resolveFieldValueOrError implements the "ResolveFieldEventStream" + // algorithm from GraphQL specification. It differs from + // "ResolveFieldValue" due to providing a different `resolveFn`. + + var result = resolveFieldValueOrError(exeContext, fieldDef, fieldNodes, resolveFn, rootValue, info); // Coerce to Promise for easier error handling and consistent return type. + + return Promise.resolve(result).then(function (eventStream) { + // If eventStream is an Error, rethrow a located error. + if (eventStream instanceof Error) { + throw locatedError(eventStream, fieldNodes, responsePathAsArray(path)); + } // Assert field returned an event stream, otherwise yield an error. + + + if (isAsyncIterable(eventStream)) { + // Note: isAsyncIterable above ensures this will be correct. + return eventStream; + } + + throw new Error('Subscription field must return Async Iterable. Received: ' + inspect(eventStream)); + }); + } catch (error) { + return Promise.reject(error); + } +} diff --git a/node_modules/graphql/type/definition.js b/node_modules/graphql/type/definition.js new file mode 100644 index 000000000..21ec923bf --- /dev/null +++ b/node_modules/graphql/type/definition.js @@ -0,0 +1,989 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isType = isType; +exports.assertType = assertType; +exports.isScalarType = isScalarType; +exports.assertScalarType = assertScalarType; +exports.isObjectType = isObjectType; +exports.assertObjectType = assertObjectType; +exports.isInterfaceType = isInterfaceType; +exports.assertInterfaceType = assertInterfaceType; +exports.isUnionType = isUnionType; +exports.assertUnionType = assertUnionType; +exports.isEnumType = isEnumType; +exports.assertEnumType = assertEnumType; +exports.isInputObjectType = isInputObjectType; +exports.assertInputObjectType = assertInputObjectType; +exports.isListType = isListType; +exports.assertListType = assertListType; +exports.isNonNullType = isNonNullType; +exports.assertNonNullType = assertNonNullType; +exports.isInputType = isInputType; +exports.assertInputType = assertInputType; +exports.isOutputType = isOutputType; +exports.assertOutputType = assertOutputType; +exports.isLeafType = isLeafType; +exports.assertLeafType = assertLeafType; +exports.isCompositeType = isCompositeType; +exports.assertCompositeType = assertCompositeType; +exports.isAbstractType = isAbstractType; +exports.assertAbstractType = assertAbstractType; +exports.GraphQLList = GraphQLList; +exports.GraphQLNonNull = GraphQLNonNull; +exports.isWrappingType = isWrappingType; +exports.assertWrappingType = assertWrappingType; +exports.isNullableType = isNullableType; +exports.assertNullableType = assertNullableType; +exports.getNullableType = getNullableType; +exports.isNamedType = isNamedType; +exports.assertNamedType = assertNamedType; +exports.getNamedType = getNamedType; +exports.argsToArgsConfig = argsToArgsConfig; +exports.isRequiredArgument = isRequiredArgument; +exports.isRequiredInputField = isRequiredInputField; +exports.GraphQLInputObjectType = exports.GraphQLEnumType = exports.GraphQLUnionType = exports.GraphQLInterfaceType = exports.GraphQLObjectType = exports.GraphQLScalarType = void 0; + +var _objectEntries = _interopRequireDefault(require("../polyfills/objectEntries")); + +var _defineToJSON = _interopRequireDefault(require("../jsutils/defineToJSON")); + +var _defineToStringTag = _interopRequireDefault(require("../jsutils/defineToStringTag")); + +var _identityFunc = _interopRequireDefault(require("../jsutils/identityFunc")); + +var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _keyMap = _interopRequireDefault(require("../jsutils/keyMap")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _mapValue = _interopRequireDefault(require("../jsutils/mapValue")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _kinds = require("../language/kinds"); + +var _valueFromASTUntyped = require("../utilities/valueFromASTUntyped"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function isType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); +} + +function assertType(type) { + !isType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL type.")) : void 0; + return type; +} +/** + * There are predicates for each kind of GraphQL type. + */ + + +// eslint-disable-next-line no-redeclare +function isScalarType(type) { + return (0, _instanceOf.default)(type, GraphQLScalarType); +} + +function assertScalarType(type) { + !isScalarType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isObjectType(type) { + return (0, _instanceOf.default)(type, GraphQLObjectType); +} + +function assertObjectType(type) { + !isObjectType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isInterfaceType(type) { + return (0, _instanceOf.default)(type, GraphQLInterfaceType); +} + +function assertInterfaceType(type) { + !isInterfaceType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Interface type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isUnionType(type) { + return (0, _instanceOf.default)(type, GraphQLUnionType); +} + +function assertUnionType(type) { + !isUnionType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isEnumType(type) { + return (0, _instanceOf.default)(type, GraphQLEnumType); +} + +function assertEnumType(type) { + !isEnumType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isInputObjectType(type) { + return (0, _instanceOf.default)(type, GraphQLInputObjectType); +} + +function assertInputObjectType(type) { + !isInputObjectType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isListType(type) { + return (0, _instanceOf.default)(type, GraphQLList); +} + +function assertListType(type) { + !isListType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL List type.")) : void 0; + return type; +} + +// eslint-disable-next-line no-redeclare +function isNonNullType(type) { + return (0, _instanceOf.default)(type, GraphQLNonNull); +} + +function assertNonNullType(type) { + !isNonNullType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Non-Null type.")) : void 0; + return type; +} +/** + * These types may be used as input types for arguments and directives. + */ + + +function isInputType(type) { + return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType); +} + +function assertInputType(type) { + !isInputType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL input type.")) : void 0; + return type; +} +/** + * These types may be used as output types as the result of fields. + */ + + +function isOutputType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType); +} + +function assertOutputType(type) { + !isOutputType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL output type.")) : void 0; + return type; +} +/** + * These types may describe types which may be leaf values. + */ + + +function isLeafType(type) { + return isScalarType(type) || isEnumType(type); +} + +function assertLeafType(type) { + !isLeafType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL leaf type.")) : void 0; + return type; +} +/** + * These types may describe the parent context of a selection set. + */ + + +function isCompositeType(type) { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} + +function assertCompositeType(type) { + !isCompositeType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL composite type.")) : void 0; + return type; +} +/** + * These types may describe the parent context of a selection set. + */ + + +function isAbstractType(type) { + return isInterfaceType(type) || isUnionType(type); +} + +function assertAbstractType(type) { + !isAbstractType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type.")) : void 0; + return type; +} +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: GraphQLList(PersonType) }, + * children: { type: GraphQLList(PersonType) }, + * }) + * }) + * + */ + + +// eslint-disable-next-line no-redeclare +function GraphQLList(ofType) { + if (this instanceof GraphQLList) { + this.ofType = assertType(ofType); + } else { + return new GraphQLList(ofType); + } +} // Need to cast through any to alter the prototype. + + +GraphQLList.prototype.toString = function toString() { + return '[' + String(this.ofType) + ']'; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +(0, _defineToStringTag.default)(GraphQLList); +(0, _defineToJSON.default)(GraphQLList); +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ + +// eslint-disable-next-line no-redeclare +function GraphQLNonNull(ofType) { + if (this instanceof GraphQLNonNull) { + this.ofType = assertNullableType(ofType); + } else { + return new GraphQLNonNull(ofType); + } +} // Need to cast through any to alter the prototype. + + +GraphQLNonNull.prototype.toString = function toString() { + return String(this.ofType) + '!'; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +(0, _defineToStringTag.default)(GraphQLNonNull); +(0, _defineToJSON.default)(GraphQLNonNull); +/** + * These types wrap and modify other types + */ + +function isWrappingType(type) { + return isListType(type) || isNonNullType(type); +} + +function assertWrappingType(type) { + !isWrappingType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL wrapping type.")) : void 0; + return type; +} +/** + * These types can all accept null as a value. + */ + + +function isNullableType(type) { + return isType(type) && !isNonNullType(type); +} + +function assertNullableType(type) { + !isNullableType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL nullable type.")) : void 0; + return type; +} +/* eslint-disable no-redeclare */ + + +function getNullableType(type) { + /* eslint-enable no-redeclare */ + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} +/** + * These named types do not include modifiers like List or NonNull. + */ + + +function isNamedType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type); +} + +function assertNamedType(type) { + !isNamedType(type) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(type), " to be a GraphQL named type.")) : void 0; + return type; +} +/* eslint-disable no-redeclare */ + + +function getNamedType(type) { + /* eslint-enable no-redeclare */ + if (type) { + var unwrappedType = type; + + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + + return unwrappedType; + } +} +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + */ + + +function resolveThunk(thunk) { + // $FlowFixMe(>=0.90.0) + return typeof thunk === 'function' ? thunk() : thunk; +} + +function undefineIfEmpty(arr) { + return arr && arr.length > 0 ? arr : undefined; +} +/** + * Scalar Type Definition + * + * The leaf values of any request and input values to arguments are + * Scalars (or Enums) and are defined with a name and a series of functions + * used to parse input from ast or variables and to ensure validity. + * + * If a type's serialize function does not return a value (i.e. it returns + * `undefined`) then an error will be raised and a `null` value will be returned + * in the response. If the serialize function returns `null`, then no error will + * be included in the response. + * + * Example: + * + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * serialize(value) { + * if (value % 2 === 1) { + * return value; + * } + * } + * }); + * + */ + + +var GraphQLScalarType = +/*#__PURE__*/ +function () { + function GraphQLScalarType(config) { + var _this = this; + + this.name = config.name; + this.description = config.description; + this.serialize = config.serialize || _identityFunc.default; + this.parseValue = config.parseValue || _identityFunc.default; + + this.parseLiteral = config.parseLiteral || function (node) { + return _this.parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node)); + }; + + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + !(config.serialize == null || typeof config.serialize === 'function') ? (0, _invariant.default)(0, "".concat(this.name, " must provide \"serialize\" function. If this custom Scalar is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" functions are also provided.")) : void 0; + + if (config.parseLiteral) { + !(typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function') ? (0, _invariant.default)(0, "".concat(this.name, " must provide both \"parseValue\" and \"parseLiteral\" functions.")) : void 0; + } + } + + var _proto = GraphQLScalarType.prototype; + + _proto.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto.toString = function toString() { + return this.name; + }; + + return GraphQLScalarType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLScalarType = GraphQLScalarType; +(0, _defineToStringTag.default)(GraphQLScalarType); +(0, _defineToJSON.default)(GraphQLScalarType); + +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * + * Example: + * + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve(obj) { + * return obj.number + ' ' + obj.street + * } + * } + * } + * }); + * + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }) + * }); + * + */ +var GraphQLObjectType = +/*#__PURE__*/ +function () { + function GraphQLObjectType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.isTypeOf = config.isTypeOf; + this._fields = defineFieldMap.bind(undefined, config); + this._interfaces = defineInterfaces.bind(undefined, config); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + !(config.isTypeOf == null || typeof config.isTypeOf === 'function') ? (0, _invariant.default)(0, "".concat(this.name, " must provide \"isTypeOf\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.isTypeOf), ".")) : void 0; + } + + var _proto2 = GraphQLObjectType.prototype; + + _proto2.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto2.getInterfaces = function getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + + return this._interfaces; + }; + + _proto2.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + isTypeOf: this.isTypeOf, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto2.toString = function toString() { + return this.name; + }; + + return GraphQLObjectType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLObjectType = GraphQLObjectType; +(0, _defineToStringTag.default)(GraphQLObjectType); +(0, _defineToJSON.default)(GraphQLObjectType); + +function defineInterfaces(config) { + var interfaces = resolveThunk(config.interfaces) || []; + !Array.isArray(interfaces) ? (0, _invariant.default)(0, "".concat(config.name, " interfaces must be an Array or a function which returns an Array.")) : void 0; + return interfaces; +} + +function defineFieldMap(config) { + var fieldMap = resolveThunk(config.fields) || {}; + !isPlainObj(fieldMap) ? (0, _invariant.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")) : void 0; + return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { + !isPlainObj(fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object")) : void 0; + !!('isDeprecated' in fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")) : void 0; + !(fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function') ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), ".")) : void 0; + var argsConfig = fieldConfig.args || {}; + !isPlainObj(argsConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument names as keys.")) : void 0; + var args = (0, _objectEntries.default)(argsConfig).map(function (_ref) { + var argName = _ref[0], + arg = _ref[1]; + return { + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode + }; + }); + return _objectSpread({}, fieldConfig, { + isDeprecated: Boolean(fieldConfig.deprecationReason), + name: fieldName, + args: args + }); + }); +} + +function isPlainObj(obj) { + return (0, _isObjectLike.default)(obj) && !Array.isArray(obj); +} + +function fieldsToFieldsConfig(fields) { + return (0, _mapValue.default)(fields, function (field) { + return { + type: field.type, + args: argsToArgsConfig(field.args), + resolve: field.resolve, + subscribe: field.subscribe, + deprecationReason: field.deprecationReason, + description: field.description, + astNode: field.astNode + }; + }); +} + +function argsToArgsConfig(args) { + return (0, _keyValMap.default)(args, function (arg) { + return arg.name; + }, function (arg) { + return { + type: arg.type, + defaultValue: arg.defaultValue, + description: arg.description, + astNode: arg.astNode + }; + }); +} + +function isRequiredArgument(arg) { + return isNonNullType(arg.type) && arg.defaultValue === undefined; +} + +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * + * Example: + * + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString } + * } + * }); + * + */ +var GraphQLInterfaceType = +/*#__PURE__*/ +function () { + function GraphQLInterfaceType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._fields = defineFieldMap.bind(undefined, config); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + !(config.resolveType == null || typeof config.resolveType === 'function') ? (0, _invariant.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")) : void 0; + } + + var _proto3 = GraphQLInterfaceType.prototype; + + _proto3.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto3.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto3.toString = function toString() { + return this.name; + }; + + return GraphQLInterfaceType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLInterfaceType = GraphQLInterfaceType; +(0, _defineToStringTag.default)(GraphQLInterfaceType); +(0, _defineToJSON.default)(GraphQLInterfaceType); + +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * + * Example: + * + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [ DogType, CatType ], + * resolveType(value) { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * } + * }); + * + */ +var GraphQLUnionType = +/*#__PURE__*/ +function () { + function GraphQLUnionType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._types = defineTypes.bind(undefined, config); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + !(config.resolveType == null || typeof config.resolveType === 'function') ? (0, _invariant.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")) : void 0; + } + + var _proto4 = GraphQLUnionType.prototype; + + _proto4.getTypes = function getTypes() { + if (typeof this._types === 'function') { + this._types = this._types(); + } + + return this._types; + }; + + _proto4.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + types: this.getTypes(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto4.toString = function toString() { + return this.name; + }; + + return GraphQLUnionType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLUnionType = GraphQLUnionType; +(0, _defineToStringTag.default)(GraphQLUnionType); +(0, _defineToJSON.default)(GraphQLUnionType); + +function defineTypes(config) { + var types = resolveThunk(config.types) || []; + !Array.isArray(types) ? (0, _invariant.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config.name, ".")) : void 0; + return types; +} + +/** + * Enum Type Definition + * + * Some leaf values of requests and input values are Enums. GraphQL serializes + * Enum values as strings, however internally Enums can be represented by any + * kind of type, often integers. + * + * Example: + * + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 } + * } + * }); + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +var GraphQLEnumType +/* */ += +/*#__PURE__*/ +function () { + function GraphQLEnumType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._values = defineEnumValues(this, config.values); + this._valueLookup = new Map(this._values.map(function (enumValue) { + return [enumValue.value, enumValue]; + })); + this._nameLookup = (0, _keyMap.default)(this._values, function (value) { + return value.name; + }); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + } + + var _proto5 = GraphQLEnumType.prototype; + + _proto5.getValues = function getValues() { + return this._values; + }; + + _proto5.getValue = function getValue(name) { + return this._nameLookup[name]; + }; + + _proto5.serialize = function serialize(value) { + var enumValue = this._valueLookup.get(value); + + if (enumValue) { + return enumValue.name; + } + }; + + _proto5.parseValue = function parseValue(value) + /* T */ + { + if (typeof value === 'string') { + var enumValue = this.getValue(value); + + if (enumValue) { + return enumValue.value; + } + } + }; + + _proto5.parseLiteral = function parseLiteral(valueNode, _variables) + /* T */ + { + // Note: variables will be resolved to a value before calling this function. + if (valueNode.kind === _kinds.Kind.ENUM) { + var enumValue = this.getValue(valueNode.value); + + if (enumValue) { + return enumValue.value; + } + } + }; + + _proto5.toConfig = function toConfig() { + var values = (0, _keyValMap.default)(this.getValues(), function (value) { + return value.name; + }, function (value) { + return { + description: value.description, + value: value.value, + deprecationReason: value.deprecationReason, + astNode: value.astNode + }; + }); + return { + name: this.name, + description: this.description, + values: values, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto5.toString = function toString() { + return this.name; + }; + + return GraphQLEnumType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLEnumType = GraphQLEnumType; +(0, _defineToStringTag.default)(GraphQLEnumType); +(0, _defineToJSON.default)(GraphQLEnumType); + +function defineEnumValues(type, valueMap) { + !isPlainObj(valueMap) ? (0, _invariant.default)(0, "".concat(type.name, " values must be an object with value names as keys.")) : void 0; + return (0, _objectEntries.default)(valueMap).map(function (_ref2) { + var valueName = _ref2[0], + value = _ref2[1]; + !isPlainObj(value) ? (0, _invariant.default)(0, "".concat(type.name, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat((0, _inspect.default)(value), ".")) : void 0; + !!('isDeprecated' in value) ? (0, _invariant.default)(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")) : void 0; + return { + name: valueName, + description: value.description, + isDeprecated: Boolean(value.deprecationReason), + deprecationReason: value.deprecationReason, + astNode: value.astNode, + value: 'value' in value ? value.value : valueName + }; + }); +} + +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * + * Example: + * + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: GraphQLNonNull(GraphQLFloat) }, + * lon: { type: GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, defaultValue: 0 }, + * } + * }); + * + */ +var GraphQLInputObjectType = +/*#__PURE__*/ +function () { + function GraphQLInputObjectType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._fields = defineInputFieldMap.bind(undefined, config); + !(typeof config.name === 'string') ? (0, _invariant.default)(0, 'Must provide name.') : void 0; + } + + var _proto6 = GraphQLInputObjectType.prototype; + + _proto6.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto6.toConfig = function toConfig() { + var fields = (0, _mapValue.default)(this.getFields(), function (field) { + return { + description: field.description, + type: field.type, + defaultValue: field.defaultValue, + astNode: field.astNode + }; + }); + return { + name: this.name, + description: this.description, + fields: fields, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto6.toString = function toString() { + return this.name; + }; + + return GraphQLInputObjectType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLInputObjectType = GraphQLInputObjectType; +(0, _defineToStringTag.default)(GraphQLInputObjectType); +(0, _defineToJSON.default)(GraphQLInputObjectType); + +function defineInputFieldMap(config) { + var fieldMap = resolveThunk(config.fields) || {}; + !isPlainObj(fieldMap) ? (0, _invariant.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")) : void 0; + return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { + !!('resolve' in fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers.")) : void 0; + return _objectSpread({}, fieldConfig, { + name: fieldName + }); + }); +} + +function isRequiredInputField(field) { + return isNonNullType(field.type) && field.defaultValue === undefined; +} diff --git a/node_modules/graphql/type/definition.js.flow b/node_modules/graphql/type/definition.js.flow new file mode 100644 index 000000000..5a899c417 --- /dev/null +++ b/node_modules/graphql/type/definition.js.flow @@ -0,0 +1,1415 @@ +// @flow strict + +import objectEntries from '../polyfills/objectEntries'; +import defineToJSON from '../jsutils/defineToJSON'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import identityFunc from '../jsutils/identityFunc'; +import instanceOf from '../jsutils/instanceOf'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import keyValMap from '../jsutils/keyValMap'; +import mapValue from '../jsutils/mapValue'; +import isObjectLike from '../jsutils/isObjectLike'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { Kind } from '../language/kinds'; +import { valueFromASTUntyped } from '../utilities/valueFromASTUntyped'; +import { + type ScalarTypeDefinitionNode, + type ObjectTypeDefinitionNode, + type FieldDefinitionNode, + type InputValueDefinitionNode, + type InterfaceTypeDefinitionNode, + type UnionTypeDefinitionNode, + type EnumTypeDefinitionNode, + type EnumValueDefinitionNode, + type InputObjectTypeDefinitionNode, + type ScalarTypeExtensionNode, + type ObjectTypeExtensionNode, + type InterfaceTypeExtensionNode, + type UnionTypeExtensionNode, + type EnumTypeExtensionNode, + type InputObjectTypeExtensionNode, + type OperationDefinitionNode, + type FieldNode, + type FragmentDefinitionNode, + type ValueNode, +} from '../language/ast'; +import { type GraphQLSchema } from './schema'; +import { type PromiseOrValue } from '../jsutils/PromiseOrValue'; + +// Predicates & Assertions + +/** + * These are all of the possible kinds of types. + */ +export type GraphQLType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull; + +export function isType(type: mixed): boolean %checks { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) || + isListType(type) || + isNonNullType(type) + ); +} + +export function assertType(type: mixed): GraphQLType { + invariant(isType(type), `Expected ${inspect(type)} to be a GraphQL type.`); + return type; +} + +/** + * There are predicates for each kind of GraphQL type. + */ + +declare function isScalarType(type: mixed): boolean %checks(type instanceof + GraphQLScalarType); +// eslint-disable-next-line no-redeclare +export function isScalarType(type) { + return instanceOf(type, GraphQLScalarType); +} + +export function assertScalarType(type: mixed): GraphQLScalarType { + invariant( + isScalarType(type), + `Expected ${inspect(type)} to be a GraphQL Scalar type.`, + ); + return type; +} + +declare function isObjectType(type: mixed): boolean %checks(type instanceof + GraphQLObjectType); +// eslint-disable-next-line no-redeclare +export function isObjectType(type) { + return instanceOf(type, GraphQLObjectType); +} + +export function assertObjectType(type: mixed): GraphQLObjectType { + invariant( + isObjectType(type), + `Expected ${inspect(type)} to be a GraphQL Object type.`, + ); + return type; +} + +declare function isInterfaceType(type: mixed): boolean %checks(type instanceof + GraphQLInterfaceType); +// eslint-disable-next-line no-redeclare +export function isInterfaceType(type) { + return instanceOf(type, GraphQLInterfaceType); +} + +export function assertInterfaceType(type: mixed): GraphQLInterfaceType { + invariant( + isInterfaceType(type), + `Expected ${inspect(type)} to be a GraphQL Interface type.`, + ); + return type; +} + +declare function isUnionType(type: mixed): boolean %checks(type instanceof + GraphQLUnionType); +// eslint-disable-next-line no-redeclare +export function isUnionType(type) { + return instanceOf(type, GraphQLUnionType); +} + +export function assertUnionType(type: mixed): GraphQLUnionType { + invariant( + isUnionType(type), + `Expected ${inspect(type)} to be a GraphQL Union type.`, + ); + return type; +} + +declare function isEnumType(type: mixed): boolean %checks(type instanceof + GraphQLEnumType); +// eslint-disable-next-line no-redeclare +export function isEnumType(type) { + return instanceOf(type, GraphQLEnumType); +} + +export function assertEnumType(type: mixed): GraphQLEnumType { + invariant( + isEnumType(type), + `Expected ${inspect(type)} to be a GraphQL Enum type.`, + ); + return type; +} + +declare function isInputObjectType(type: mixed): boolean %checks(type instanceof + GraphQLInputObjectType); +// eslint-disable-next-line no-redeclare +export function isInputObjectType(type) { + return instanceOf(type, GraphQLInputObjectType); +} + +export function assertInputObjectType(type: mixed): GraphQLInputObjectType { + invariant( + isInputObjectType(type), + `Expected ${inspect(type)} to be a GraphQL Input Object type.`, + ); + return type; +} + +declare function isListType(type: mixed): boolean %checks(type instanceof + GraphQLList); +// eslint-disable-next-line no-redeclare +export function isListType(type) { + return instanceOf(type, GraphQLList); +} + +export function assertListType(type: mixed): GraphQLList { + invariant( + isListType(type), + `Expected ${inspect(type)} to be a GraphQL List type.`, + ); + return type; +} + +declare function isNonNullType(type: mixed): boolean %checks(type instanceof + GraphQLNonNull); +// eslint-disable-next-line no-redeclare +export function isNonNullType(type) { + return instanceOf(type, GraphQLNonNull); +} + +export function assertNonNullType(type: mixed): GraphQLNonNull { + invariant( + isNonNullType(type), + `Expected ${inspect(type)} to be a GraphQL Non-Null type.`, + ); + return type; +} + +/** + * These types may be used as input types for arguments and directives. + */ +export type GraphQLInputType = + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList, + >; + +export function isInputType(type: mixed): boolean %checks { + return ( + isScalarType(type) || + isEnumType(type) || + isInputObjectType(type) || + (isWrappingType(type) && isInputType(type.ofType)) + ); +} + +export function assertInputType(type: mixed): GraphQLInputType { + invariant( + isInputType(type), + `Expected ${inspect(type)} to be a GraphQL input type.`, + ); + return type; +} + +/** + * These types may be used as output types as the result of fields. + */ +export type GraphQLOutputType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList + | GraphQLNonNull< + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLList, + >; + +export function isOutputType(type: mixed): boolean %checks { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + (isWrappingType(type) && isOutputType(type.ofType)) + ); +} + +export function assertOutputType(type: mixed): GraphQLOutputType { + invariant( + isOutputType(type), + `Expected ${inspect(type)} to be a GraphQL output type.`, + ); + return type; +} + +/** + * These types may describe types which may be leaf values. + */ +export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; + +export function isLeafType(type: mixed): boolean %checks { + return isScalarType(type) || isEnumType(type); +} + +export function assertLeafType(type: mixed): GraphQLLeafType { + invariant( + isLeafType(type), + `Expected ${inspect(type)} to be a GraphQL leaf type.`, + ); + return type; +} + +/** + * These types may describe the parent context of a selection set. + */ +export type GraphQLCompositeType = + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType; + +export function isCompositeType(type: mixed): boolean %checks { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} + +export function assertCompositeType(type: mixed): GraphQLCompositeType { + invariant( + isCompositeType(type), + `Expected ${inspect(type)} to be a GraphQL composite type.`, + ); + return type; +} + +/** + * These types may describe the parent context of a selection set. + */ +export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; + +export function isAbstractType(type: mixed): boolean %checks { + return isInterfaceType(type) || isUnionType(type); +} + +export function assertAbstractType(type: mixed): GraphQLAbstractType { + invariant( + isAbstractType(type), + `Expected ${inspect(type)} to be a GraphQL abstract type.`, + ); + return type; +} + +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: GraphQLList(PersonType) }, + * children: { type: GraphQLList(PersonType) }, + * }) + * }) + * + */ +declare class GraphQLList<+T: GraphQLType> { + +ofType: T; + static (ofType: T): GraphQLList; + // Note: constructors cannot be used for covariant types. Drop the "new". + constructor(ofType: GraphQLType): void; +} +// eslint-disable-next-line no-redeclare +export function GraphQLList(ofType) { + if (this instanceof GraphQLList) { + this.ofType = assertType(ofType); + } else { + return new GraphQLList(ofType); + } +} + +// Need to cast through any to alter the prototype. +(GraphQLList.prototype: any).toString = function toString() { + return '[' + String(this.ofType) + ']'; +}; + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLList); +defineToJSON(GraphQLList); + +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +declare class GraphQLNonNull<+T: GraphQLNullableType> { + +ofType: T; + static (ofType: T): GraphQLNonNull; + // Note: constructors cannot be used for covariant types. Drop the "new". + constructor(ofType: GraphQLType): void; +} +// eslint-disable-next-line no-redeclare +export function GraphQLNonNull(ofType) { + if (this instanceof GraphQLNonNull) { + this.ofType = assertNullableType(ofType); + } else { + return new GraphQLNonNull(ofType); + } +} + +// Need to cast through any to alter the prototype. +(GraphQLNonNull.prototype: any).toString = function toString() { + return String(this.ofType) + '!'; +}; + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLNonNull); +defineToJSON(GraphQLNonNull); + +/** + * These types wrap and modify other types + */ + +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; + +export function isWrappingType(type: mixed): boolean %checks { + return isListType(type) || isNonNullType(type); +} + +export function assertWrappingType(type: mixed): GraphQLWrappingType { + invariant( + isWrappingType(type), + `Expected ${inspect(type)} to be a GraphQL wrapping type.`, + ); + return type; +} + +/** + * These types can all accept null as a value. + */ +export type GraphQLNullableType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType + | GraphQLList; + +export function isNullableType(type: mixed): boolean %checks { + return isType(type) && !isNonNullType(type); +} + +export function assertNullableType(type: mixed): GraphQLNullableType { + invariant( + isNullableType(type), + `Expected ${inspect(type)} to be a GraphQL nullable type.`, + ); + return type; +} + +/* eslint-disable no-redeclare */ +declare function getNullableType(type: void | null): void; +declare function getNullableType(type: T): T; +declare function getNullableType(type: GraphQLNonNull): T; +export function getNullableType(type) { + /* eslint-enable no-redeclare */ + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} + +/** + * These named types do not include modifiers like List or NonNull. + */ +export type GraphQLNamedType = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType + | GraphQLInputObjectType; + +export function isNamedType(type: mixed): boolean %checks { + return ( + isScalarType(type) || + isObjectType(type) || + isInterfaceType(type) || + isUnionType(type) || + isEnumType(type) || + isInputObjectType(type) + ); +} + +export function assertNamedType(type: mixed): GraphQLNamedType { + invariant( + isNamedType(type), + `Expected ${inspect(type)} to be a GraphQL named type.`, + ); + return type; +} + +/* eslint-disable no-redeclare */ +declare function getNamedType(type: void | null): void; +declare function getNamedType(type: GraphQLType): GraphQLNamedType; +export function getNamedType(type) { + /* eslint-enable no-redeclare */ + if (type) { + let unwrappedType = type; + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + return unwrappedType; + } +} + +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + */ +export type Thunk<+T> = (() => T) | T; + +function resolveThunk<+T>(thunk: Thunk): T { + // $FlowFixMe(>=0.90.0) + return typeof thunk === 'function' ? thunk() : thunk; +} + +function undefineIfEmpty(arr: ?$ReadOnlyArray): ?$ReadOnlyArray { + return arr && arr.length > 0 ? arr : undefined; +} + +/** + * Scalar Type Definition + * + * The leaf values of any request and input values to arguments are + * Scalars (or Enums) and are defined with a name and a series of functions + * used to parse input from ast or variables and to ensure validity. + * + * If a type's serialize function does not return a value (i.e. it returns + * `undefined`) then an error will be raised and a `null` value will be returned + * in the response. If the serialize function returns `null`, then no error will + * be included in the response. + * + * Example: + * + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * serialize(value) { + * if (value % 2 === 1) { + * return value; + * } + * } + * }); + * + */ +export class GraphQLScalarType { + name: string; + description: ?string; + serialize: GraphQLScalarSerializer<*>; + parseValue: GraphQLScalarValueParser<*>; + parseLiteral: GraphQLScalarLiteralParser<*>; + astNode: ?ScalarTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + + constructor(config: GraphQLScalarTypeConfig<*, *>): void { + this.name = config.name; + this.description = config.description; + this.serialize = config.serialize || identityFunc; + this.parseValue = config.parseValue || identityFunc; + this.parseLiteral = + config.parseLiteral || + (node => this.parseValue(valueFromASTUntyped(node))); + + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + invariant(typeof config.name === 'string', 'Must provide name.'); + invariant( + config.serialize == null || typeof config.serialize === 'function', + `${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`, + ); + + if (config.parseLiteral) { + invariant( + typeof config.parseValue === 'function' && + typeof config.parseLiteral === 'function', + `${this.name} must provide both "parseValue" and "parseLiteral" functions.`, + ); + } + } + + toConfig(): {| + ...GraphQLScalarTypeConfig<*, *>, + serialize: GraphQLScalarSerializer<*>, + parseValue: GraphQLScalarValueParser<*>, + parseLiteral: GraphQLScalarLiteralParser<*>, + extensionASTNodes: $ReadOnlyArray, + |} { + return { + name: this.name, + description: this.description, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLScalarType); +defineToJSON(GraphQLScalarType); + +export type GraphQLScalarSerializer = (value: mixed) => ?TExternal; +export type GraphQLScalarValueParser = (value: mixed) => ?TInternal; +export type GraphQLScalarLiteralParser = ( + valueNode: ValueNode, + variables: ?ObjMap, +) => ?TInternal; + +export type GraphQLScalarTypeConfig = {| + name: string, + description?: ?string, + // Serializes an internal value to include in a response. + serialize?: GraphQLScalarSerializer, + // Parses an externally provided value to use as an input. + parseValue?: GraphQLScalarValueParser, + // Parses an externally provided literal value to use as an input. + parseLiteral?: GraphQLScalarLiteralParser, + astNode?: ?ScalarTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * + * Example: + * + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve(obj) { + * return obj.number + ' ' + obj.street + * } + * } + * } + * }); + * + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }) + * }); + * + */ +export class GraphQLObjectType { + name: string; + description: ?string; + astNode: ?ObjectTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + isTypeOf: ?GraphQLIsTypeOfFn<*, *>; + + _fields: Thunk>; + _interfaces: Thunk>; + + constructor(config: GraphQLObjectTypeConfig<*, *>): void { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.isTypeOf = config.isTypeOf; + this._fields = defineFieldMap.bind(undefined, config); + this._interfaces = defineInterfaces.bind(undefined, config); + invariant(typeof config.name === 'string', 'Must provide name.'); + invariant( + config.isTypeOf == null || typeof config.isTypeOf === 'function', + `${this.name} must provide "isTypeOf" as a function, ` + + `but got: ${inspect(config.isTypeOf)}.`, + ); + } + + getFields(): GraphQLFieldMap<*, *> { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + getInterfaces(): Array { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + return this._interfaces; + } + + toConfig(): {| + ...GraphQLObjectTypeConfig<*, *>, + interfaces: Array, + fields: GraphQLFieldConfigMap<*, *>, + extensionASTNodes: $ReadOnlyArray, + |} { + return { + name: this.name, + description: this.description, + isTypeOf: this.isTypeOf, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLObjectType); +defineToJSON(GraphQLObjectType); + +function defineInterfaces( + config: GraphQLObjectTypeConfig<*, *>, +): Array { + const interfaces = resolveThunk(config.interfaces) || []; + invariant( + Array.isArray(interfaces), + `${config.name} interfaces must be an Array or a function which returns an Array.`, + ); + return interfaces; +} + +function defineFieldMap( + config: + | GraphQLObjectTypeConfig + | GraphQLInterfaceTypeConfig, +): GraphQLFieldMap { + const fieldMap = resolveThunk(config.fields) || {}; + invariant( + isPlainObj(fieldMap), + `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, + ); + + return mapValue(fieldMap, (fieldConfig, fieldName) => { + invariant( + isPlainObj(fieldConfig), + `${config.name}.${fieldName} field config must be an object`, + ); + invariant( + !('isDeprecated' in fieldConfig), + `${config.name}.${fieldName} should provide "deprecationReason" instead of "isDeprecated".`, + ); + invariant( + fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function', + `${config.name}.${fieldName} field resolver must be a function if ` + + `provided, but got: ${inspect(fieldConfig.resolve)}.`, + ); + + const argsConfig = fieldConfig.args || {}; + invariant( + isPlainObj(argsConfig), + `${config.name}.${fieldName} args must be an object with argument names as keys.`, + ); + + const args = objectEntries(argsConfig).map(([argName, arg]) => ({ + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode, + })); + + return { + ...fieldConfig, + isDeprecated: Boolean(fieldConfig.deprecationReason), + name: fieldName, + args, + }; + }); +} + +function isPlainObj(obj) { + return isObjectLike(obj) && !Array.isArray(obj); +} + +function fieldsToFieldsConfig(fields) { + return mapValue(fields, field => ({ + type: field.type, + args: argsToArgsConfig(field.args), + resolve: field.resolve, + subscribe: field.subscribe, + deprecationReason: field.deprecationReason, + description: field.description, + astNode: field.astNode, + })); +} + +export function argsToArgsConfig( + args: $ReadOnlyArray, +): GraphQLFieldConfigArgumentMap { + return keyValMap( + args, + arg => arg.name, + arg => ({ + type: arg.type, + defaultValue: arg.defaultValue, + description: arg.description, + astNode: arg.astNode, + }), + ); +} + +export type GraphQLObjectTypeConfig = {| + name: string, + interfaces?: Thunk>, + fields: Thunk>, + isTypeOf?: ?GraphQLIsTypeOfFn, + description?: ?string, + astNode?: ?ObjectTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +export type GraphQLTypeResolver = ( + value: TSource, + context: TContext, + info: GraphQLResolveInfo, + abstractType: GraphQLAbstractType, +) => PromiseOrValue; + +export type GraphQLIsTypeOfFn = ( + source: TSource, + context: TContext, + info: GraphQLResolveInfo, +) => PromiseOrValue; + +export type GraphQLFieldResolver< + TSource, + TContext, + TArgs = { [argument: string]: any, ... }, +> = ( + source: TSource, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo, +) => mixed; + +export type GraphQLResolveInfo = {| + +fieldName: string, + +fieldNodes: $ReadOnlyArray, + +returnType: GraphQLOutputType, + +parentType: GraphQLObjectType, + +path: ResponsePath, + +schema: GraphQLSchema, + +fragments: ObjMap, + +rootValue: mixed, + +operation: OperationDefinitionNode, + +variableValues: { [variable: string]: mixed, ... }, +|}; + +export type ResponsePath = {| + +prev: ResponsePath | void, + +key: string | number, +|}; + +export type GraphQLFieldConfig< + TSource, + TContext, + TArgs = { [argument: string]: any, ... }, +> = {| + type: GraphQLOutputType, + args?: GraphQLFieldConfigArgumentMap, + resolve?: GraphQLFieldResolver, + subscribe?: GraphQLFieldResolver, + deprecationReason?: ?string, + description?: ?string, + astNode?: ?FieldDefinitionNode, +|}; + +export type GraphQLFieldConfigArgumentMap = ObjMap; + +export type GraphQLArgumentConfig = {| + type: GraphQLInputType, + defaultValue?: mixed, + description?: ?string, + astNode?: ?InputValueDefinitionNode, +|}; + +export type GraphQLFieldConfigMap = ObjMap< + GraphQLFieldConfig, +>; + +export type GraphQLField< + TSource, + TContext, + TArgs = { [argument: string]: any, ... }, +> = { + name: string, + description: ?string, + type: GraphQLOutputType, + args: Array, + resolve?: GraphQLFieldResolver, + subscribe?: GraphQLFieldResolver, + isDeprecated?: boolean, + deprecationReason?: ?string, + astNode?: ?FieldDefinitionNode, + ... +}; + +export type GraphQLArgument = { + name: string, + type: GraphQLInputType, + defaultValue?: mixed, + description?: ?string, + astNode?: ?InputValueDefinitionNode, + ... +}; + +export function isRequiredArgument(arg: GraphQLArgument): boolean %checks { + return isNonNullType(arg.type) && arg.defaultValue === undefined; +} + +export type GraphQLFieldMap = ObjMap< + GraphQLField, +>; + +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * + * Example: + * + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString } + * } + * }); + * + */ +export class GraphQLInterfaceType { + name: string; + description: ?string; + astNode: ?InterfaceTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + resolveType: ?GraphQLTypeResolver<*, *>; + + _fields: Thunk>; + + constructor(config: GraphQLInterfaceTypeConfig<*, *>): void { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._fields = defineFieldMap.bind(undefined, config); + invariant(typeof config.name === 'string', 'Must provide name.'); + invariant( + config.resolveType == null || typeof config.resolveType === 'function', + `${this.name} must provide "resolveType" as a function, ` + + `but got: ${inspect(config.resolveType)}.`, + ); + } + + getFields(): GraphQLFieldMap<*, *> { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + toConfig(): {| + ...GraphQLInterfaceTypeConfig<*, *>, + fields: GraphQLFieldConfigMap<*, *>, + extensionASTNodes: $ReadOnlyArray, + |} { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLInterfaceType); +defineToJSON(GraphQLInterfaceType); + +export type GraphQLInterfaceTypeConfig = {| + name: string, + fields: Thunk>, + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: ?GraphQLTypeResolver, + description?: ?string, + astNode?: ?InterfaceTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * + * Example: + * + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [ DogType, CatType ], + * resolveType(value) { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * } + * }); + * + */ +export class GraphQLUnionType { + name: string; + description: ?string; + astNode: ?UnionTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + resolveType: ?GraphQLTypeResolver<*, *>; + + _types: Thunk>; + + constructor(config: GraphQLUnionTypeConfig<*, *>): void { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._types = defineTypes.bind(undefined, config); + invariant(typeof config.name === 'string', 'Must provide name.'); + invariant( + config.resolveType == null || typeof config.resolveType === 'function', + `${this.name} must provide "resolveType" as a function, ` + + `but got: ${inspect(config.resolveType)}.`, + ); + } + + getTypes(): Array { + if (typeof this._types === 'function') { + this._types = this._types(); + } + return this._types; + } + + toConfig(): {| + ...GraphQLUnionTypeConfig<*, *>, + types: Array, + extensionASTNodes: $ReadOnlyArray, + |} { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + types: this.getTypes(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLUnionType); +defineToJSON(GraphQLUnionType); + +function defineTypes( + config: GraphQLUnionTypeConfig<*, *>, +): Array { + const types = resolveThunk(config.types) || []; + invariant( + Array.isArray(types), + `Must provide Array of types or a function which returns such an array for Union ${config.name}.`, + ); + return types; +} + +export type GraphQLUnionTypeConfig = {| + name: string, + types: Thunk>, + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + resolveType?: ?GraphQLTypeResolver, + description?: ?string, + astNode?: ?UnionTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +/** + * Enum Type Definition + * + * Some leaf values of requests and input values are Enums. GraphQL serializes + * Enum values as strings, however internally Enums can be represented by any + * kind of type, often integers. + * + * Example: + * + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 } + * } + * }); + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +export class GraphQLEnumType /* */ { + name: string; + description: ?string; + astNode: ?EnumTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + + _values: Array */>; + _valueLookup: Map; + _nameLookup: ObjMap; + + constructor(config: GraphQLEnumTypeConfig /* */): void { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._values = defineEnumValues(this, config.values); + this._valueLookup = new Map( + this._values.map(enumValue => [enumValue.value, enumValue]), + ); + this._nameLookup = keyMap(this._values, value => value.name); + + invariant(typeof config.name === 'string', 'Must provide name.'); + } + + getValues(): Array */> { + return this._values; + } + + getValue(name: string): ?GraphQLEnumValue { + return this._nameLookup[name]; + } + + serialize(value: mixed /* T */): ?string { + const enumValue = this._valueLookup.get(value); + if (enumValue) { + return enumValue.name; + } + } + + parseValue(value: mixed): ?any /* T */ { + if (typeof value === 'string') { + const enumValue = this.getValue(value); + if (enumValue) { + return enumValue.value; + } + } + } + + parseLiteral(valueNode: ValueNode, _variables: ?ObjMap): ?any /* T */ { + // Note: variables will be resolved to a value before calling this function. + if (valueNode.kind === Kind.ENUM) { + const enumValue = this.getValue(valueNode.value); + if (enumValue) { + return enumValue.value; + } + } + } + + toConfig(): {| + ...GraphQLEnumTypeConfig, + extensionASTNodes: $ReadOnlyArray, + |} { + const values = keyValMap( + this.getValues(), + value => value.name, + value => ({ + description: value.description, + value: value.value, + deprecationReason: value.deprecationReason, + astNode: value.astNode, + }), + ); + + return { + name: this.name, + description: this.description, + values, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLEnumType); +defineToJSON(GraphQLEnumType); + +function defineEnumValues( + type: GraphQLEnumType, + valueMap: GraphQLEnumValueConfigMap /* */, +): Array */> { + invariant( + isPlainObj(valueMap), + `${type.name} values must be an object with value names as keys.`, + ); + return objectEntries(valueMap).map(([valueName, value]) => { + invariant( + isPlainObj(value), + `${type.name}.${valueName} must refer to an object with a "value" key ` + + `representing an internal value but got: ${inspect(value)}.`, + ); + invariant( + !('isDeprecated' in value), + `${type.name}.${valueName} should provide "deprecationReason" instead of "isDeprecated".`, + ); + return { + name: valueName, + description: value.description, + isDeprecated: Boolean(value.deprecationReason), + deprecationReason: value.deprecationReason, + astNode: value.astNode, + value: 'value' in value ? value.value : valueName, + }; + }); +} + +export type GraphQLEnumTypeConfig /* */ = {| + name: string, + values: GraphQLEnumValueConfigMap /* */, + description?: ?string, + astNode?: ?EnumTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +export type GraphQLEnumValueConfigMap /* */ = ObjMap */>; + +export type GraphQLEnumValueConfig /* */ = {| + value?: any /* T */, + deprecationReason?: ?string, + description?: ?string, + astNode?: ?EnumValueDefinitionNode, +|}; + +export type GraphQLEnumValue /* */ = { + name: string, + description: ?string, + isDeprecated?: boolean, + deprecationReason: ?string, + astNode?: ?EnumValueDefinitionNode, + value: any /* T */, + ... +}; + +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * + * Example: + * + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: GraphQLNonNull(GraphQLFloat) }, + * lon: { type: GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, defaultValue: 0 }, + * } + * }); + * + */ +export class GraphQLInputObjectType { + name: string; + description: ?string; + astNode: ?InputObjectTypeDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + + _fields: Thunk; + + constructor(config: GraphQLInputObjectTypeConfig): void { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._fields = defineInputFieldMap.bind(undefined, config); + invariant(typeof config.name === 'string', 'Must provide name.'); + } + + getFields(): GraphQLInputFieldMap { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + return this._fields; + } + + toConfig(): {| + ...GraphQLInputObjectTypeConfig, + fields: GraphQLInputFieldConfigMap, + extensionASTNodes: $ReadOnlyArray, + |} { + const fields = mapValue(this.getFields(), field => ({ + description: field.description, + type: field.type, + defaultValue: field.defaultValue, + astNode: field.astNode, + })); + + return { + name: this.name, + description: this.description, + fields, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + }; + } + + toString(): string { + return this.name; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLInputObjectType); +defineToJSON(GraphQLInputObjectType); + +function defineInputFieldMap( + config: GraphQLInputObjectTypeConfig, +): GraphQLInputFieldMap { + const fieldMap = resolveThunk(config.fields) || {}; + invariant( + isPlainObj(fieldMap), + `${config.name} fields must be an object with field names as keys or a function which returns such an object.`, + ); + return mapValue(fieldMap, (fieldConfig, fieldName) => { + invariant( + !('resolve' in fieldConfig), + `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`, + ); + + return { ...fieldConfig, name: fieldName }; + }); +} + +export type GraphQLInputObjectTypeConfig = {| + name: string, + fields: Thunk, + description?: ?string, + astNode?: ?InputObjectTypeDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, +|}; + +export type GraphQLInputFieldConfig = {| + type: GraphQLInputType, + defaultValue?: mixed, + description?: ?string, + astNode?: ?InputValueDefinitionNode, +|}; + +export type GraphQLInputFieldConfigMap = ObjMap; + +export type GraphQLInputField = { + name: string, + type: GraphQLInputType, + defaultValue?: mixed, + description?: ?string, + astNode?: ?InputValueDefinitionNode, + ... +}; + +export function isRequiredInputField( + field: GraphQLInputField, +): boolean %checks { + return isNonNullType(field.type) && field.defaultValue === undefined; +} + +export type GraphQLInputFieldMap = ObjMap; diff --git a/node_modules/graphql/type/definition.mjs b/node_modules/graphql/type/definition.mjs new file mode 100644 index 000000000..74c357517 --- /dev/null +++ b/node_modules/graphql/type/definition.mjs @@ -0,0 +1,875 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import objectEntries from '../polyfills/objectEntries'; +import defineToJSON from '../jsutils/defineToJSON'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import identityFunc from '../jsutils/identityFunc'; +import instanceOf from '../jsutils/instanceOf'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import keyValMap from '../jsutils/keyValMap'; +import mapValue from '../jsutils/mapValue'; +import isObjectLike from '../jsutils/isObjectLike'; +import { Kind } from '../language/kinds'; +import { valueFromASTUntyped } from '../utilities/valueFromASTUntyped'; +export function isType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); +} +export function assertType(type) { + !isType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL type.")) : void 0; + return type; +} +/** + * There are predicates for each kind of GraphQL type. + */ + +// eslint-disable-next-line no-redeclare +export function isScalarType(type) { + return instanceOf(type, GraphQLScalarType); +} +export function assertScalarType(type) { + !isScalarType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Scalar type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isObjectType(type) { + return instanceOf(type, GraphQLObjectType); +} +export function assertObjectType(type) { + !isObjectType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Object type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isInterfaceType(type) { + return instanceOf(type, GraphQLInterfaceType); +} +export function assertInterfaceType(type) { + !isInterfaceType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Interface type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isUnionType(type) { + return instanceOf(type, GraphQLUnionType); +} +export function assertUnionType(type) { + !isUnionType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Union type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isEnumType(type) { + return instanceOf(type, GraphQLEnumType); +} +export function assertEnumType(type) { + !isEnumType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Enum type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isInputObjectType(type) { + return instanceOf(type, GraphQLInputObjectType); +} +export function assertInputObjectType(type) { + !isInputObjectType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Input Object type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isListType(type) { + return instanceOf(type, GraphQLList); +} +export function assertListType(type) { + !isListType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL List type.")) : void 0; + return type; +} +// eslint-disable-next-line no-redeclare +export function isNonNullType(type) { + return instanceOf(type, GraphQLNonNull); +} +export function assertNonNullType(type) { + !isNonNullType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL Non-Null type.")) : void 0; + return type; +} +/** + * These types may be used as input types for arguments and directives. + */ + +export function isInputType(type) { + return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType); +} +export function assertInputType(type) { + !isInputType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL input type.")) : void 0; + return type; +} +/** + * These types may be used as output types as the result of fields. + */ + +export function isOutputType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType); +} +export function assertOutputType(type) { + !isOutputType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL output type.")) : void 0; + return type; +} +/** + * These types may describe types which may be leaf values. + */ + +export function isLeafType(type) { + return isScalarType(type) || isEnumType(type); +} +export function assertLeafType(type) { + !isLeafType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL leaf type.")) : void 0; + return type; +} +/** + * These types may describe the parent context of a selection set. + */ + +export function isCompositeType(type) { + return isObjectType(type) || isInterfaceType(type) || isUnionType(type); +} +export function assertCompositeType(type) { + !isCompositeType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL composite type.")) : void 0; + return type; +} +/** + * These types may describe the parent context of a selection set. + */ + +export function isAbstractType(type) { + return isInterfaceType(type) || isUnionType(type); +} +export function assertAbstractType(type) { + !isAbstractType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL abstract type.")) : void 0; + return type; +} +/** + * List Type Wrapper + * + * A list is a wrapping type which points to another type. + * Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: GraphQLList(PersonType) }, + * children: { type: GraphQLList(PersonType) }, + * }) + * }) + * + */ + +// eslint-disable-next-line no-redeclare +export function GraphQLList(ofType) { + if (this instanceof GraphQLList) { + this.ofType = assertType(ofType); + } else { + return new GraphQLList(ofType); + } +} // Need to cast through any to alter the prototype. + +GraphQLList.prototype.toString = function toString() { + return '[' + String(this.ofType) + ']'; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +defineToStringTag(GraphQLList); +defineToJSON(GraphQLList); +/** + * Non-Null Type Wrapper + * + * A non-null is a wrapping type which points to another type. + * Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ + +// eslint-disable-next-line no-redeclare +export function GraphQLNonNull(ofType) { + if (this instanceof GraphQLNonNull) { + this.ofType = assertNullableType(ofType); + } else { + return new GraphQLNonNull(ofType); + } +} // Need to cast through any to alter the prototype. + +GraphQLNonNull.prototype.toString = function toString() { + return String(this.ofType) + '!'; +}; // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +defineToStringTag(GraphQLNonNull); +defineToJSON(GraphQLNonNull); +/** + * These types wrap and modify other types + */ + +export function isWrappingType(type) { + return isListType(type) || isNonNullType(type); +} +export function assertWrappingType(type) { + !isWrappingType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL wrapping type.")) : void 0; + return type; +} +/** + * These types can all accept null as a value. + */ + +export function isNullableType(type) { + return isType(type) && !isNonNullType(type); +} +export function assertNullableType(type) { + !isNullableType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL nullable type.")) : void 0; + return type; +} +/* eslint-disable no-redeclare */ + +export function getNullableType(type) { + /* eslint-enable no-redeclare */ + if (type) { + return isNonNullType(type) ? type.ofType : type; + } +} +/** + * These named types do not include modifiers like List or NonNull. + */ + +export function isNamedType(type) { + return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type); +} +export function assertNamedType(type) { + !isNamedType(type) ? invariant(0, "Expected ".concat(inspect(type), " to be a GraphQL named type.")) : void 0; + return type; +} +/* eslint-disable no-redeclare */ + +export function getNamedType(type) { + /* eslint-enable no-redeclare */ + if (type) { + var unwrappedType = type; + + while (isWrappingType(unwrappedType)) { + unwrappedType = unwrappedType.ofType; + } + + return unwrappedType; + } +} +/** + * Used while defining GraphQL types to allow for circular references in + * otherwise immutable type definitions. + */ + +function resolveThunk(thunk) { + // $FlowFixMe(>=0.90.0) + return typeof thunk === 'function' ? thunk() : thunk; +} + +function undefineIfEmpty(arr) { + return arr && arr.length > 0 ? arr : undefined; +} +/** + * Scalar Type Definition + * + * The leaf values of any request and input values to arguments are + * Scalars (or Enums) and are defined with a name and a series of functions + * used to parse input from ast or variables and to ensure validity. + * + * If a type's serialize function does not return a value (i.e. it returns + * `undefined`) then an error will be raised and a `null` value will be returned + * in the response. If the serialize function returns `null`, then no error will + * be included in the response. + * + * Example: + * + * const OddType = new GraphQLScalarType({ + * name: 'Odd', + * serialize(value) { + * if (value % 2 === 1) { + * return value; + * } + * } + * }); + * + */ + + +export var GraphQLScalarType = +/*#__PURE__*/ +function () { + function GraphQLScalarType(config) { + var _this = this; + + this.name = config.name; + this.description = config.description; + this.serialize = config.serialize || identityFunc; + this.parseValue = config.parseValue || identityFunc; + + this.parseLiteral = config.parseLiteral || function (node) { + return _this.parseValue(valueFromASTUntyped(node)); + }; + + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + !(config.serialize == null || typeof config.serialize === 'function') ? invariant(0, "".concat(this.name, " must provide \"serialize\" function. If this custom Scalar is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" functions are also provided.")) : void 0; + + if (config.parseLiteral) { + !(typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function') ? invariant(0, "".concat(this.name, " must provide both \"parseValue\" and \"parseLiteral\" functions.")) : void 0; + } + } + + var _proto = GraphQLScalarType.prototype; + + _proto.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + serialize: this.serialize, + parseValue: this.parseValue, + parseLiteral: this.parseLiteral, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto.toString = function toString() { + return this.name; + }; + + return GraphQLScalarType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLScalarType); +defineToJSON(GraphQLScalarType); + +/** + * Object Type Definition + * + * Almost all of the GraphQL types you define will be object types. Object types + * have a name, but most importantly describe their fields. + * + * Example: + * + * const AddressType = new GraphQLObjectType({ + * name: 'Address', + * fields: { + * street: { type: GraphQLString }, + * number: { type: GraphQLInt }, + * formatted: { + * type: GraphQLString, + * resolve(obj) { + * return obj.number + ' ' + obj.street + * } + * } + * } + * }); + * + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * name: { type: GraphQLString }, + * bestFriend: { type: PersonType }, + * }) + * }); + * + */ +export var GraphQLObjectType = +/*#__PURE__*/ +function () { + function GraphQLObjectType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.isTypeOf = config.isTypeOf; + this._fields = defineFieldMap.bind(undefined, config); + this._interfaces = defineInterfaces.bind(undefined, config); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + !(config.isTypeOf == null || typeof config.isTypeOf === 'function') ? invariant(0, "".concat(this.name, " must provide \"isTypeOf\" as a function, ") + "but got: ".concat(inspect(config.isTypeOf), ".")) : void 0; + } + + var _proto2 = GraphQLObjectType.prototype; + + _proto2.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto2.getInterfaces = function getInterfaces() { + if (typeof this._interfaces === 'function') { + this._interfaces = this._interfaces(); + } + + return this._interfaces; + }; + + _proto2.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + isTypeOf: this.isTypeOf, + interfaces: this.getInterfaces(), + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto2.toString = function toString() { + return this.name; + }; + + return GraphQLObjectType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLObjectType); +defineToJSON(GraphQLObjectType); + +function defineInterfaces(config) { + var interfaces = resolveThunk(config.interfaces) || []; + !Array.isArray(interfaces) ? invariant(0, "".concat(config.name, " interfaces must be an Array or a function which returns an Array.")) : void 0; + return interfaces; +} + +function defineFieldMap(config) { + var fieldMap = resolveThunk(config.fields) || {}; + !isPlainObj(fieldMap) ? invariant(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")) : void 0; + return mapValue(fieldMap, function (fieldConfig, fieldName) { + !isPlainObj(fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object")) : void 0; + !!('isDeprecated' in fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")) : void 0; + !(fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function') ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat(inspect(fieldConfig.resolve), ".")) : void 0; + var argsConfig = fieldConfig.args || {}; + !isPlainObj(argsConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument names as keys.")) : void 0; + var args = objectEntries(argsConfig).map(function (_ref) { + var argName = _ref[0], + arg = _ref[1]; + return { + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode + }; + }); + return _objectSpread({}, fieldConfig, { + isDeprecated: Boolean(fieldConfig.deprecationReason), + name: fieldName, + args: args + }); + }); +} + +function isPlainObj(obj) { + return isObjectLike(obj) && !Array.isArray(obj); +} + +function fieldsToFieldsConfig(fields) { + return mapValue(fields, function (field) { + return { + type: field.type, + args: argsToArgsConfig(field.args), + resolve: field.resolve, + subscribe: field.subscribe, + deprecationReason: field.deprecationReason, + description: field.description, + astNode: field.astNode + }; + }); +} + +export function argsToArgsConfig(args) { + return keyValMap(args, function (arg) { + return arg.name; + }, function (arg) { + return { + type: arg.type, + defaultValue: arg.defaultValue, + description: arg.description, + astNode: arg.astNode + }; + }); +} +export function isRequiredArgument(arg) { + return isNonNullType(arg.type) && arg.defaultValue === undefined; +} + +/** + * Interface Type Definition + * + * When a field can return one of a heterogeneous set of types, a Interface type + * is used to describe what types are possible, what fields are in common across + * all types, as well as a function to determine which type is actually used + * when the field is resolved. + * + * Example: + * + * const EntityType = new GraphQLInterfaceType({ + * name: 'Entity', + * fields: { + * name: { type: GraphQLString } + * } + * }); + * + */ +export var GraphQLInterfaceType = +/*#__PURE__*/ +function () { + function GraphQLInterfaceType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._fields = defineFieldMap.bind(undefined, config); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + !(config.resolveType == null || typeof config.resolveType === 'function') ? invariant(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat(inspect(config.resolveType), ".")) : void 0; + } + + var _proto3 = GraphQLInterfaceType.prototype; + + _proto3.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto3.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + fields: fieldsToFieldsConfig(this.getFields()), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto3.toString = function toString() { + return this.name; + }; + + return GraphQLInterfaceType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLInterfaceType); +defineToJSON(GraphQLInterfaceType); + +/** + * Union Type Definition + * + * When a field can return one of a heterogeneous set of types, a Union type + * is used to describe what types are possible as well as providing a function + * to determine which type is actually used when the field is resolved. + * + * Example: + * + * const PetType = new GraphQLUnionType({ + * name: 'Pet', + * types: [ DogType, CatType ], + * resolveType(value) { + * if (value instanceof Dog) { + * return DogType; + * } + * if (value instanceof Cat) { + * return CatType; + * } + * } + * }); + * + */ +export var GraphQLUnionType = +/*#__PURE__*/ +function () { + function GraphQLUnionType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this.resolveType = config.resolveType; + this._types = defineTypes.bind(undefined, config); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + !(config.resolveType == null || typeof config.resolveType === 'function') ? invariant(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat(inspect(config.resolveType), ".")) : void 0; + } + + var _proto4 = GraphQLUnionType.prototype; + + _proto4.getTypes = function getTypes() { + if (typeof this._types === 'function') { + this._types = this._types(); + } + + return this._types; + }; + + _proto4.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + resolveType: this.resolveType, + types: this.getTypes(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto4.toString = function toString() { + return this.name; + }; + + return GraphQLUnionType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLUnionType); +defineToJSON(GraphQLUnionType); + +function defineTypes(config) { + var types = resolveThunk(config.types) || []; + !Array.isArray(types) ? invariant(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config.name, ".")) : void 0; + return types; +} + +/** + * Enum Type Definition + * + * Some leaf values of requests and input values are Enums. GraphQL serializes + * Enum values as strings, however internally Enums can be represented by any + * kind of type, often integers. + * + * Example: + * + * const RGBType = new GraphQLEnumType({ + * name: 'RGB', + * values: { + * RED: { value: 0 }, + * GREEN: { value: 1 }, + * BLUE: { value: 2 } + * } + * }); + * + * Note: If a value is not provided in a definition, the name of the enum value + * will be used as its internal value. + */ +export var GraphQLEnumType +/* */ += +/*#__PURE__*/ +function () { + function GraphQLEnumType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._values = defineEnumValues(this, config.values); + this._valueLookup = new Map(this._values.map(function (enumValue) { + return [enumValue.value, enumValue]; + })); + this._nameLookup = keyMap(this._values, function (value) { + return value.name; + }); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + } + + var _proto5 = GraphQLEnumType.prototype; + + _proto5.getValues = function getValues() { + return this._values; + }; + + _proto5.getValue = function getValue(name) { + return this._nameLookup[name]; + }; + + _proto5.serialize = function serialize(value) { + var enumValue = this._valueLookup.get(value); + + if (enumValue) { + return enumValue.name; + } + }; + + _proto5.parseValue = function parseValue(value) + /* T */ + { + if (typeof value === 'string') { + var enumValue = this.getValue(value); + + if (enumValue) { + return enumValue.value; + } + } + }; + + _proto5.parseLiteral = function parseLiteral(valueNode, _variables) + /* T */ + { + // Note: variables will be resolved to a value before calling this function. + if (valueNode.kind === Kind.ENUM) { + var enumValue = this.getValue(valueNode.value); + + if (enumValue) { + return enumValue.value; + } + } + }; + + _proto5.toConfig = function toConfig() { + var values = keyValMap(this.getValues(), function (value) { + return value.name; + }, function (value) { + return { + description: value.description, + value: value.value, + deprecationReason: value.deprecationReason, + astNode: value.astNode + }; + }); + return { + name: this.name, + description: this.description, + values: values, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto5.toString = function toString() { + return this.name; + }; + + return GraphQLEnumType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLEnumType); +defineToJSON(GraphQLEnumType); + +function defineEnumValues(type, valueMap) { + !isPlainObj(valueMap) ? invariant(0, "".concat(type.name, " values must be an object with value names as keys.")) : void 0; + return objectEntries(valueMap).map(function (_ref2) { + var valueName = _ref2[0], + value = _ref2[1]; + !isPlainObj(value) ? invariant(0, "".concat(type.name, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat(inspect(value), ".")) : void 0; + !!('isDeprecated' in value) ? invariant(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")) : void 0; + return { + name: valueName, + description: value.description, + isDeprecated: Boolean(value.deprecationReason), + deprecationReason: value.deprecationReason, + astNode: value.astNode, + value: 'value' in value ? value.value : valueName + }; + }); +} + +/** + * Input Object Type Definition + * + * An input object defines a structured collection of fields which may be + * supplied to a field argument. + * + * Using `NonNull` will ensure that a value must be provided by the query + * + * Example: + * + * const GeoPoint = new GraphQLInputObjectType({ + * name: 'GeoPoint', + * fields: { + * lat: { type: GraphQLNonNull(GraphQLFloat) }, + * lon: { type: GraphQLNonNull(GraphQLFloat) }, + * alt: { type: GraphQLFloat, defaultValue: 0 }, + * } + * }); + * + */ +export var GraphQLInputObjectType = +/*#__PURE__*/ +function () { + function GraphQLInputObjectType(config) { + this.name = config.name; + this.description = config.description; + this.astNode = config.astNode; + this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); + this._fields = defineInputFieldMap.bind(undefined, config); + !(typeof config.name === 'string') ? invariant(0, 'Must provide name.') : void 0; + } + + var _proto6 = GraphQLInputObjectType.prototype; + + _proto6.getFields = function getFields() { + if (typeof this._fields === 'function') { + this._fields = this._fields(); + } + + return this._fields; + }; + + _proto6.toConfig = function toConfig() { + var fields = mapValue(this.getFields(), function (field) { + return { + description: field.description, + type: field.type, + defaultValue: field.defaultValue, + astNode: field.astNode + }; + }); + return { + name: this.name, + description: this.description, + fields: fields, + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [] + }; + }; + + _proto6.toString = function toString() { + return this.name; + }; + + return GraphQLInputObjectType; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLInputObjectType); +defineToJSON(GraphQLInputObjectType); + +function defineInputFieldMap(config) { + var fieldMap = resolveThunk(config.fields) || {}; + !isPlainObj(fieldMap) ? invariant(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")) : void 0; + return mapValue(fieldMap, function (fieldConfig, fieldName) { + !!('resolve' in fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers.")) : void 0; + return _objectSpread({}, fieldConfig, { + name: fieldName + }); + }); +} + +export function isRequiredInputField(field) { + return isNonNullType(field.type) && field.defaultValue === undefined; +} diff --git a/node_modules/graphql/type/directives.js b/node_modules/graphql/type/directives.js new file mode 100644 index 000000000..6310da691 --- /dev/null +++ b/node_modules/graphql/type/directives.js @@ -0,0 +1,165 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isDirective = isDirective; +exports.assertDirective = assertDirective; +exports.isSpecifiedDirective = isSpecifiedDirective; +exports.specifiedDirectives = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = void 0; + +var _objectEntries = _interopRequireDefault(require("../polyfills/objectEntries")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _definition = require("./definition"); + +var _scalars = require("./scalars"); + +var _defineToStringTag = _interopRequireDefault(require("../jsutils/defineToStringTag")); + +var _defineToJSON = _interopRequireDefault(require("../jsutils/defineToJSON")); + +var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _directiveLocation = require("../language/directiveLocation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eslint-disable-next-line no-redeclare +function isDirective(directive) { + return (0, _instanceOf.default)(directive, GraphQLDirective); +} + +function assertDirective(directive) { + !isDirective(directive) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(directive), " to be a GraphQL directive.")) : void 0; + return directive; +} +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ + + +var GraphQLDirective = +/*#__PURE__*/ +function () { + function GraphQLDirective(config) { + this.name = config.name; + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = config.isRepeatable != null && config.isRepeatable; + this.astNode = config.astNode; + !config.name ? (0, _invariant.default)(0, 'Directive must be named.') : void 0; + !Array.isArray(config.locations) ? (0, _invariant.default)(0, "@".concat(config.name, " locations must be an Array.")) : void 0; + var args = config.args || {}; + !((0, _isObjectLike.default)(args) && !Array.isArray(args)) ? (0, _invariant.default)(0, "@".concat(config.name, " args must be an object with argument names as keys.")) : void 0; + this.args = (0, _objectEntries.default)(args).map(function (_ref) { + var argName = _ref[0], + arg = _ref[1]; + return { + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode + }; + }); + } + + var _proto = GraphQLDirective.prototype; + + _proto.toString = function toString() { + return '@' + this.name; + }; + + _proto.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: (0, _definition.argsToArgsConfig)(this.args), + isRepeatable: this.isRepeatable, + astNode: this.astNode + }; + }; + + return GraphQLDirective; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLDirective = GraphQLDirective; +(0, _defineToStringTag.default)(GraphQLDirective); +(0, _defineToJSON.default)(GraphQLDirective); + +/** + * Used to conditionally include fields or fragments. + */ +var GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), + description: 'Included when true.' + } + } +}); +/** + * Used to conditionally skip (exclude) fields or fragments. + */ + +exports.GraphQLIncludeDirective = GraphQLIncludeDirective; +var GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [_directiveLocation.DirectiveLocation.FIELD, _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, _directiveLocation.DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), + description: 'Skipped when true.' + } + } +}); +/** + * Constant string used for default reason for a deprecation. + */ + +exports.GraphQLSkipDirective = GraphQLSkipDirective; +var DEFAULT_DEPRECATION_REASON = 'No longer supported'; +/** + * Used to declare element of a GraphQL schema as deprecated. + */ + +exports.DEFAULT_DEPRECATION_REASON = DEFAULT_DEPRECATION_REASON; +var GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [_directiveLocation.DirectiveLocation.FIELD_DEFINITION, _directiveLocation.DirectiveLocation.ENUM_VALUE], + args: { + reason: { + type: _scalars.GraphQLString, + description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', + defaultValue: DEFAULT_DEPRECATION_REASON + } + } +}); +/** + * The full list of specified directives. + */ + +exports.GraphQLDeprecatedDirective = GraphQLDeprecatedDirective; +var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective]); +exports.specifiedDirectives = specifiedDirectives; + +function isSpecifiedDirective(directive) { + return isDirective(directive) && specifiedDirectives.some(function (_ref2) { + var name = _ref2.name; + return name === directive.name; + }); +} diff --git a/node_modules/graphql/type/directives.js.flow b/node_modules/graphql/type/directives.js.flow new file mode 100644 index 000000000..62f0a186f --- /dev/null +++ b/node_modules/graphql/type/directives.js.flow @@ -0,0 +1,191 @@ +// @flow strict + +import objectEntries from '../polyfills/objectEntries'; +import isObjectLike from '../jsutils/isObjectLike'; +import { + type GraphQLFieldConfigArgumentMap, + type GraphQLArgument, + argsToArgsConfig, + GraphQLNonNull, +} from './definition'; +import { GraphQLString, GraphQLBoolean } from './scalars'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import defineToJSON from '../jsutils/defineToJSON'; +import instanceOf from '../jsutils/instanceOf'; +import invariant from '../jsutils/invariant'; +import inspect from '../jsutils/inspect'; +import { type DirectiveDefinitionNode } from '../language/ast'; +import { + DirectiveLocation, + type DirectiveLocationEnum, +} from '../language/directiveLocation'; + +/** + * Test if the given value is a GraphQL directive. + */ +declare function isDirective( + directive: mixed, +): boolean %checks(directive instanceof GraphQLDirective); +// eslint-disable-next-line no-redeclare +export function isDirective(directive) { + return instanceOf(directive, GraphQLDirective); +} + +export function assertDirective(directive: mixed): GraphQLDirective { + invariant( + isDirective(directive), + `Expected ${inspect(directive)} to be a GraphQL directive.`, + ); + return directive; +} + +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ +export class GraphQLDirective { + name: string; + description: ?string; + locations: Array; + isRepeatable: boolean; + args: Array; + astNode: ?DirectiveDefinitionNode; + + constructor(config: GraphQLDirectiveConfig): void { + this.name = config.name; + this.description = config.description; + + this.locations = config.locations; + this.isRepeatable = config.isRepeatable != null && config.isRepeatable; + this.astNode = config.astNode; + invariant(config.name, 'Directive must be named.'); + invariant( + Array.isArray(config.locations), + `@${config.name} locations must be an Array.`, + ); + + const args = config.args || {}; + invariant( + isObjectLike(args) && !Array.isArray(args), + `@${config.name} args must be an object with argument names as keys.`, + ); + + this.args = objectEntries(args).map(([argName, arg]) => ({ + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode, + })); + } + + toString(): string { + return '@' + this.name; + } + + toConfig(): {| + ...GraphQLDirectiveConfig, + args: GraphQLFieldConfigArgumentMap, + isRepeatable: boolean, + |} { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: argsToArgsConfig(this.args), + isRepeatable: this.isRepeatable, + astNode: this.astNode, + }; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLDirective); +defineToJSON(GraphQLDirective); + +export type GraphQLDirectiveConfig = {| + name: string, + description?: ?string, + locations: Array, + args?: ?GraphQLFieldConfigArgumentMap, + isRepeatable?: ?boolean, + astNode?: ?DirectiveDefinitionNode, +|}; + +/** + * Used to conditionally include fields or fragments. + */ +export const GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: + 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: GraphQLNonNull(GraphQLBoolean), + description: 'Included when true.', + }, + }, +}); + +/** + * Used to conditionally skip (exclude) fields or fragments. + */ +export const GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: + 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [ + DirectiveLocation.FIELD, + DirectiveLocation.FRAGMENT_SPREAD, + DirectiveLocation.INLINE_FRAGMENT, + ], + args: { + if: { + type: GraphQLNonNull(GraphQLBoolean), + description: 'Skipped when true.', + }, + }, +}); + +/** + * Constant string used for default reason for a deprecation. + */ +export const DEFAULT_DEPRECATION_REASON = 'No longer supported'; + +/** + * Used to declare element of a GraphQL schema as deprecated. + */ +export const GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE], + args: { + reason: { + type: GraphQLString, + description: + 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', + defaultValue: DEFAULT_DEPRECATION_REASON, + }, + }, +}); + +/** + * The full list of specified directives. + */ +export const specifiedDirectives = Object.freeze([ + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, +]); + +export function isSpecifiedDirective(directive: mixed): boolean %checks { + return ( + isDirective(directive) && + specifiedDirectives.some(({ name }) => name === directive.name) + ); +} diff --git a/node_modules/graphql/type/directives.mjs b/node_modules/graphql/type/directives.mjs new file mode 100644 index 000000000..769e029ed --- /dev/null +++ b/node_modules/graphql/type/directives.mjs @@ -0,0 +1,137 @@ +import objectEntries from '../polyfills/objectEntries'; +import isObjectLike from '../jsutils/isObjectLike'; +import { argsToArgsConfig, GraphQLNonNull } from './definition'; +import { GraphQLString, GraphQLBoolean } from './scalars'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import defineToJSON from '../jsutils/defineToJSON'; +import instanceOf from '../jsutils/instanceOf'; +import invariant from '../jsutils/invariant'; +import inspect from '../jsutils/inspect'; +import { DirectiveLocation } from '../language/directiveLocation'; +/** + * Test if the given value is a GraphQL directive. + */ + +// eslint-disable-next-line no-redeclare +export function isDirective(directive) { + return instanceOf(directive, GraphQLDirective); +} +export function assertDirective(directive) { + !isDirective(directive) ? invariant(0, "Expected ".concat(inspect(directive), " to be a GraphQL directive.")) : void 0; + return directive; +} +/** + * Directives are used by the GraphQL runtime as a way of modifying execution + * behavior. Type system creators will usually not create these directly. + */ + +export var GraphQLDirective = +/*#__PURE__*/ +function () { + function GraphQLDirective(config) { + this.name = config.name; + this.description = config.description; + this.locations = config.locations; + this.isRepeatable = config.isRepeatable != null && config.isRepeatable; + this.astNode = config.astNode; + !config.name ? invariant(0, 'Directive must be named.') : void 0; + !Array.isArray(config.locations) ? invariant(0, "@".concat(config.name, " locations must be an Array.")) : void 0; + var args = config.args || {}; + !(isObjectLike(args) && !Array.isArray(args)) ? invariant(0, "@".concat(config.name, " args must be an object with argument names as keys.")) : void 0; + this.args = objectEntries(args).map(function (_ref) { + var argName = _ref[0], + arg = _ref[1]; + return { + name: argName, + description: arg.description === undefined ? null : arg.description, + type: arg.type, + defaultValue: arg.defaultValue, + astNode: arg.astNode + }; + }); + } + + var _proto = GraphQLDirective.prototype; + + _proto.toString = function toString() { + return '@' + this.name; + }; + + _proto.toConfig = function toConfig() { + return { + name: this.name, + description: this.description, + locations: this.locations, + args: argsToArgsConfig(this.args), + isRepeatable: this.isRepeatable, + astNode: this.astNode + }; + }; + + return GraphQLDirective; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLDirective); +defineToJSON(GraphQLDirective); + +/** + * Used to conditionally include fields or fragments. + */ +export var GraphQLIncludeDirective = new GraphQLDirective({ + name: 'include', + description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: GraphQLNonNull(GraphQLBoolean), + description: 'Included when true.' + } + } +}); +/** + * Used to conditionally skip (exclude) fields or fragments. + */ + +export var GraphQLSkipDirective = new GraphQLDirective({ + name: 'skip', + description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT], + args: { + if: { + type: GraphQLNonNull(GraphQLBoolean), + description: 'Skipped when true.' + } + } +}); +/** + * Constant string used for default reason for a deprecation. + */ + +export var DEFAULT_DEPRECATION_REASON = 'No longer supported'; +/** + * Used to declare element of a GraphQL schema as deprecated. + */ + +export var GraphQLDeprecatedDirective = new GraphQLDirective({ + name: 'deprecated', + description: 'Marks an element of a GraphQL schema as no longer supported.', + locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE], + args: { + reason: { + type: GraphQLString, + description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', + defaultValue: DEFAULT_DEPRECATION_REASON + } + } +}); +/** + * The full list of specified directives. + */ + +export var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective]); +export function isSpecifiedDirective(directive) { + return isDirective(directive) && specifiedDirectives.some(function (_ref2) { + var name = _ref2.name; + return name === directive.name; + }); +} diff --git a/node_modules/graphql/type/index.js b/node_modules/graphql/type/index.js new file mode 100644 index 000000000..0cc85cb70 --- /dev/null +++ b/node_modules/graphql/type/index.js @@ -0,0 +1,503 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isSchema", { + enumerable: true, + get: function get() { + return _schema.isSchema; + } +}); +Object.defineProperty(exports, "assertSchema", { + enumerable: true, + get: function get() { + return _schema.assertSchema; + } +}); +Object.defineProperty(exports, "GraphQLSchema", { + enumerable: true, + get: function get() { + return _schema.GraphQLSchema; + } +}); +Object.defineProperty(exports, "isType", { + enumerable: true, + get: function get() { + return _definition.isType; + } +}); +Object.defineProperty(exports, "isScalarType", { + enumerable: true, + get: function get() { + return _definition.isScalarType; + } +}); +Object.defineProperty(exports, "isObjectType", { + enumerable: true, + get: function get() { + return _definition.isObjectType; + } +}); +Object.defineProperty(exports, "isInterfaceType", { + enumerable: true, + get: function get() { + return _definition.isInterfaceType; + } +}); +Object.defineProperty(exports, "isUnionType", { + enumerable: true, + get: function get() { + return _definition.isUnionType; + } +}); +Object.defineProperty(exports, "isEnumType", { + enumerable: true, + get: function get() { + return _definition.isEnumType; + } +}); +Object.defineProperty(exports, "isInputObjectType", { + enumerable: true, + get: function get() { + return _definition.isInputObjectType; + } +}); +Object.defineProperty(exports, "isListType", { + enumerable: true, + get: function get() { + return _definition.isListType; + } +}); +Object.defineProperty(exports, "isNonNullType", { + enumerable: true, + get: function get() { + return _definition.isNonNullType; + } +}); +Object.defineProperty(exports, "isInputType", { + enumerable: true, + get: function get() { + return _definition.isInputType; + } +}); +Object.defineProperty(exports, "isOutputType", { + enumerable: true, + get: function get() { + return _definition.isOutputType; + } +}); +Object.defineProperty(exports, "isLeafType", { + enumerable: true, + get: function get() { + return _definition.isLeafType; + } +}); +Object.defineProperty(exports, "isCompositeType", { + enumerable: true, + get: function get() { + return _definition.isCompositeType; + } +}); +Object.defineProperty(exports, "isAbstractType", { + enumerable: true, + get: function get() { + return _definition.isAbstractType; + } +}); +Object.defineProperty(exports, "isWrappingType", { + enumerable: true, + get: function get() { + return _definition.isWrappingType; + } +}); +Object.defineProperty(exports, "isNullableType", { + enumerable: true, + get: function get() { + return _definition.isNullableType; + } +}); +Object.defineProperty(exports, "isNamedType", { + enumerable: true, + get: function get() { + return _definition.isNamedType; + } +}); +Object.defineProperty(exports, "isRequiredArgument", { + enumerable: true, + get: function get() { + return _definition.isRequiredArgument; + } +}); +Object.defineProperty(exports, "isRequiredInputField", { + enumerable: true, + get: function get() { + return _definition.isRequiredInputField; + } +}); +Object.defineProperty(exports, "assertType", { + enumerable: true, + get: function get() { + return _definition.assertType; + } +}); +Object.defineProperty(exports, "assertScalarType", { + enumerable: true, + get: function get() { + return _definition.assertScalarType; + } +}); +Object.defineProperty(exports, "assertObjectType", { + enumerable: true, + get: function get() { + return _definition.assertObjectType; + } +}); +Object.defineProperty(exports, "assertInterfaceType", { + enumerable: true, + get: function get() { + return _definition.assertInterfaceType; + } +}); +Object.defineProperty(exports, "assertUnionType", { + enumerable: true, + get: function get() { + return _definition.assertUnionType; + } +}); +Object.defineProperty(exports, "assertEnumType", { + enumerable: true, + get: function get() { + return _definition.assertEnumType; + } +}); +Object.defineProperty(exports, "assertInputObjectType", { + enumerable: true, + get: function get() { + return _definition.assertInputObjectType; + } +}); +Object.defineProperty(exports, "assertListType", { + enumerable: true, + get: function get() { + return _definition.assertListType; + } +}); +Object.defineProperty(exports, "assertNonNullType", { + enumerable: true, + get: function get() { + return _definition.assertNonNullType; + } +}); +Object.defineProperty(exports, "assertInputType", { + enumerable: true, + get: function get() { + return _definition.assertInputType; + } +}); +Object.defineProperty(exports, "assertOutputType", { + enumerable: true, + get: function get() { + return _definition.assertOutputType; + } +}); +Object.defineProperty(exports, "assertLeafType", { + enumerable: true, + get: function get() { + return _definition.assertLeafType; + } +}); +Object.defineProperty(exports, "assertCompositeType", { + enumerable: true, + get: function get() { + return _definition.assertCompositeType; + } +}); +Object.defineProperty(exports, "assertAbstractType", { + enumerable: true, + get: function get() { + return _definition.assertAbstractType; + } +}); +Object.defineProperty(exports, "assertWrappingType", { + enumerable: true, + get: function get() { + return _definition.assertWrappingType; + } +}); +Object.defineProperty(exports, "assertNullableType", { + enumerable: true, + get: function get() { + return _definition.assertNullableType; + } +}); +Object.defineProperty(exports, "assertNamedType", { + enumerable: true, + get: function get() { + return _definition.assertNamedType; + } +}); +Object.defineProperty(exports, "getNullableType", { + enumerable: true, + get: function get() { + return _definition.getNullableType; + } +}); +Object.defineProperty(exports, "getNamedType", { + enumerable: true, + get: function get() { + return _definition.getNamedType; + } +}); +Object.defineProperty(exports, "GraphQLScalarType", { + enumerable: true, + get: function get() { + return _definition.GraphQLScalarType; + } +}); +Object.defineProperty(exports, "GraphQLObjectType", { + enumerable: true, + get: function get() { + return _definition.GraphQLObjectType; + } +}); +Object.defineProperty(exports, "GraphQLInterfaceType", { + enumerable: true, + get: function get() { + return _definition.GraphQLInterfaceType; + } +}); +Object.defineProperty(exports, "GraphQLUnionType", { + enumerable: true, + get: function get() { + return _definition.GraphQLUnionType; + } +}); +Object.defineProperty(exports, "GraphQLEnumType", { + enumerable: true, + get: function get() { + return _definition.GraphQLEnumType; + } +}); +Object.defineProperty(exports, "GraphQLInputObjectType", { + enumerable: true, + get: function get() { + return _definition.GraphQLInputObjectType; + } +}); +Object.defineProperty(exports, "GraphQLList", { + enumerable: true, + get: function get() { + return _definition.GraphQLList; + } +}); +Object.defineProperty(exports, "GraphQLNonNull", { + enumerable: true, + get: function get() { + return _definition.GraphQLNonNull; + } +}); +Object.defineProperty(exports, "isDirective", { + enumerable: true, + get: function get() { + return _directives.isDirective; + } +}); +Object.defineProperty(exports, "assertDirective", { + enumerable: true, + get: function get() { + return _directives.assertDirective; + } +}); +Object.defineProperty(exports, "GraphQLDirective", { + enumerable: true, + get: function get() { + return _directives.GraphQLDirective; + } +}); +Object.defineProperty(exports, "isSpecifiedDirective", { + enumerable: true, + get: function get() { + return _directives.isSpecifiedDirective; + } +}); +Object.defineProperty(exports, "specifiedDirectives", { + enumerable: true, + get: function get() { + return _directives.specifiedDirectives; + } +}); +Object.defineProperty(exports, "GraphQLIncludeDirective", { + enumerable: true, + get: function get() { + return _directives.GraphQLIncludeDirective; + } +}); +Object.defineProperty(exports, "GraphQLSkipDirective", { + enumerable: true, + get: function get() { + return _directives.GraphQLSkipDirective; + } +}); +Object.defineProperty(exports, "GraphQLDeprecatedDirective", { + enumerable: true, + get: function get() { + return _directives.GraphQLDeprecatedDirective; + } +}); +Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", { + enumerable: true, + get: function get() { + return _directives.DEFAULT_DEPRECATION_REASON; + } +}); +Object.defineProperty(exports, "isSpecifiedScalarType", { + enumerable: true, + get: function get() { + return _scalars.isSpecifiedScalarType; + } +}); +Object.defineProperty(exports, "specifiedScalarTypes", { + enumerable: true, + get: function get() { + return _scalars.specifiedScalarTypes; + } +}); +Object.defineProperty(exports, "GraphQLInt", { + enumerable: true, + get: function get() { + return _scalars.GraphQLInt; + } +}); +Object.defineProperty(exports, "GraphQLFloat", { + enumerable: true, + get: function get() { + return _scalars.GraphQLFloat; + } +}); +Object.defineProperty(exports, "GraphQLString", { + enumerable: true, + get: function get() { + return _scalars.GraphQLString; + } +}); +Object.defineProperty(exports, "GraphQLBoolean", { + enumerable: true, + get: function get() { + return _scalars.GraphQLBoolean; + } +}); +Object.defineProperty(exports, "GraphQLID", { + enumerable: true, + get: function get() { + return _scalars.GraphQLID; + } +}); +Object.defineProperty(exports, "isIntrospectionType", { + enumerable: true, + get: function get() { + return _introspection.isIntrospectionType; + } +}); +Object.defineProperty(exports, "introspectionTypes", { + enumerable: true, + get: function get() { + return _introspection.introspectionTypes; + } +}); +Object.defineProperty(exports, "__Schema", { + enumerable: true, + get: function get() { + return _introspection.__Schema; + } +}); +Object.defineProperty(exports, "__Directive", { + enumerable: true, + get: function get() { + return _introspection.__Directive; + } +}); +Object.defineProperty(exports, "__DirectiveLocation", { + enumerable: true, + get: function get() { + return _introspection.__DirectiveLocation; + } +}); +Object.defineProperty(exports, "__Type", { + enumerable: true, + get: function get() { + return _introspection.__Type; + } +}); +Object.defineProperty(exports, "__Field", { + enumerable: true, + get: function get() { + return _introspection.__Field; + } +}); +Object.defineProperty(exports, "__InputValue", { + enumerable: true, + get: function get() { + return _introspection.__InputValue; + } +}); +Object.defineProperty(exports, "__EnumValue", { + enumerable: true, + get: function get() { + return _introspection.__EnumValue; + } +}); +Object.defineProperty(exports, "__TypeKind", { + enumerable: true, + get: function get() { + return _introspection.__TypeKind; + } +}); +Object.defineProperty(exports, "TypeKind", { + enumerable: true, + get: function get() { + return _introspection.TypeKind; + } +}); +Object.defineProperty(exports, "SchemaMetaFieldDef", { + enumerable: true, + get: function get() { + return _introspection.SchemaMetaFieldDef; + } +}); +Object.defineProperty(exports, "TypeMetaFieldDef", { + enumerable: true, + get: function get() { + return _introspection.TypeMetaFieldDef; + } +}); +Object.defineProperty(exports, "TypeNameMetaFieldDef", { + enumerable: true, + get: function get() { + return _introspection.TypeNameMetaFieldDef; + } +}); +Object.defineProperty(exports, "validateSchema", { + enumerable: true, + get: function get() { + return _validate.validateSchema; + } +}); +Object.defineProperty(exports, "assertValidSchema", { + enumerable: true, + get: function get() { + return _validate.assertValidSchema; + } +}); + +var _schema = require("./schema"); + +var _definition = require("./definition"); + +var _directives = require("./directives"); + +var _scalars = require("./scalars"); + +var _introspection = require("./introspection"); + +var _validate = require("./validate"); diff --git a/node_modules/graphql/type/index.js.flow b/node_modules/graphql/type/index.js.flow new file mode 100644 index 000000000..c3b899b42 --- /dev/null +++ b/node_modules/graphql/type/index.js.flow @@ -0,0 +1,163 @@ +// @flow strict + +export { + // Predicate + isSchema, + // Assertion + assertSchema, + // GraphQL Schema definition + GraphQLSchema, +} from './schema'; + +export type { GraphQLSchemaConfig } from './schema'; + +export { + // Predicates + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isRequiredArgument, + isRequiredInputField, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + // Type Wrappers + GraphQLList, + GraphQLNonNull, +} from './definition'; + +export { + // Predicate + isDirective, + // Assertion + assertDirective, + // Directives Definition + GraphQLDirective, + // Built-in Directives defined by the Spec + isSpecifiedDirective, + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, +} from './directives'; + +export type { GraphQLDirectiveConfig } from './directives'; + +// Common built-in scalar instances. +export { + // Predicate + isSpecifiedScalarType, + // Standard GraphQL Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, +} from './scalars'; + +export { + // Predicate + isIntrospectionType, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // "Enum" of Type Kinds + TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from './introspection'; + +export type { + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLScalarSerializer, + GraphQLScalarValueParser, + GraphQLScalarLiteralParser, +} from './definition'; + +// Validate GraphQL schema. +export { validateSchema, assertValidSchema } from './validate'; diff --git a/node_modules/graphql/type/index.mjs b/node_modules/graphql/type/index.mjs new file mode 100644 index 000000000..2ca4c8309 --- /dev/null +++ b/node_modules/graphql/type/index.mjs @@ -0,0 +1,27 @@ +export { // Predicate +isSchema, // Assertion +assertSchema, // GraphQL Schema definition +GraphQLSchema } from './schema'; +export { // Predicates +isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, // Assertions +assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, // Un-modifiers +getNullableType, getNamedType, // Definitions +GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, // Type Wrappers +GraphQLList, GraphQLNonNull } from './definition'; +export { // Predicate +isDirective, // Assertion +assertDirective, // Directives Definition +GraphQLDirective, // Built-in Directives defined by the Spec +isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // Constant Deprecation Reason +DEFAULT_DEPRECATION_REASON } from './directives'; +// Common built-in scalar instances. +export { // Predicate +isSpecifiedScalarType, // Standard GraphQL Scalars +specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from './scalars'; +export { // Predicate +isIntrospectionType, // GraphQL Types for introspection. +introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, // "Enum" of Type Kinds +TypeKind, // Meta-field definitions. +SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from './introspection'; +// Validate GraphQL schema. +export { validateSchema, assertValidSchema } from './validate'; diff --git a/node_modules/graphql/type/introspection.js b/node_modules/graphql/type/introspection.js new file mode 100644 index 000000000..3e6c476bf --- /dev/null +++ b/node_modules/graphql/type/introspection.js @@ -0,0 +1,543 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIntrospectionType = isIntrospectionType; +exports.introspectionTypes = exports.TypeNameMetaFieldDef = exports.TypeMetaFieldDef = exports.SchemaMetaFieldDef = exports.__TypeKind = exports.TypeKind = exports.__EnumValue = exports.__InputValue = exports.__Field = exports.__Type = exports.__DirectiveLocation = exports.__Directive = exports.__Schema = void 0; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _astFromValue = require("../utilities/astFromValue"); + +var _printer = require("../language/printer"); + +var _definition = require("./definition"); + +var _scalars = require("./scalars"); + +var _directiveLocation = require("../language/directiveLocation"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var __Schema = new _definition.GraphQLObjectType({ + name: '__Schema', + description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: function fields() { + return { + types: { + description: 'A list of all types supported by this server.', + type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type))), + resolve: function resolve(schema) { + return (0, _objectValues.default)(schema.getTypeMap()); + } + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: (0, _definition.GraphQLNonNull)(__Type), + resolve: function resolve(schema) { + return schema.getQueryType(); + } + }, + mutationType: { + description: 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: function resolve(schema) { + return schema.getMutationType(); + } + }, + subscriptionType: { + description: 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: function resolve(schema) { + return schema.getSubscriptionType(); + } + }, + directives: { + description: 'A list of all directives supported by this server.', + type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Directive))), + resolve: function resolve(schema) { + return schema.getDirectives(); + } + } + }; + } +}); + +exports.__Schema = __Schema; + +var __Directive = new _definition.GraphQLObjectType({ + name: '__Directive', + description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: function fields() { + return { + name: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + locations: { + type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__DirectiveLocation))), + resolve: function resolve(obj) { + return obj.locations; + } + }, + args: { + type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))), + resolve: function resolve(directive) { + return directive.args; + } + } + }; + } +}); + +exports.__Directive = __Directive; + +var __DirectiveLocation = new _definition.GraphQLEnumType({ + name: '__DirectiveLocation', + description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: _directiveLocation.DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.' + }, + MUTATION: { + value: _directiveLocation.DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.' + }, + SUBSCRIPTION: { + value: _directiveLocation.DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.' + }, + FIELD: { + value: _directiveLocation.DirectiveLocation.FIELD, + description: 'Location adjacent to a field.' + }, + FRAGMENT_DEFINITION: { + value: _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.' + }, + FRAGMENT_SPREAD: { + value: _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.' + }, + INLINE_FRAGMENT: { + value: _directiveLocation.DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.' + }, + VARIABLE_DEFINITION: { + value: _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to a variable definition.' + }, + SCHEMA: { + value: _directiveLocation.DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.' + }, + SCALAR: { + value: _directiveLocation.DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.' + }, + OBJECT: { + value: _directiveLocation.DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.' + }, + FIELD_DEFINITION: { + value: _directiveLocation.DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.' + }, + ARGUMENT_DEFINITION: { + value: _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.' + }, + INTERFACE: { + value: _directiveLocation.DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.' + }, + UNION: { + value: _directiveLocation.DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.' + }, + ENUM: { + value: _directiveLocation.DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.' + }, + ENUM_VALUE: { + value: _directiveLocation.DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.' + }, + INPUT_OBJECT: { + value: _directiveLocation.DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.' + }, + INPUT_FIELD_DEFINITION: { + value: _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.' + } + } +}); + +exports.__DirectiveLocation = __DirectiveLocation; + +var __Type = new _definition.GraphQLObjectType({ + name: '__Type', + description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: function fields() { + return { + kind: { + type: (0, _definition.GraphQLNonNull)(__TypeKind), + resolve: function resolve(type) { + if ((0, _definition.isScalarType)(type)) { + return TypeKind.SCALAR; + } else if ((0, _definition.isObjectType)(type)) { + return TypeKind.OBJECT; + } else if ((0, _definition.isInterfaceType)(type)) { + return TypeKind.INTERFACE; + } else if ((0, _definition.isUnionType)(type)) { + return TypeKind.UNION; + } else if ((0, _definition.isEnumType)(type)) { + return TypeKind.ENUM; + } else if ((0, _definition.isInputObjectType)(type)) { + return TypeKind.INPUT_OBJECT; + } else if ((0, _definition.isListType)(type)) { + return TypeKind.LIST; + } else if ((0, _definition.isNonNullType)(type)) { + return TypeKind.NON_NULL; + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); + } + }, + name: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.name !== undefined ? obj.name : undefined; + } + }, + description: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.description !== undefined ? obj.description : undefined; + } + }, + fields: { + type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Field)), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve: function resolve(type, _ref) { + var includeDeprecated = _ref.includeDeprecated; + + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + var fields = (0, _objectValues.default)(type.getFields()); + + if (!includeDeprecated) { + fields = fields.filter(function (field) { + return !field.deprecationReason; + }); + } + + return fields; + } + + return null; + } + }, + interfaces: { + type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)), + resolve: function resolve(type) { + if ((0, _definition.isObjectType)(type)) { + return type.getInterfaces(); + } + } + }, + possibleTypes: { + type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__Type)), + resolve: function resolve(type, args, context, _ref2) { + var schema = _ref2.schema; + + if ((0, _definition.isAbstractType)(type)) { + return schema.getPossibleTypes(type); + } + } + }, + enumValues: { + type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__EnumValue)), + args: { + includeDeprecated: { + type: _scalars.GraphQLBoolean, + defaultValue: false + } + }, + resolve: function resolve(type, _ref3) { + var includeDeprecated = _ref3.includeDeprecated; + + if ((0, _definition.isEnumType)(type)) { + var values = type.getValues(); + + if (!includeDeprecated) { + values = values.filter(function (value) { + return !value.deprecationReason; + }); + } + + return values; + } + } + }, + inputFields: { + type: (0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue)), + resolve: function resolve(type) { + if ((0, _definition.isInputObjectType)(type)) { + return (0, _objectValues.default)(type.getFields()); + } + } + }, + ofType: { + type: __Type, + resolve: function resolve(obj) { + return obj.ofType !== undefined ? obj.ofType : undefined; + } + } + }; + } +}); + +exports.__Type = __Type; + +var __Field = new _definition.GraphQLObjectType({ + name: '__Field', + description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: function fields() { + return { + name: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + args: { + type: (0, _definition.GraphQLNonNull)((0, _definition.GraphQLList)((0, _definition.GraphQLNonNull)(__InputValue))), + resolve: function resolve(field) { + return field.args; + } + }, + type: { + type: (0, _definition.GraphQLNonNull)(__Type), + resolve: function resolve(obj) { + return obj.type; + } + }, + isDeprecated: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), + resolve: function resolve(obj) { + return obj.isDeprecated; + } + }, + deprecationReason: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.deprecationReason; + } + } + }; + } +}); + +exports.__Field = __Field; + +var __InputValue = new _definition.GraphQLObjectType({ + name: '__InputValue', + description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: function fields() { + return { + name: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + type: { + type: (0, _definition.GraphQLNonNull)(__Type), + resolve: function resolve(obj) { + return obj.type; + } + }, + defaultValue: { + type: _scalars.GraphQLString, + description: 'A GraphQL-formatted string representing the default value for this input value.', + resolve: function resolve(inputVal) { + var valueAST = (0, _astFromValue.astFromValue)(inputVal.defaultValue, inputVal.type); + return valueAST ? (0, _printer.print)(valueAST) : null; + } + } + }; + } +}); + +exports.__InputValue = __InputValue; + +var __EnumValue = new _definition.GraphQLObjectType({ + name: '__EnumValue', + description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: function fields() { + return { + name: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + isDeprecated: { + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLBoolean), + resolve: function resolve(obj) { + return obj.isDeprecated; + } + }, + deprecationReason: { + type: _scalars.GraphQLString, + resolve: function resolve(obj) { + return obj.deprecationReason; + } + } + }; + } +}); + +exports.__EnumValue = __EnumValue; +var TypeKind = Object.freeze({ + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + INPUT_OBJECT: 'INPUT_OBJECT', + LIST: 'LIST', + NON_NULL: 'NON_NULL' +}); +exports.TypeKind = TypeKind; + +var __TypeKind = new _definition.GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.' + }, + OBJECT: { + value: TypeKind.OBJECT, + description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.' + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: 'Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.' + }, + UNION: { + value: TypeKind.UNION, + description: 'Indicates this type is a union. `possibleTypes` is a valid field.' + }, + ENUM: { + value: TypeKind.ENUM, + description: 'Indicates this type is an enum. `enumValues` is a valid field.' + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: 'Indicates this type is an input object. `inputFields` is a valid field.' + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.' + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: 'Indicates this type is a non-null. `ofType` is a valid field.' + } + } +}); +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ + + +exports.__TypeKind = __TypeKind; +var SchemaMetaFieldDef = { + name: '__schema', + type: (0, _definition.GraphQLNonNull)(__Schema), + description: 'Access the current type schema of this server.', + args: [], + resolve: function resolve(source, args, context, _ref4) { + var schema = _ref4.schema; + return schema; + } +}; +exports.SchemaMetaFieldDef = SchemaMetaFieldDef; +var TypeMetaFieldDef = { + name: '__type', + type: __Type, + description: 'Request the type information of a single type.', + args: [{ + name: 'name', + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString) + }], + resolve: function resolve(source, _ref5, context, _ref6) { + var name = _ref5.name; + var schema = _ref6.schema; + return schema.getType(name); + } +}; +exports.TypeMetaFieldDef = TypeMetaFieldDef; +var TypeNameMetaFieldDef = { + name: '__typename', + type: (0, _definition.GraphQLNonNull)(_scalars.GraphQLString), + description: 'The name of the current Object type at runtime.', + args: [], + resolve: function resolve(source, args, context, _ref7) { + var parentType = _ref7.parentType; + return parentType.name; + } +}; +exports.TypeNameMetaFieldDef = TypeNameMetaFieldDef; +var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); +exports.introspectionTypes = introspectionTypes; + +function isIntrospectionType(type) { + return (0, _definition.isNamedType)(type) && introspectionTypes.some(function (_ref8) { + var name = _ref8.name; + return type.name === name; + }); +} diff --git a/node_modules/graphql/type/introspection.js.flow b/node_modules/graphql/type/introspection.js.flow new file mode 100644 index 000000000..3bb6a6210 --- /dev/null +++ b/node_modules/graphql/type/introspection.js.flow @@ -0,0 +1,472 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import { astFromValue } from '../utilities/astFromValue'; +import { print } from '../language/printer'; +import { + type GraphQLType, + type GraphQLInputField, + type GraphQLEnumValue, + type GraphQLField, + type GraphQLFieldConfigMap, + GraphQLObjectType, + GraphQLEnumType, + GraphQLList, + GraphQLNonNull, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isAbstractType, + isNamedType, +} from './definition'; +import { type GraphQLSchema } from './schema'; +import { type GraphQLDirective } from './directives'; +import { GraphQLString, GraphQLBoolean } from './scalars'; +import { DirectiveLocation } from '../language/directiveLocation'; + +export const __Schema = new GraphQLObjectType({ + name: '__Schema', + description: + 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: () => + ({ + types: { + description: 'A list of all types supported by this server.', + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type))), + resolve(schema) { + return objectValues(schema.getTypeMap()); + }, + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: GraphQLNonNull(__Type), + resolve: schema => schema.getQueryType(), + }, + mutationType: { + description: + 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: schema => schema.getMutationType(), + }, + subscriptionType: { + description: + 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: schema => schema.getSubscriptionType(), + }, + directives: { + description: 'A list of all directives supported by this server.', + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive))), + resolve: schema => schema.getDirectives(), + }, + }: GraphQLFieldConfigMap), +}); + +export const __Directive = new GraphQLObjectType({ + name: '__Directive', + description: + "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: () => + ({ + name: { + type: GraphQLNonNull(GraphQLString), + resolve: obj => obj.name, + }, + description: { + type: GraphQLString, + resolve: obj => obj.description, + }, + locations: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation))), + resolve: obj => obj.locations, + }, + args: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))), + resolve: directive => directive.args, + }, + }: GraphQLFieldConfigMap), +}); + +export const __DirectiveLocation = new GraphQLEnumType({ + name: '__DirectiveLocation', + description: + 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.', + }, + MUTATION: { + value: DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.', + }, + SUBSCRIPTION: { + value: DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.', + }, + FIELD: { + value: DirectiveLocation.FIELD, + description: 'Location adjacent to a field.', + }, + FRAGMENT_DEFINITION: { + value: DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.', + }, + FRAGMENT_SPREAD: { + value: DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.', + }, + INLINE_FRAGMENT: { + value: DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.', + }, + VARIABLE_DEFINITION: { + value: DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to a variable definition.', + }, + SCHEMA: { + value: DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.', + }, + SCALAR: { + value: DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.', + }, + OBJECT: { + value: DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.', + }, + FIELD_DEFINITION: { + value: DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.', + }, + ARGUMENT_DEFINITION: { + value: DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.', + }, + INTERFACE: { + value: DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.', + }, + UNION: { + value: DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.', + }, + ENUM: { + value: DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.', + }, + ENUM_VALUE: { + value: DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.', + }, + INPUT_OBJECT: { + value: DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.', + }, + INPUT_FIELD_DEFINITION: { + value: DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.', + }, + }, +}); + +export const __Type = new GraphQLObjectType({ + name: '__Type', + description: + 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: () => + ({ + kind: { + type: GraphQLNonNull(__TypeKind), + resolve(type) { + if (isScalarType(type)) { + return TypeKind.SCALAR; + } else if (isObjectType(type)) { + return TypeKind.OBJECT; + } else if (isInterfaceType(type)) { + return TypeKind.INTERFACE; + } else if (isUnionType(type)) { + return TypeKind.UNION; + } else if (isEnumType(type)) { + return TypeKind.ENUM; + } else if (isInputObjectType(type)) { + return TypeKind.INPUT_OBJECT; + } else if (isListType(type)) { + return TypeKind.LIST; + } else if (isNonNullType(type)) { + return TypeKind.NON_NULL; + } + + // Not reachable. All possible types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected type: "${inspect((type: empty))}".`); + }, + }, + name: { + type: GraphQLString, + resolve: obj => (obj.name !== undefined ? obj.name : undefined), + }, + description: { + type: GraphQLString, + resolve: obj => + obj.description !== undefined ? obj.description : undefined, + }, + fields: { + type: GraphQLList(GraphQLNonNull(__Field)), + args: { + includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, + }, + resolve(type, { includeDeprecated }) { + if (isObjectType(type) || isInterfaceType(type)) { + let fields = objectValues(type.getFields()); + if (!includeDeprecated) { + fields = fields.filter(field => !field.deprecationReason); + } + return fields; + } + return null; + }, + }, + interfaces: { + type: GraphQLList(GraphQLNonNull(__Type)), + resolve(type) { + if (isObjectType(type)) { + return type.getInterfaces(); + } + }, + }, + possibleTypes: { + type: GraphQLList(GraphQLNonNull(__Type)), + resolve(type, args, context, { schema }) { + if (isAbstractType(type)) { + return schema.getPossibleTypes(type); + } + }, + }, + enumValues: { + type: GraphQLList(GraphQLNonNull(__EnumValue)), + args: { + includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, + }, + resolve(type, { includeDeprecated }) { + if (isEnumType(type)) { + let values = type.getValues(); + if (!includeDeprecated) { + values = values.filter(value => !value.deprecationReason); + } + return values; + } + }, + }, + inputFields: { + type: GraphQLList(GraphQLNonNull(__InputValue)), + resolve(type) { + if (isInputObjectType(type)) { + return objectValues(type.getFields()); + } + }, + }, + ofType: { + type: __Type, + resolve: obj => (obj.ofType !== undefined ? obj.ofType : undefined), + }, + }: GraphQLFieldConfigMap), +}); + +export const __Field = new GraphQLObjectType({ + name: '__Field', + description: + 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: () => + ({ + name: { + type: GraphQLNonNull(GraphQLString), + resolve: obj => obj.name, + }, + description: { + type: GraphQLString, + resolve: obj => obj.description, + }, + args: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))), + resolve: field => field.args, + }, + type: { + type: GraphQLNonNull(__Type), + resolve: obj => obj.type, + }, + isDeprecated: { + type: GraphQLNonNull(GraphQLBoolean), + resolve: obj => obj.isDeprecated, + }, + deprecationReason: { + type: GraphQLString, + resolve: obj => obj.deprecationReason, + }, + }: GraphQLFieldConfigMap, mixed>), +}); + +export const __InputValue = new GraphQLObjectType({ + name: '__InputValue', + description: + 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: () => + ({ + name: { + type: GraphQLNonNull(GraphQLString), + resolve: obj => obj.name, + }, + description: { + type: GraphQLString, + resolve: obj => obj.description, + }, + type: { + type: GraphQLNonNull(__Type), + resolve: obj => obj.type, + }, + defaultValue: { + type: GraphQLString, + description: + 'A GraphQL-formatted string representing the default value for this input value.', + resolve(inputVal) { + const valueAST = astFromValue(inputVal.defaultValue, inputVal.type); + return valueAST ? print(valueAST) : null; + }, + }, + }: GraphQLFieldConfigMap), +}); + +export const __EnumValue = new GraphQLObjectType({ + name: '__EnumValue', + description: + 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: () => + ({ + name: { + type: GraphQLNonNull(GraphQLString), + resolve: obj => obj.name, + }, + description: { + type: GraphQLString, + resolve: obj => obj.description, + }, + isDeprecated: { + type: GraphQLNonNull(GraphQLBoolean), + resolve: obj => obj.isDeprecated, + }, + deprecationReason: { + type: GraphQLString, + resolve: obj => obj.deprecationReason, + }, + }: GraphQLFieldConfigMap), +}); + +export const TypeKind = Object.freeze({ + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + INPUT_OBJECT: 'INPUT_OBJECT', + LIST: 'LIST', + NON_NULL: 'NON_NULL', +}); + +export const __TypeKind = new GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.', + }, + OBJECT: { + value: TypeKind.OBJECT, + description: + 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: + 'Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.', + }, + UNION: { + value: TypeKind.UNION, + description: + 'Indicates this type is a union. `possibleTypes` is a valid field.', + }, + ENUM: { + value: TypeKind.ENUM, + description: + 'Indicates this type is an enum. `enumValues` is a valid field.', + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: + 'Indicates this type is an input object. `inputFields` is a valid field.', + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.', + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: + 'Indicates this type is a non-null. `ofType` is a valid field.', + }, + }, +}); + +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ + +export const SchemaMetaFieldDef: GraphQLField = { + name: '__schema', + type: GraphQLNonNull(__Schema), + description: 'Access the current type schema of this server.', + args: [], + resolve: (source, args, context, { schema }) => schema, +}; + +export const TypeMetaFieldDef: GraphQLField = { + name: '__type', + type: __Type, + description: 'Request the type information of a single type.', + args: [{ name: 'name', type: GraphQLNonNull(GraphQLString) }], + resolve: (source, { name }, context, { schema }) => schema.getType(name), +}; + +export const TypeNameMetaFieldDef: GraphQLField = { + name: '__typename', + type: GraphQLNonNull(GraphQLString), + description: 'The name of the current Object type at runtime.', + args: [], + resolve: (source, args, context, { parentType }) => parentType.name, +}; + +export const introspectionTypes = Object.freeze([ + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, +]); + +export function isIntrospectionType(type: mixed): boolean %checks { + return ( + isNamedType(type) && + introspectionTypes.some(({ name }) => type.name === name) + ); +} diff --git a/node_modules/graphql/type/introspection.mjs b/node_modules/graphql/type/introspection.mjs new file mode 100644 index 000000000..76de65497 --- /dev/null +++ b/node_modules/graphql/type/introspection.mjs @@ -0,0 +1,497 @@ +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import { astFromValue } from '../utilities/astFromValue'; +import { print } from '../language/printer'; +import { GraphQLObjectType, GraphQLEnumType, GraphQLList, GraphQLNonNull, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType, isNamedType } from './definition'; +import { GraphQLString, GraphQLBoolean } from './scalars'; +import { DirectiveLocation } from '../language/directiveLocation'; +export var __Schema = new GraphQLObjectType({ + name: '__Schema', + description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + fields: function fields() { + return { + types: { + description: 'A list of all types supported by this server.', + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Type))), + resolve: function resolve(schema) { + return objectValues(schema.getTypeMap()); + } + }, + queryType: { + description: 'The type that query operations will be rooted at.', + type: GraphQLNonNull(__Type), + resolve: function resolve(schema) { + return schema.getQueryType(); + } + }, + mutationType: { + description: 'If this server supports mutation, the type that mutation operations will be rooted at.', + type: __Type, + resolve: function resolve(schema) { + return schema.getMutationType(); + } + }, + subscriptionType: { + description: 'If this server support subscription, the type that subscription operations will be rooted at.', + type: __Type, + resolve: function resolve(schema) { + return schema.getSubscriptionType(); + } + }, + directives: { + description: 'A list of all directives supported by this server.', + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__Directive))), + resolve: function resolve(schema) { + return schema.getDirectives(); + } + } + }; + } +}); +export var __Directive = new GraphQLObjectType({ + name: '__Directive', + description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + fields: function fields() { + return { + name: { + type: GraphQLNonNull(GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + locations: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation))), + resolve: function resolve(obj) { + return obj.locations; + } + }, + args: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))), + resolve: function resolve(directive) { + return directive.args; + } + } + }; + } +}); +export var __DirectiveLocation = new GraphQLEnumType({ + name: '__DirectiveLocation', + description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + values: { + QUERY: { + value: DirectiveLocation.QUERY, + description: 'Location adjacent to a query operation.' + }, + MUTATION: { + value: DirectiveLocation.MUTATION, + description: 'Location adjacent to a mutation operation.' + }, + SUBSCRIPTION: { + value: DirectiveLocation.SUBSCRIPTION, + description: 'Location adjacent to a subscription operation.' + }, + FIELD: { + value: DirectiveLocation.FIELD, + description: 'Location adjacent to a field.' + }, + FRAGMENT_DEFINITION: { + value: DirectiveLocation.FRAGMENT_DEFINITION, + description: 'Location adjacent to a fragment definition.' + }, + FRAGMENT_SPREAD: { + value: DirectiveLocation.FRAGMENT_SPREAD, + description: 'Location adjacent to a fragment spread.' + }, + INLINE_FRAGMENT: { + value: DirectiveLocation.INLINE_FRAGMENT, + description: 'Location adjacent to an inline fragment.' + }, + VARIABLE_DEFINITION: { + value: DirectiveLocation.VARIABLE_DEFINITION, + description: 'Location adjacent to a variable definition.' + }, + SCHEMA: { + value: DirectiveLocation.SCHEMA, + description: 'Location adjacent to a schema definition.' + }, + SCALAR: { + value: DirectiveLocation.SCALAR, + description: 'Location adjacent to a scalar definition.' + }, + OBJECT: { + value: DirectiveLocation.OBJECT, + description: 'Location adjacent to an object type definition.' + }, + FIELD_DEFINITION: { + value: DirectiveLocation.FIELD_DEFINITION, + description: 'Location adjacent to a field definition.' + }, + ARGUMENT_DEFINITION: { + value: DirectiveLocation.ARGUMENT_DEFINITION, + description: 'Location adjacent to an argument definition.' + }, + INTERFACE: { + value: DirectiveLocation.INTERFACE, + description: 'Location adjacent to an interface definition.' + }, + UNION: { + value: DirectiveLocation.UNION, + description: 'Location adjacent to a union definition.' + }, + ENUM: { + value: DirectiveLocation.ENUM, + description: 'Location adjacent to an enum definition.' + }, + ENUM_VALUE: { + value: DirectiveLocation.ENUM_VALUE, + description: 'Location adjacent to an enum value definition.' + }, + INPUT_OBJECT: { + value: DirectiveLocation.INPUT_OBJECT, + description: 'Location adjacent to an input object type definition.' + }, + INPUT_FIELD_DEFINITION: { + value: DirectiveLocation.INPUT_FIELD_DEFINITION, + description: 'Location adjacent to an input object field definition.' + } + } +}); +export var __Type = new GraphQLObjectType({ + name: '__Type', + description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + fields: function fields() { + return { + kind: { + type: GraphQLNonNull(__TypeKind), + resolve: function resolve(type) { + if (isScalarType(type)) { + return TypeKind.SCALAR; + } else if (isObjectType(type)) { + return TypeKind.OBJECT; + } else if (isInterfaceType(type)) { + return TypeKind.INTERFACE; + } else if (isUnionType(type)) { + return TypeKind.UNION; + } else if (isEnumType(type)) { + return TypeKind.ENUM; + } else if (isInputObjectType(type)) { + return TypeKind.INPUT_OBJECT; + } else if (isListType(type)) { + return TypeKind.LIST; + } else if (isNonNullType(type)) { + return TypeKind.NON_NULL; + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat(inspect(type), "\".")); + } + }, + name: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.name !== undefined ? obj.name : undefined; + } + }, + description: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.description !== undefined ? obj.description : undefined; + } + }, + fields: { + type: GraphQLList(GraphQLNonNull(__Field)), + args: { + includeDeprecated: { + type: GraphQLBoolean, + defaultValue: false + } + }, + resolve: function resolve(type, _ref) { + var includeDeprecated = _ref.includeDeprecated; + + if (isObjectType(type) || isInterfaceType(type)) { + var fields = objectValues(type.getFields()); + + if (!includeDeprecated) { + fields = fields.filter(function (field) { + return !field.deprecationReason; + }); + } + + return fields; + } + + return null; + } + }, + interfaces: { + type: GraphQLList(GraphQLNonNull(__Type)), + resolve: function resolve(type) { + if (isObjectType(type)) { + return type.getInterfaces(); + } + } + }, + possibleTypes: { + type: GraphQLList(GraphQLNonNull(__Type)), + resolve: function resolve(type, args, context, _ref2) { + var schema = _ref2.schema; + + if (isAbstractType(type)) { + return schema.getPossibleTypes(type); + } + } + }, + enumValues: { + type: GraphQLList(GraphQLNonNull(__EnumValue)), + args: { + includeDeprecated: { + type: GraphQLBoolean, + defaultValue: false + } + }, + resolve: function resolve(type, _ref3) { + var includeDeprecated = _ref3.includeDeprecated; + + if (isEnumType(type)) { + var values = type.getValues(); + + if (!includeDeprecated) { + values = values.filter(function (value) { + return !value.deprecationReason; + }); + } + + return values; + } + } + }, + inputFields: { + type: GraphQLList(GraphQLNonNull(__InputValue)), + resolve: function resolve(type) { + if (isInputObjectType(type)) { + return objectValues(type.getFields()); + } + } + }, + ofType: { + type: __Type, + resolve: function resolve(obj) { + return obj.ofType !== undefined ? obj.ofType : undefined; + } + } + }; + } +}); +export var __Field = new GraphQLObjectType({ + name: '__Field', + description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + fields: function fields() { + return { + name: { + type: GraphQLNonNull(GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + args: { + type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))), + resolve: function resolve(field) { + return field.args; + } + }, + type: { + type: GraphQLNonNull(__Type), + resolve: function resolve(obj) { + return obj.type; + } + }, + isDeprecated: { + type: GraphQLNonNull(GraphQLBoolean), + resolve: function resolve(obj) { + return obj.isDeprecated; + } + }, + deprecationReason: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.deprecationReason; + } + } + }; + } +}); +export var __InputValue = new GraphQLObjectType({ + name: '__InputValue', + description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + fields: function fields() { + return { + name: { + type: GraphQLNonNull(GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + type: { + type: GraphQLNonNull(__Type), + resolve: function resolve(obj) { + return obj.type; + } + }, + defaultValue: { + type: GraphQLString, + description: 'A GraphQL-formatted string representing the default value for this input value.', + resolve: function resolve(inputVal) { + var valueAST = astFromValue(inputVal.defaultValue, inputVal.type); + return valueAST ? print(valueAST) : null; + } + } + }; + } +}); +export var __EnumValue = new GraphQLObjectType({ + name: '__EnumValue', + description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + fields: function fields() { + return { + name: { + type: GraphQLNonNull(GraphQLString), + resolve: function resolve(obj) { + return obj.name; + } + }, + description: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.description; + } + }, + isDeprecated: { + type: GraphQLNonNull(GraphQLBoolean), + resolve: function resolve(obj) { + return obj.isDeprecated; + } + }, + deprecationReason: { + type: GraphQLString, + resolve: function resolve(obj) { + return obj.deprecationReason; + } + } + }; + } +}); +export var TypeKind = Object.freeze({ + SCALAR: 'SCALAR', + OBJECT: 'OBJECT', + INTERFACE: 'INTERFACE', + UNION: 'UNION', + ENUM: 'ENUM', + INPUT_OBJECT: 'INPUT_OBJECT', + LIST: 'LIST', + NON_NULL: 'NON_NULL' +}); +export var __TypeKind = new GraphQLEnumType({ + name: '__TypeKind', + description: 'An enum describing what kind of type a given `__Type` is.', + values: { + SCALAR: { + value: TypeKind.SCALAR, + description: 'Indicates this type is a scalar.' + }, + OBJECT: { + value: TypeKind.OBJECT, + description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.' + }, + INTERFACE: { + value: TypeKind.INTERFACE, + description: 'Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.' + }, + UNION: { + value: TypeKind.UNION, + description: 'Indicates this type is a union. `possibleTypes` is a valid field.' + }, + ENUM: { + value: TypeKind.ENUM, + description: 'Indicates this type is an enum. `enumValues` is a valid field.' + }, + INPUT_OBJECT: { + value: TypeKind.INPUT_OBJECT, + description: 'Indicates this type is an input object. `inputFields` is a valid field.' + }, + LIST: { + value: TypeKind.LIST, + description: 'Indicates this type is a list. `ofType` is a valid field.' + }, + NON_NULL: { + value: TypeKind.NON_NULL, + description: 'Indicates this type is a non-null. `ofType` is a valid field.' + } + } +}); +/** + * Note that these are GraphQLField and not GraphQLFieldConfig, + * so the format for args is different. + */ + +export var SchemaMetaFieldDef = { + name: '__schema', + type: GraphQLNonNull(__Schema), + description: 'Access the current type schema of this server.', + args: [], + resolve: function resolve(source, args, context, _ref4) { + var schema = _ref4.schema; + return schema; + } +}; +export var TypeMetaFieldDef = { + name: '__type', + type: __Type, + description: 'Request the type information of a single type.', + args: [{ + name: 'name', + type: GraphQLNonNull(GraphQLString) + }], + resolve: function resolve(source, _ref5, context, _ref6) { + var name = _ref5.name; + var schema = _ref6.schema; + return schema.getType(name); + } +}; +export var TypeNameMetaFieldDef = { + name: '__typename', + type: GraphQLNonNull(GraphQLString), + description: 'The name of the current Object type at runtime.', + args: [], + resolve: function resolve(source, args, context, _ref7) { + var parentType = _ref7.parentType; + return parentType.name; + } +}; +export var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); +export function isIntrospectionType(type) { + return isNamedType(type) && introspectionTypes.some(function (_ref8) { + var name = _ref8.name; + return type.name === name; + }); +} diff --git a/node_modules/graphql/type/scalars.js b/node_modules/graphql/type/scalars.js new file mode 100644 index 000000000..3cc7246be --- /dev/null +++ b/node_modules/graphql/type/scalars.js @@ -0,0 +1,256 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isSpecifiedScalarType = isSpecifiedScalarType; +exports.specifiedScalarTypes = exports.GraphQLID = exports.GraphQLBoolean = exports.GraphQLString = exports.GraphQLFloat = exports.GraphQLInt = void 0; + +var _isFinite = _interopRequireDefault(require("../polyfills/isFinite")); + +var _isInteger = _interopRequireDefault(require("../polyfills/isInteger")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _definition = require("./definition"); + +var _kinds = require("../language/kinds"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// As per the GraphQL Spec, Integers are only treated as valid when a valid +// 32-bit signed integer, providing the broadest support across platforms. +// +// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because +// they are internally represented as IEEE 754 doubles. +var MAX_INT = 2147483647; +var MIN_INT = -2147483648; + +function serializeInt(value) { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + var num = value; + + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + + if (!(0, _isInteger.default)(num)) { + throw new TypeError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(value))); + } + + if (num > MAX_INT || num < MIN_INT) { + throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0, _inspect.default)(value))); + } + + return num; +} + +function coerceInt(value) { + if (!(0, _isInteger.default)(value)) { + throw new TypeError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(value))); + } + + if (value > MAX_INT || value < MIN_INT) { + throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat((0, _inspect.default)(value))); + } + + return value; +} + +var GraphQLInt = new _definition.GraphQLScalarType({ + name: 'Int', + description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + serialize: serializeInt, + parseValue: coerceInt, + parseLiteral: function parseLiteral(ast) { + if (ast.kind === _kinds.Kind.INT) { + var num = parseInt(ast.value, 10); + + if (num <= MAX_INT && num >= MIN_INT) { + return num; + } + } + + return undefined; + } +}); +exports.GraphQLInt = GraphQLInt; + +function serializeFloat(value) { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + var num = value; + + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + + if (!(0, _isFinite.default)(num)) { + throw new TypeError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(value))); + } + + return num; +} + +function coerceFloat(value) { + if (!(0, _isFinite.default)(value)) { + throw new TypeError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(value))); + } + + return value; +} + +var GraphQLFloat = new _definition.GraphQLScalarType({ + name: 'Float', + description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + serialize: serializeFloat, + parseValue: coerceFloat, + parseLiteral: function parseLiteral(ast) { + return ast.kind === _kinds.Kind.FLOAT || ast.kind === _kinds.Kind.INT ? parseFloat(ast.value) : undefined; + } +}); // Support serializing objects with custom valueOf() or toJSON() functions - +// a common way to represent a complex value which can be represented as +// a string (ex: MongoDB id objects). + +exports.GraphQLFloat = GraphQLFloat; + +function serializeObject(value) { + if ((0, _isObjectLike.default)(value)) { + if (typeof value.valueOf === 'function') { + var valueOfResult = value.valueOf(); + + if (!(0, _isObjectLike.default)(valueOfResult)) { + return valueOfResult; + } + } + + if (typeof value.toJSON === 'function') { + // $FlowFixMe(>=0.90.0) + return value.toJSON(); + } + } + + return value; +} + +function serializeString(rawValue) { + var value = serializeObject(rawValue); // Serialize string, boolean and number values to a string, but do not + // attempt to coerce object, function, symbol, or other types as strings. + + if (typeof value === 'string') { + return value; + } + + if (typeof value === 'boolean') { + return value ? 'true' : 'false'; + } + + if ((0, _isFinite.default)(value)) { + return value.toString(); + } + + throw new TypeError("String cannot represent value: ".concat((0, _inspect.default)(rawValue))); +} + +function coerceString(value) { + if (typeof value !== 'string') { + throw new TypeError("String cannot represent a non string value: ".concat((0, _inspect.default)(value))); + } + + return value; +} + +var GraphQLString = new _definition.GraphQLScalarType({ + name: 'String', + description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + serialize: serializeString, + parseValue: coerceString, + parseLiteral: function parseLiteral(ast) { + return ast.kind === _kinds.Kind.STRING ? ast.value : undefined; + } +}); +exports.GraphQLString = GraphQLString; + +function serializeBoolean(value) { + if (typeof value === 'boolean') { + return value; + } + + if ((0, _isFinite.default)(value)) { + return value !== 0; + } + + throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(value))); +} + +function coerceBoolean(value) { + if (typeof value !== 'boolean') { + throw new TypeError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(value))); + } + + return value; +} + +var GraphQLBoolean = new _definition.GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + serialize: serializeBoolean, + parseValue: coerceBoolean, + parseLiteral: function parseLiteral(ast) { + return ast.kind === _kinds.Kind.BOOLEAN ? ast.value : undefined; + } +}); +exports.GraphQLBoolean = GraphQLBoolean; + +function serializeID(rawValue) { + var value = serializeObject(rawValue); + + if (typeof value === 'string') { + return value; + } + + if ((0, _isInteger.default)(value)) { + return String(value); + } + + throw new TypeError("ID cannot represent value: ".concat((0, _inspect.default)(rawValue))); +} + +function coerceID(value) { + if (typeof value === 'string') { + return value; + } + + if ((0, _isInteger.default)(value)) { + return value.toString(); + } + + throw new TypeError("ID cannot represent value: ".concat((0, _inspect.default)(value))); +} + +var GraphQLID = new _definition.GraphQLScalarType({ + name: 'ID', + description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + serialize: serializeID, + parseValue: coerceID, + parseLiteral: function parseLiteral(ast) { + return ast.kind === _kinds.Kind.STRING || ast.kind === _kinds.Kind.INT ? ast.value : undefined; + } +}); +exports.GraphQLID = GraphQLID; +var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); +exports.specifiedScalarTypes = specifiedScalarTypes; + +function isSpecifiedScalarType(type) { + return (0, _definition.isScalarType)(type) && specifiedScalarTypes.some(function (_ref) { + var name = _ref.name; + return type.name === name; + }); +} diff --git a/node_modules/graphql/type/scalars.js.flow b/node_modules/graphql/type/scalars.js.flow new file mode 100644 index 000000000..05f60c63c --- /dev/null +++ b/node_modules/graphql/type/scalars.js.flow @@ -0,0 +1,246 @@ +// @flow strict + +import isFinite from '../polyfills/isFinite'; +import isInteger from '../polyfills/isInteger'; +import inspect from '../jsutils/inspect'; +import isObjectLike from '../jsutils/isObjectLike'; +import { GraphQLScalarType, isScalarType } from './definition'; +import { Kind } from '../language/kinds'; + +// As per the GraphQL Spec, Integers are only treated as valid when a valid +// 32-bit signed integer, providing the broadest support across platforms. +// +// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because +// they are internally represented as IEEE 754 doubles. +const MAX_INT = 2147483647; +const MIN_INT = -2147483648; + +function serializeInt(value: mixed): number { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + let num = value; + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + + if (!isInteger(num)) { + throw new TypeError( + `Int cannot represent non-integer value: ${inspect(value)}`, + ); + } + if (num > MAX_INT || num < MIN_INT) { + throw new TypeError( + `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`, + ); + } + return num; +} + +function coerceInt(value: mixed): number { + if (!isInteger(value)) { + throw new TypeError( + `Int cannot represent non-integer value: ${inspect(value)}`, + ); + } + if (value > MAX_INT || value < MIN_INT) { + throw new TypeError( + `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`, + ); + } + return value; +} + +export const GraphQLInt = new GraphQLScalarType({ + name: 'Int', + description: + 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + serialize: serializeInt, + parseValue: coerceInt, + parseLiteral(ast) { + if (ast.kind === Kind.INT) { + const num = parseInt(ast.value, 10); + if (num <= MAX_INT && num >= MIN_INT) { + return num; + } + } + return undefined; + }, +}); + +function serializeFloat(value: mixed): number { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + let num = value; + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + if (!isFinite(num)) { + throw new TypeError( + `Float cannot represent non numeric value: ${inspect(value)}`, + ); + } + return num; +} + +function coerceFloat(value: mixed): number { + if (!isFinite(value)) { + throw new TypeError( + `Float cannot represent non numeric value: ${inspect(value)}`, + ); + } + return value; +} + +export const GraphQLFloat = new GraphQLScalarType({ + name: 'Float', + description: + 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + serialize: serializeFloat, + parseValue: coerceFloat, + parseLiteral(ast) { + return ast.kind === Kind.FLOAT || ast.kind === Kind.INT + ? parseFloat(ast.value) + : undefined; + }, +}); + +// Support serializing objects with custom valueOf() or toJSON() functions - +// a common way to represent a complex value which can be represented as +// a string (ex: MongoDB id objects). +function serializeObject(value: mixed): mixed { + if (isObjectLike(value)) { + if (typeof value.valueOf === 'function') { + const valueOfResult = value.valueOf(); + if (!isObjectLike(valueOfResult)) { + return valueOfResult; + } + } + if (typeof value.toJSON === 'function') { + // $FlowFixMe(>=0.90.0) + return value.toJSON(); + } + } + return value; +} + +function serializeString(rawValue: mixed): string { + const value = serializeObject(rawValue); + + // Serialize string, boolean and number values to a string, but do not + // attempt to coerce object, function, symbol, or other types as strings. + if (typeof value === 'string') { + return value; + } + if (typeof value === 'boolean') { + return value ? 'true' : 'false'; + } + if (isFinite(value)) { + return value.toString(); + } + throw new TypeError(`String cannot represent value: ${inspect(rawValue)}`); +} + +function coerceString(value: mixed): string { + if (typeof value !== 'string') { + throw new TypeError( + `String cannot represent a non string value: ${inspect(value)}`, + ); + } + return value; +} + +export const GraphQLString = new GraphQLScalarType({ + name: 'String', + description: + 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + serialize: serializeString, + parseValue: coerceString, + parseLiteral(ast) { + return ast.kind === Kind.STRING ? ast.value : undefined; + }, +}); + +function serializeBoolean(value: mixed): boolean { + if (typeof value === 'boolean') { + return value; + } + if (isFinite(value)) { + return value !== 0; + } + throw new TypeError( + `Boolean cannot represent a non boolean value: ${inspect(value)}`, + ); +} + +function coerceBoolean(value: mixed): boolean { + if (typeof value !== 'boolean') { + throw new TypeError( + `Boolean cannot represent a non boolean value: ${inspect(value)}`, + ); + } + return value; +} + +export const GraphQLBoolean = new GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + serialize: serializeBoolean, + parseValue: coerceBoolean, + parseLiteral(ast) { + return ast.kind === Kind.BOOLEAN ? ast.value : undefined; + }, +}); + +function serializeID(rawValue: mixed): string { + const value = serializeObject(rawValue); + + if (typeof value === 'string') { + return value; + } + if (isInteger(value)) { + return String(value); + } + throw new TypeError(`ID cannot represent value: ${inspect(rawValue)}`); +} + +function coerceID(value: mixed): string { + if (typeof value === 'string') { + return value; + } + if (isInteger(value)) { + return value.toString(); + } + throw new TypeError(`ID cannot represent value: ${inspect(value)}`); +} + +export const GraphQLID = new GraphQLScalarType({ + name: 'ID', + description: + 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + serialize: serializeID, + parseValue: coerceID, + parseLiteral(ast) { + return ast.kind === Kind.STRING || ast.kind === Kind.INT + ? ast.value + : undefined; + }, +}); + +export const specifiedScalarTypes = Object.freeze([ + GraphQLString, + GraphQLInt, + GraphQLFloat, + GraphQLBoolean, + GraphQLID, +]); + +export function isSpecifiedScalarType(type: mixed): boolean %checks { + return ( + isScalarType(type) && + specifiedScalarTypes.some(({ name }) => type.name === name) + ); +} diff --git a/node_modules/graphql/type/scalars.mjs b/node_modules/graphql/type/scalars.mjs new file mode 100644 index 000000000..84c0ff84a --- /dev/null +++ b/node_modules/graphql/type/scalars.mjs @@ -0,0 +1,232 @@ +import isFinite from '../polyfills/isFinite'; +import isInteger from '../polyfills/isInteger'; +import inspect from '../jsutils/inspect'; +import isObjectLike from '../jsutils/isObjectLike'; +import { GraphQLScalarType, isScalarType } from './definition'; +import { Kind } from '../language/kinds'; // As per the GraphQL Spec, Integers are only treated as valid when a valid +// 32-bit signed integer, providing the broadest support across platforms. +// +// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because +// they are internally represented as IEEE 754 doubles. + +var MAX_INT = 2147483647; +var MIN_INT = -2147483648; + +function serializeInt(value) { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + var num = value; + + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + + if (!isInteger(num)) { + throw new TypeError("Int cannot represent non-integer value: ".concat(inspect(value))); + } + + if (num > MAX_INT || num < MIN_INT) { + throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat(inspect(value))); + } + + return num; +} + +function coerceInt(value) { + if (!isInteger(value)) { + throw new TypeError("Int cannot represent non-integer value: ".concat(inspect(value))); + } + + if (value > MAX_INT || value < MIN_INT) { + throw new TypeError("Int cannot represent non 32-bit signed integer value: ".concat(inspect(value))); + } + + return value; +} + +export var GraphQLInt = new GraphQLScalarType({ + name: 'Int', + description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + serialize: serializeInt, + parseValue: coerceInt, + parseLiteral: function parseLiteral(ast) { + if (ast.kind === Kind.INT) { + var num = parseInt(ast.value, 10); + + if (num <= MAX_INT && num >= MIN_INT) { + return num; + } + } + + return undefined; + } +}); + +function serializeFloat(value) { + if (typeof value === 'boolean') { + return value ? 1 : 0; + } + + var num = value; + + if (typeof value === 'string' && value !== '') { + num = Number(value); + } + + if (!isFinite(num)) { + throw new TypeError("Float cannot represent non numeric value: ".concat(inspect(value))); + } + + return num; +} + +function coerceFloat(value) { + if (!isFinite(value)) { + throw new TypeError("Float cannot represent non numeric value: ".concat(inspect(value))); + } + + return value; +} + +export var GraphQLFloat = new GraphQLScalarType({ + name: 'Float', + description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + serialize: serializeFloat, + parseValue: coerceFloat, + parseLiteral: function parseLiteral(ast) { + return ast.kind === Kind.FLOAT || ast.kind === Kind.INT ? parseFloat(ast.value) : undefined; + } +}); // Support serializing objects with custom valueOf() or toJSON() functions - +// a common way to represent a complex value which can be represented as +// a string (ex: MongoDB id objects). + +function serializeObject(value) { + if (isObjectLike(value)) { + if (typeof value.valueOf === 'function') { + var valueOfResult = value.valueOf(); + + if (!isObjectLike(valueOfResult)) { + return valueOfResult; + } + } + + if (typeof value.toJSON === 'function') { + // $FlowFixMe(>=0.90.0) + return value.toJSON(); + } + } + + return value; +} + +function serializeString(rawValue) { + var value = serializeObject(rawValue); // Serialize string, boolean and number values to a string, but do not + // attempt to coerce object, function, symbol, or other types as strings. + + if (typeof value === 'string') { + return value; + } + + if (typeof value === 'boolean') { + return value ? 'true' : 'false'; + } + + if (isFinite(value)) { + return value.toString(); + } + + throw new TypeError("String cannot represent value: ".concat(inspect(rawValue))); +} + +function coerceString(value) { + if (typeof value !== 'string') { + throw new TypeError("String cannot represent a non string value: ".concat(inspect(value))); + } + + return value; +} + +export var GraphQLString = new GraphQLScalarType({ + name: 'String', + description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + serialize: serializeString, + parseValue: coerceString, + parseLiteral: function parseLiteral(ast) { + return ast.kind === Kind.STRING ? ast.value : undefined; + } +}); + +function serializeBoolean(value) { + if (typeof value === 'boolean') { + return value; + } + + if (isFinite(value)) { + return value !== 0; + } + + throw new TypeError("Boolean cannot represent a non boolean value: ".concat(inspect(value))); +} + +function coerceBoolean(value) { + if (typeof value !== 'boolean') { + throw new TypeError("Boolean cannot represent a non boolean value: ".concat(inspect(value))); + } + + return value; +} + +export var GraphQLBoolean = new GraphQLScalarType({ + name: 'Boolean', + description: 'The `Boolean` scalar type represents `true` or `false`.', + serialize: serializeBoolean, + parseValue: coerceBoolean, + parseLiteral: function parseLiteral(ast) { + return ast.kind === Kind.BOOLEAN ? ast.value : undefined; + } +}); + +function serializeID(rawValue) { + var value = serializeObject(rawValue); + + if (typeof value === 'string') { + return value; + } + + if (isInteger(value)) { + return String(value); + } + + throw new TypeError("ID cannot represent value: ".concat(inspect(rawValue))); +} + +function coerceID(value) { + if (typeof value === 'string') { + return value; + } + + if (isInteger(value)) { + return value.toString(); + } + + throw new TypeError("ID cannot represent value: ".concat(inspect(value))); +} + +export var GraphQLID = new GraphQLScalarType({ + name: 'ID', + description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + serialize: serializeID, + parseValue: coerceID, + parseLiteral: function parseLiteral(ast) { + return ast.kind === Kind.STRING || ast.kind === Kind.INT ? ast.value : undefined; + } +}); +export var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); +export function isSpecifiedScalarType(type) { + return isScalarType(type) && specifiedScalarTypes.some(function (_ref) { + var name = _ref.name; + return type.name === name; + }); +} diff --git a/node_modules/graphql/type/schema.js b/node_modules/graphql/type/schema.js new file mode 100644 index 000000000..9e57f537b --- /dev/null +++ b/node_modules/graphql/type/schema.js @@ -0,0 +1,386 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isSchema = isSchema; +exports.assertSchema = assertSchema; +exports.GraphQLSchema = void 0; + +var _find = _interopRequireDefault(require("../polyfills/find")); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _definition = require("./definition"); + +var _directives = require("./directives"); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _introspection = require("./introspection"); + +var _defineToStringTag = _interopRequireDefault(require("../jsutils/defineToStringTag")); + +var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eslint-disable-next-line no-redeclare +function isSchema(schema) { + return (0, _instanceOf.default)(schema, GraphQLSchema); +} + +function assertSchema(schema) { + !isSchema(schema) ? (0, _invariant.default)(0, "Expected ".concat((0, _inspect.default)(schema), " to be a GraphQL schema.")) : void 0; + return schema; +} +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * + * Example: + * + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }) + * + * Note: When the schema is constructed, by default only the types that are + * reachable by traversing the root types are included, other types must be + * explicitly referenced. + * + * Example: + * + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * ... + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * ... + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * ... + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface, ... }, + * } + * }), + * ... + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }) + * + * Note: If an array of `directives` are provided to GraphQLSchema, that will be + * the exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. @include and + * @skip) will be used. If you wish to provide *additional* directives to these + * specified directives, you must explicitly declare them. Example: + * + * const MyAppSchema = new GraphQLSchema({ + * ... + * directives: specifiedDirectives.concat([ myCustomDirective ]), + * }) + * + */ + + +var GraphQLSchema = +/*#__PURE__*/ +function () { + // Used as a cache for validateSchema(). + // Referenced by validateSchema(). + function GraphQLSchema(config) { + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + if (config && config.assumeValid) { + this.__validationErrors = []; + } else { + this.__validationErrors = undefined; // Otherwise check for common mistakes during construction to produce + // clear and early error messages. + + !(0, _isObjectLike.default)(config) ? (0, _invariant.default)(0, 'Must provide configuration object.') : void 0; + !(!config.types || Array.isArray(config.types)) ? (0, _invariant.default)(0, "\"types\" must be Array if provided but got: ".concat((0, _inspect.default)(config.types), ".")) : void 0; + !(!config.directives || Array.isArray(config.directives)) ? (0, _invariant.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config.directives), ".")) : void 0; + !(!config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames)) ? (0, _invariant.default)(0, '"allowedLegacyNames" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config.allowedLegacyNames), ".")) : void 0; + } + + this.__allowedLegacyNames = config.allowedLegacyNames || []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. + + this._directives = config.directives || _directives.specifiedDirectives; + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes; // Build type map now to detect any errors within this schema. + + var initialTypes = [this.getQueryType(), this.getMutationType(), this.getSubscriptionType(), _introspection.__Schema]; + var types = config.types; + + if (types) { + initialTypes = initialTypes.concat(types); + } // Keep track of all types referenced within the schema. + + + var typeMap = Object.create(null); // First by deeply visiting all initial types. + + typeMap = initialTypes.reduce(typeMapReducer, typeMap); // Then by deeply visiting all directive types. + + typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); // Storing the resulting map for reference by the schema. + + this._typeMap = typeMap; + this._possibleTypeMap = Object.create(null); // Keep track of all implementations by interface name. + + this._implementations = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectValues.default)(this._typeMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var type = _step.value; + + if ((0, _definition.isObjectType)(type)) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = type.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var iface = _step2.value; + + if ((0, _definition.isInterfaceType)(iface)) { + var impls = this._implementations[iface.name]; + + if (impls) { + impls.push(type); + } else { + this._implementations[iface.name] = [type]; + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else if ((0, _definition.isAbstractType)(type) && !this._implementations[type.name]) { + this._implementations[type.name] = []; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + var _proto = GraphQLSchema.prototype; + + _proto.getQueryType = function getQueryType() { + return this._queryType; + }; + + _proto.getMutationType = function getMutationType() { + return this._mutationType; + }; + + _proto.getSubscriptionType = function getSubscriptionType() { + return this._subscriptionType; + }; + + _proto.getTypeMap = function getTypeMap() { + return this._typeMap; + }; + + _proto.getType = function getType(name) { + return this.getTypeMap()[name]; + }; + + _proto.getPossibleTypes = function getPossibleTypes(abstractType) { + if ((0, _definition.isUnionType)(abstractType)) { + return abstractType.getTypes(); + } + + return this._implementations[abstractType.name]; + }; + + _proto.isPossibleType = function isPossibleType(abstractType, possibleType) { + var possibleTypeMap = this._possibleTypeMap; + + if (!possibleTypeMap[abstractType.name]) { + var possibleTypes = this.getPossibleTypes(abstractType); + possibleTypeMap[abstractType.name] = possibleTypes.reduce(function (map, type) { + map[type.name] = true; + return map; + }, Object.create(null)); + } + + return Boolean(possibleTypeMap[abstractType.name][possibleType.name]); + }; + + _proto.getDirectives = function getDirectives() { + return this._directives; + }; + + _proto.getDirective = function getDirective(name) { + return (0, _find.default)(this.getDirectives(), function (directive) { + return directive.name === name; + }); + }; + + _proto.toConfig = function toConfig() { + return { + types: (0, _objectValues.default)(this.getTypeMap()), + directives: this.getDirectives().slice(), + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + assumeValid: this.__validationErrors !== undefined, + allowedLegacyNames: this.__allowedLegacyNames + }; + }; + + return GraphQLSchema; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + + +exports.GraphQLSchema = GraphQLSchema; +(0, _defineToStringTag.default)(GraphQLSchema); + +function typeMapReducer(map, type) { + if (!type) { + return map; + } + + if ((0, _definition.isWrappingType)(type)) { + return typeMapReducer(map, type.ofType); + } + + if (map[type.name]) { + !(map[type.name] === type) ? (0, _invariant.default)(0, 'Schema must contain uniquely named types but contains multiple ' + "types named \"".concat(type.name, "\".")) : void 0; + return map; + } + + map[type.name] = type; + var reducedMap = map; + + if ((0, _definition.isUnionType)(type)) { + reducedMap = type.getTypes().reduce(typeMapReducer, reducedMap); + } + + if ((0, _definition.isObjectType)(type)) { + reducedMap = type.getInterfaces().reduce(typeMapReducer, reducedMap); + } + + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = (0, _objectValues.default)(type.getFields())[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var field = _step3.value; + + if (field.args) { + var fieldArgTypes = field.args.map(function (arg) { + return arg.type; + }); + reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap); + } + + reducedMap = typeMapReducer(reducedMap, field.type); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + if ((0, _definition.isInputObjectType)(type)) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = (0, _objectValues.default)(type.getFields())[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _field = _step4.value; + reducedMap = typeMapReducer(reducedMap, _field.type); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } + + return reducedMap; +} + +function typeMapDirectiveReducer(map, directive) { + // Directives are not validated until validateSchema() is called. + if (!(0, _directives.isDirective)(directive)) { + return map; + } + + return directive.args.reduce(function (_map, arg) { + return typeMapReducer(_map, arg.type); + }, map); +} diff --git a/node_modules/graphql/type/schema.js.flow b/node_modules/graphql/type/schema.js.flow new file mode 100644 index 000000000..95071d39b --- /dev/null +++ b/node_modules/graphql/type/schema.js.flow @@ -0,0 +1,384 @@ +// @flow strict + +import find from '../polyfills/find'; +import objectValues from '../polyfills/objectValues'; +import isObjectLike from '../jsutils/isObjectLike'; +import { + type GraphQLType, + type GraphQLNamedType, + type GraphQLAbstractType, + type GraphQLObjectType, + isAbstractType, + isObjectType, + isInterfaceType, + isUnionType, + isInputObjectType, + isWrappingType, +} from './definition'; +import { + type SchemaDefinitionNode, + type SchemaExtensionNode, +} from '../language/ast'; +import { + GraphQLDirective, + isDirective, + specifiedDirectives, +} from './directives'; +import { type GraphQLError } from '../error/GraphQLError'; +import inspect from '../jsutils/inspect'; +import { __Schema } from './introspection'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import instanceOf from '../jsutils/instanceOf'; +import invariant from '../jsutils/invariant'; +import { type ObjMap } from '../jsutils/ObjMap'; + +/** + * Test if the given value is a GraphQL schema. + */ +declare function isSchema(schema: mixed): boolean %checks(schema instanceof + GraphQLSchema); +// eslint-disable-next-line no-redeclare +export function isSchema(schema) { + return instanceOf(schema, GraphQLSchema); +} + +export function assertSchema(schema: mixed): GraphQLSchema { + invariant( + isSchema(schema), + `Expected ${inspect(schema)} to be a GraphQL schema.`, + ); + return schema; +} + +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * + * Example: + * + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }) + * + * Note: When the schema is constructed, by default only the types that are + * reachable by traversing the root types are included, other types must be + * explicitly referenced. + * + * Example: + * + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * ... + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * ... + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * ... + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface, ... }, + * } + * }), + * ... + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }) + * + * Note: If an array of `directives` are provided to GraphQLSchema, that will be + * the exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. @include and + * @skip) will be used. If you wish to provide *additional* directives to these + * specified directives, you must explicitly declare them. Example: + * + * const MyAppSchema = new GraphQLSchema({ + * ... + * directives: specifiedDirectives.concat([ myCustomDirective ]), + * }) + * + */ +export class GraphQLSchema { + astNode: ?SchemaDefinitionNode; + extensionASTNodes: ?$ReadOnlyArray; + _queryType: ?GraphQLObjectType; + _mutationType: ?GraphQLObjectType; + _subscriptionType: ?GraphQLObjectType; + _directives: $ReadOnlyArray; + _typeMap: TypeMap; + _implementations: ObjMap>; + _possibleTypeMap: ObjMap>; + // Used as a cache for validateSchema(). + __validationErrors: ?$ReadOnlyArray; + // Referenced by validateSchema(). + __allowedLegacyNames: $ReadOnlyArray; + + constructor(config: GraphQLSchemaConfig): void { + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + if (config && config.assumeValid) { + this.__validationErrors = []; + } else { + this.__validationErrors = undefined; + + // Otherwise check for common mistakes during construction to produce + // clear and early error messages. + invariant(isObjectLike(config), 'Must provide configuration object.'); + invariant( + !config.types || Array.isArray(config.types), + `"types" must be Array if provided but got: ${inspect(config.types)}.`, + ); + invariant( + !config.directives || Array.isArray(config.directives), + '"directives" must be Array if provided but got: ' + + `${inspect(config.directives)}.`, + ); + invariant( + !config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames), + '"allowedLegacyNames" must be Array if provided but got: ' + + `${inspect(config.allowedLegacyNames)}.`, + ); + } + + this.__allowedLegacyNames = config.allowedLegacyNames || []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; + // Provide specified directives (e.g. @include and @skip) by default. + this._directives = config.directives || specifiedDirectives; + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes; + + // Build type map now to detect any errors within this schema. + let initialTypes: Array = [ + this.getQueryType(), + this.getMutationType(), + this.getSubscriptionType(), + __Schema, + ]; + + const types = config.types; + if (types) { + initialTypes = initialTypes.concat(types); + } + + // Keep track of all types referenced within the schema. + let typeMap: TypeMap = Object.create(null); + + // First by deeply visiting all initial types. + typeMap = initialTypes.reduce(typeMapReducer, typeMap); + + // Then by deeply visiting all directive types. + typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); + + // Storing the resulting map for reference by the schema. + this._typeMap = typeMap; + + this._possibleTypeMap = Object.create(null); + + // Keep track of all implementations by interface name. + this._implementations = Object.create(null); + for (const type of objectValues(this._typeMap)) { + if (isObjectType(type)) { + for (const iface of type.getInterfaces()) { + if (isInterfaceType(iface)) { + const impls = this._implementations[iface.name]; + if (impls) { + impls.push(type); + } else { + this._implementations[iface.name] = [type]; + } + } + } + } else if (isAbstractType(type) && !this._implementations[type.name]) { + this._implementations[type.name] = []; + } + } + } + + getQueryType(): ?GraphQLObjectType { + return this._queryType; + } + + getMutationType(): ?GraphQLObjectType { + return this._mutationType; + } + + getSubscriptionType(): ?GraphQLObjectType { + return this._subscriptionType; + } + + getTypeMap(): TypeMap { + return this._typeMap; + } + + getType(name: string): ?GraphQLNamedType { + return this.getTypeMap()[name]; + } + + getPossibleTypes( + abstractType: GraphQLAbstractType, + ): $ReadOnlyArray { + if (isUnionType(abstractType)) { + return abstractType.getTypes(); + } + return this._implementations[abstractType.name]; + } + + isPossibleType( + abstractType: GraphQLAbstractType, + possibleType: GraphQLObjectType, + ): boolean { + const possibleTypeMap = this._possibleTypeMap; + + if (!possibleTypeMap[abstractType.name]) { + const possibleTypes = this.getPossibleTypes(abstractType); + possibleTypeMap[abstractType.name] = possibleTypes.reduce((map, type) => { + map[type.name] = true; + return map; + }, Object.create(null)); + } + + return Boolean(possibleTypeMap[abstractType.name][possibleType.name]); + } + + getDirectives(): $ReadOnlyArray { + return this._directives; + } + + getDirective(name: string): ?GraphQLDirective { + return find(this.getDirectives(), directive => directive.name === name); + } + + toConfig(): {| + ...GraphQLSchemaConfig, + types: Array, + directives: Array, + extensionASTNodes: $ReadOnlyArray, + assumeValid: boolean, + allowedLegacyNames: $ReadOnlyArray, + |} { + return { + types: objectValues(this.getTypeMap()), + directives: this.getDirectives().slice(), + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + assumeValid: this.__validationErrors !== undefined, + allowedLegacyNames: this.__allowedLegacyNames, + }; + } +} + +// Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported +defineToStringTag(GraphQLSchema); + +type TypeMap = ObjMap; + +export type GraphQLSchemaValidationOptions = {| + /** + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + */ + assumeValid?: boolean, + + /** + * If provided, the schema will consider fields or types with names included + * in this list valid, even if they do not adhere to the specification's + * schema validation rules. + * + * This option is provided to ease adoption and will be removed in v15. + */ + allowedLegacyNames?: ?$ReadOnlyArray, +|}; + +export type GraphQLSchemaConfig = {| + query?: ?GraphQLObjectType, + mutation?: ?GraphQLObjectType, + subscription?: ?GraphQLObjectType, + types?: ?Array, + directives?: ?Array, + astNode?: ?SchemaDefinitionNode, + extensionASTNodes?: ?$ReadOnlyArray, + ...GraphQLSchemaValidationOptions, +|}; + +function typeMapReducer(map: TypeMap, type: ?GraphQLType): TypeMap { + if (!type) { + return map; + } + if (isWrappingType(type)) { + return typeMapReducer(map, type.ofType); + } + if (map[type.name]) { + invariant( + map[type.name] === type, + 'Schema must contain uniquely named types but contains multiple ' + + `types named "${type.name}".`, + ); + return map; + } + map[type.name] = type; + + let reducedMap = map; + + if (isUnionType(type)) { + reducedMap = type.getTypes().reduce(typeMapReducer, reducedMap); + } + + if (isObjectType(type)) { + reducedMap = type.getInterfaces().reduce(typeMapReducer, reducedMap); + } + + if (isObjectType(type) || isInterfaceType(type)) { + for (const field of objectValues(type.getFields())) { + if (field.args) { + const fieldArgTypes = field.args.map(arg => arg.type); + reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap); + } + reducedMap = typeMapReducer(reducedMap, field.type); + } + } + + if (isInputObjectType(type)) { + for (const field of objectValues(type.getFields())) { + reducedMap = typeMapReducer(reducedMap, field.type); + } + } + + return reducedMap; +} + +function typeMapDirectiveReducer( + map: TypeMap, + directive: ?GraphQLDirective, +): TypeMap { + // Directives are not validated until validateSchema() is called. + if (!isDirective(directive)) { + return map; + } + return directive.args.reduce( + (_map, arg) => typeMapReducer(_map, arg.type), + map, + ); +} diff --git a/node_modules/graphql/type/schema.mjs b/node_modules/graphql/type/schema.mjs new file mode 100644 index 000000000..fe4451a69 --- /dev/null +++ b/node_modules/graphql/type/schema.mjs @@ -0,0 +1,361 @@ +import find from '../polyfills/find'; +import objectValues from '../polyfills/objectValues'; +import isObjectLike from '../jsutils/isObjectLike'; +import { isAbstractType, isObjectType, isInterfaceType, isUnionType, isInputObjectType, isWrappingType } from './definition'; +import { GraphQLDirective, isDirective, specifiedDirectives } from './directives'; +import inspect from '../jsutils/inspect'; +import { __Schema } from './introspection'; +import defineToStringTag from '../jsutils/defineToStringTag'; +import instanceOf from '../jsutils/instanceOf'; +import invariant from '../jsutils/invariant'; +// eslint-disable-next-line no-redeclare +export function isSchema(schema) { + return instanceOf(schema, GraphQLSchema); +} +export function assertSchema(schema) { + !isSchema(schema) ? invariant(0, "Expected ".concat(inspect(schema), " to be a GraphQL schema.")) : void 0; + return schema; +} +/** + * Schema Definition + * + * A Schema is created by supplying the root types of each type of operation, + * query and mutation (optional). A schema definition is then supplied to the + * validator and executor. + * + * Example: + * + * const MyAppSchema = new GraphQLSchema({ + * query: MyAppQueryRootType, + * mutation: MyAppMutationRootType, + * }) + * + * Note: When the schema is constructed, by default only the types that are + * reachable by traversing the root types are included, other types must be + * explicitly referenced. + * + * Example: + * + * const characterInterface = new GraphQLInterfaceType({ + * name: 'Character', + * ... + * }); + * + * const humanType = new GraphQLObjectType({ + * name: 'Human', + * interfaces: [characterInterface], + * ... + * }); + * + * const droidType = new GraphQLObjectType({ + * name: 'Droid', + * interfaces: [characterInterface], + * ... + * }); + * + * const schema = new GraphQLSchema({ + * query: new GraphQLObjectType({ + * name: 'Query', + * fields: { + * hero: { type: characterInterface, ... }, + * } + * }), + * ... + * // Since this schema references only the `Character` interface it's + * // necessary to explicitly list the types that implement it if + * // you want them to be included in the final schema. + * types: [humanType, droidType], + * }) + * + * Note: If an array of `directives` are provided to GraphQLSchema, that will be + * the exact list of directives represented and allowed. If `directives` is not + * provided then a default set of the specified directives (e.g. @include and + * @skip) will be used. If you wish to provide *additional* directives to these + * specified directives, you must explicitly declare them. Example: + * + * const MyAppSchema = new GraphQLSchema({ + * ... + * directives: specifiedDirectives.concat([ myCustomDirective ]), + * }) + * + */ + +export var GraphQLSchema = +/*#__PURE__*/ +function () { + // Used as a cache for validateSchema(). + // Referenced by validateSchema(). + function GraphQLSchema(config) { + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + if (config && config.assumeValid) { + this.__validationErrors = []; + } else { + this.__validationErrors = undefined; // Otherwise check for common mistakes during construction to produce + // clear and early error messages. + + !isObjectLike(config) ? invariant(0, 'Must provide configuration object.') : void 0; + !(!config.types || Array.isArray(config.types)) ? invariant(0, "\"types\" must be Array if provided but got: ".concat(inspect(config.types), ".")) : void 0; + !(!config.directives || Array.isArray(config.directives)) ? invariant(0, '"directives" must be Array if provided but got: ' + "".concat(inspect(config.directives), ".")) : void 0; + !(!config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames)) ? invariant(0, '"allowedLegacyNames" must be Array if provided but got: ' + "".concat(inspect(config.allowedLegacyNames), ".")) : void 0; + } + + this.__allowedLegacyNames = config.allowedLegacyNames || []; + this._queryType = config.query; + this._mutationType = config.mutation; + this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default. + + this._directives = config.directives || specifiedDirectives; + this.astNode = config.astNode; + this.extensionASTNodes = config.extensionASTNodes; // Build type map now to detect any errors within this schema. + + var initialTypes = [this.getQueryType(), this.getMutationType(), this.getSubscriptionType(), __Schema]; + var types = config.types; + + if (types) { + initialTypes = initialTypes.concat(types); + } // Keep track of all types referenced within the schema. + + + var typeMap = Object.create(null); // First by deeply visiting all initial types. + + typeMap = initialTypes.reduce(typeMapReducer, typeMap); // Then by deeply visiting all directive types. + + typeMap = this._directives.reduce(typeMapDirectiveReducer, typeMap); // Storing the resulting map for reference by the schema. + + this._typeMap = typeMap; + this._possibleTypeMap = Object.create(null); // Keep track of all implementations by interface name. + + this._implementations = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectValues(this._typeMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var type = _step.value; + + if (isObjectType(type)) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = type.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var iface = _step2.value; + + if (isInterfaceType(iface)) { + var impls = this._implementations[iface.name]; + + if (impls) { + impls.push(type); + } else { + this._implementations[iface.name] = [type]; + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else if (isAbstractType(type) && !this._implementations[type.name]) { + this._implementations[type.name] = []; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + var _proto = GraphQLSchema.prototype; + + _proto.getQueryType = function getQueryType() { + return this._queryType; + }; + + _proto.getMutationType = function getMutationType() { + return this._mutationType; + }; + + _proto.getSubscriptionType = function getSubscriptionType() { + return this._subscriptionType; + }; + + _proto.getTypeMap = function getTypeMap() { + return this._typeMap; + }; + + _proto.getType = function getType(name) { + return this.getTypeMap()[name]; + }; + + _proto.getPossibleTypes = function getPossibleTypes(abstractType) { + if (isUnionType(abstractType)) { + return abstractType.getTypes(); + } + + return this._implementations[abstractType.name]; + }; + + _proto.isPossibleType = function isPossibleType(abstractType, possibleType) { + var possibleTypeMap = this._possibleTypeMap; + + if (!possibleTypeMap[abstractType.name]) { + var possibleTypes = this.getPossibleTypes(abstractType); + possibleTypeMap[abstractType.name] = possibleTypes.reduce(function (map, type) { + map[type.name] = true; + return map; + }, Object.create(null)); + } + + return Boolean(possibleTypeMap[abstractType.name][possibleType.name]); + }; + + _proto.getDirectives = function getDirectives() { + return this._directives; + }; + + _proto.getDirective = function getDirective(name) { + return find(this.getDirectives(), function (directive) { + return directive.name === name; + }); + }; + + _proto.toConfig = function toConfig() { + return { + types: objectValues(this.getTypeMap()), + directives: this.getDirectives().slice(), + query: this.getQueryType(), + mutation: this.getMutationType(), + subscription: this.getSubscriptionType(), + astNode: this.astNode, + extensionASTNodes: this.extensionASTNodes || [], + assumeValid: this.__validationErrors !== undefined, + allowedLegacyNames: this.__allowedLegacyNames + }; + }; + + return GraphQLSchema; +}(); // Conditionally apply `[Symbol.toStringTag]` if `Symbol`s are supported + +defineToStringTag(GraphQLSchema); + +function typeMapReducer(map, type) { + if (!type) { + return map; + } + + if (isWrappingType(type)) { + return typeMapReducer(map, type.ofType); + } + + if (map[type.name]) { + !(map[type.name] === type) ? invariant(0, 'Schema must contain uniquely named types but contains multiple ' + "types named \"".concat(type.name, "\".")) : void 0; + return map; + } + + map[type.name] = type; + var reducedMap = map; + + if (isUnionType(type)) { + reducedMap = type.getTypes().reduce(typeMapReducer, reducedMap); + } + + if (isObjectType(type)) { + reducedMap = type.getInterfaces().reduce(typeMapReducer, reducedMap); + } + + if (isObjectType(type) || isInterfaceType(type)) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = objectValues(type.getFields())[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var field = _step3.value; + + if (field.args) { + var fieldArgTypes = field.args.map(function (arg) { + return arg.type; + }); + reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap); + } + + reducedMap = typeMapReducer(reducedMap, field.type); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + if (isInputObjectType(type)) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = objectValues(type.getFields())[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _field = _step4.value; + reducedMap = typeMapReducer(reducedMap, _field.type); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } + + return reducedMap; +} + +function typeMapDirectiveReducer(map, directive) { + // Directives are not validated until validateSchema() is called. + if (!isDirective(directive)) { + return map; + } + + return directive.args.reduce(function (_map, arg) { + return typeMapReducer(_map, arg.type); + }, map); +} diff --git a/node_modules/graphql/type/validate.js b/node_modules/graphql/type/validate.js new file mode 100644 index 000000000..386868f18 --- /dev/null +++ b/node_modules/graphql/type/validate.js @@ -0,0 +1,782 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validateSchema = validateSchema; +exports.assertValidSchema = assertValidSchema; + +var _find = _interopRequireDefault(require("../polyfills/find")); + +var _flatMap = _interopRequireDefault(require("../polyfills/flatMap")); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _objectEntries = _interopRequireDefault(require("../polyfills/objectEntries")); + +var _definition = require("./definition"); + +var _directives = require("./directives"); + +var _introspection = require("./introspection"); + +var _schema = require("./schema"); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _GraphQLError = require("../error/GraphQLError"); + +var _assertValidName = require("../utilities/assertValidName"); + +var _typeComparators = require("../utilities/typeComparators"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +function validateSchema(schema) { + // First check to ensure the provided value is in fact a GraphQLSchema. + (0, _schema.assertSchema)(schema); // If this Schema has already been validated, return the previous results. + + if (schema.__validationErrors) { + return schema.__validationErrors; + } // Validate the schema, producing a list of errors. + + + var context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. + + var errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ + + +function assertValidSchema(schema) { + var errors = validateSchema(schema); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} + +var SchemaValidationContext = +/*#__PURE__*/ +function () { + function SchemaValidationContext(schema) { + this._errors = []; + this.schema = schema; + } + + var _proto = SchemaValidationContext.prototype; + + _proto.reportError = function reportError(message, nodes) { + var _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; + + this.addError(new _GraphQLError.GraphQLError(message, _nodes)); + }; + + _proto.addError = function addError(error) { + this._errors.push(error); + }; + + _proto.getErrors = function getErrors() { + return this._errors; + }; + + return SchemaValidationContext; +}(); + +function validateRootTypes(context) { + var schema = context.schema; + var queryType = schema.getQueryType(); + + if (!queryType) { + context.reportError('Query root type must be provided.', schema.astNode); + } else if (!(0, _definition.isObjectType)(queryType)) { + context.reportError("Query root type must be Object type, it cannot be ".concat((0, _inspect.default)(queryType), "."), getOperationTypeNode(schema, queryType, 'query')); + } + + var mutationType = schema.getMutationType(); + + if (mutationType && !(0, _definition.isObjectType)(mutationType)) { + context.reportError('Mutation root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(mutationType), "."), getOperationTypeNode(schema, mutationType, 'mutation')); + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType && !(0, _definition.isObjectType)(subscriptionType)) { + context.reportError('Subscription root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(subscriptionType), "."), getOperationTypeNode(schema, subscriptionType, 'subscription')); + } +} + +function getOperationTypeNode(schema, type, operation) { + var operationNodes = getAllSubNodes(schema, function (node) { + return node.operationTypes; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = operationNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var node = _step.value; + + if (node.operation === operation) { + return node.type; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return type.astNode; +} + +function validateDirectives(context) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = context.schema.getDirectives()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var directive = _step2.value; + + // Ensure all directives are in fact GraphQL directives. + if (!(0, _directives.isDirective)(directive)) { + context.reportError("Expected directive but got: ".concat((0, _inspect.default)(directive), "."), directive && directive.astNode); + continue; + } // Ensure they are named correctly. + + + validateName(context, directive); // TODO: Ensure proper locations. + // Ensure the arguments are valid. + + var argNames = Object.create(null); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + var _loop = function _loop() { + var arg = _step3.value; + var argName = arg.name; // Ensure they are named correctly. + + validateName(context, arg); // Ensure they are unique per directive. + + if (argNames[argName]) { + context.reportError("Argument @".concat(directive.name, "(").concat(argName, ":) can only be defined once."), directive.astNode && directive.args.filter(function (_ref) { + var name = _ref.name; + return name === argName; + }).map(function (_ref2) { + var astNode = _ref2.astNode; + return astNode; + })); + return "continue"; + } + + argNames[argName] = true; // Ensure the type is an input type. + + if (!(0, _definition.isInputType)(arg.type)) { + context.reportError("The type of @".concat(directive.name, "(").concat(argName, ":) must be Input Type ") + "but got: ".concat((0, _inspect.default)(arg.type), "."), arg.astNode); + } + }; + + for (var _iterator3 = directive.args[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _ret = _loop(); + + if (_ret === "continue") continue; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } +} + +function validateName(context, node) { + // If a schema explicitly allows some legacy name which is no longer valid, + // allow it to be assumed valid. + if (context.schema.__allowedLegacyNames.indexOf(node.name) !== -1) { + return; + } // Ensure names are valid, however introspection types opt out. + + + var error = (0, _assertValidName.isValidNameError)(node.name, node.astNode || undefined); + + if (error) { + context.addError(error); + } +} + +function validateTypes(context) { + var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); + var typeMap = context.schema.getTypeMap(); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = (0, _objectValues.default)(typeMap)[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var type = _step4.value; + + // Ensure all provided types are in fact GraphQL type. + if (!(0, _definition.isNamedType)(type)) { + context.reportError("Expected GraphQL named type but got: ".concat((0, _inspect.default)(type), "."), type && type.astNode); + continue; + } // Ensure it is named correctly (excluding introspection types). + + + if (!(0, _introspection.isIntrospectionType)(type)) { + validateName(context, type); + } + + if ((0, _definition.isObjectType)(type)) { + // Ensure fields are valid + validateFields(context, type); // Ensure objects implement the interfaces they claim to. + + validateObjectInterfaces(context, type); + } else if ((0, _definition.isInterfaceType)(type)) { + // Ensure fields are valid. + validateFields(context, type); + } else if ((0, _definition.isUnionType)(type)) { + // Ensure Unions include valid member types. + validateUnionMembers(context, type); + } else if ((0, _definition.isEnumType)(type)) { + // Ensure Enums have valid values. + validateEnumValues(context, type); + } else if ((0, _definition.isInputObjectType)(type)) { + // Ensure Input Object fields are valid. + validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references + + validateInputObjectCircularRefs(type); + } + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } +} + +function validateFields(context, type) { + var fields = (0, _objectValues.default)(type.getFields()); // Objects and Interfaces both must define one or more fields. + + if (fields.length === 0) { + context.reportError("Type ".concat(type.name, " must define one or more fields."), getAllNodes(type)); + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = fields[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var field = _step5.value; + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an output type + + if (!(0, _definition.isOutputType)(field.type)) { + context.reportError("The type of ".concat(type.name, ".").concat(field.name, " must be Output Type ") + "but got: ".concat((0, _inspect.default)(field.type), "."), field.astNode && field.astNode.type); + } // Ensure the arguments are valid + + + var argNames = Object.create(null); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + var _loop2 = function _loop2() { + var arg = _step6.value; + var argName = arg.name; // Ensure they are named correctly. + + validateName(context, arg); // Ensure they are unique per field. + + if (argNames[argName]) { + context.reportError("Field argument ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) can only be defined once."), field.args.filter(function (_ref3) { + var name = _ref3.name; + return name === argName; + }).map(function (_ref4) { + var astNode = _ref4.astNode; + return astNode; + })); + } + + argNames[argName] = true; // Ensure the type is an input type + + if (!(0, _definition.isInputType)(arg.type)) { + context.reportError("The type of ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) must be Input ") + "Type but got: ".concat((0, _inspect.default)(arg.type), "."), arg.astNode && arg.astNode.type); + } + }; + + for (var _iterator6 = field.args[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + _loop2(); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } +} + +function validateObjectInterfaces(context, object) { + var implementedTypeNames = Object.create(null); + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = object.getInterfaces()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var iface = _step7.value; + + if (!(0, _definition.isInterfaceType)(iface)) { + context.reportError("Type ".concat((0, _inspect.default)(object), " must only implement Interface types, ") + "it cannot implement ".concat((0, _inspect.default)(iface), "."), getAllImplementsInterfaceNodes(object, iface)); + continue; + } + + if (implementedTypeNames[iface.name]) { + context.reportError("Type ".concat(object.name, " can only implement ").concat(iface.name, " once."), getAllImplementsInterfaceNodes(object, iface)); + continue; + } + + implementedTypeNames[iface.name] = true; + validateObjectImplementsInterface(context, object, iface); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return != null) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } +} + +function validateObjectImplementsInterface(context, object, iface) { + var objectFieldMap = object.getFields(); + var ifaceFieldMap = iface.getFields(); // Assert each interface field is implemented. + + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + + try { + for (var _iterator8 = (0, _objectEntries.default)(ifaceFieldMap)[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { + var _ref6 = _step8.value; + var fieldName = _ref6[0]; + var ifaceField = _ref6[1]; + var objectField = objectFieldMap[fieldName]; // Assert interface field exists on object. + + if (!objectField) { + context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expected but ").concat(object.name, " does not provide it."), [ifaceField.astNode].concat(getAllNodes(object))); + continue; + } // Assert interface field type is satisfied by object field type, by being + // a valid subtype. (covariant) + + + if (!(0, _typeComparators.isTypeSubTypeOf)(context.schema, objectField.type, ifaceField.type)) { + context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expects type ") + "".concat((0, _inspect.default)(ifaceField.type), " but ").concat(object.name, ".").concat(fieldName, " ") + "is type ".concat((0, _inspect.default)(objectField.type), "."), [ifaceField.astNode && ifaceField.astNode.type, objectField.astNode && objectField.astNode.type]); + } // Assert each interface field arg is implemented. + + + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + + try { + var _loop3 = function _loop3() { + var ifaceArg = _step9.value; + var argName = ifaceArg.name; + var objectArg = (0, _find.default)(objectField.args, function (arg) { + return arg.name === argName; + }); // Assert interface field arg exists on object field. + + if (!objectArg) { + context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) expected but ").concat(object.name, ".").concat(fieldName, " does not provide it."), [ifaceArg.astNode, objectField.astNode]); + return "continue"; + } // Assert interface field arg type matches object field arg type. + // (invariant) + // TODO: change to contravariant? + + + if (!(0, _typeComparators.isEqualType)(ifaceArg.type, objectArg.type)) { + context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) ") + "expects type ".concat((0, _inspect.default)(ifaceArg.type), " but ") + "".concat(object.name, ".").concat(fieldName, "(").concat(argName, ":) is type ") + "".concat((0, _inspect.default)(objectArg.type), "."), [ifaceArg.astNode && ifaceArg.astNode.type, objectArg.astNode && objectArg.astNode.type]); + } // TODO: validate default values? + + }; + + for (var _iterator9 = ifaceField.args[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { + var _ret2 = _loop3(); + + if (_ret2 === "continue") continue; + } // Assert additional arguments must not be required. + + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + + try { + var _loop4 = function _loop4() { + var objectArg = _step10.value; + var argName = objectArg.name; + var ifaceArg = (0, _find.default)(ifaceField.args, function (arg) { + return arg.name === argName; + }); + + if (!ifaceArg && (0, _definition.isRequiredArgument)(objectArg)) { + context.reportError("Object field ".concat(object.name, ".").concat(fieldName, " includes required argument ").concat(argName, " that is missing from the Interface field ").concat(iface.name, ".").concat(fieldName, "."), [objectArg.astNode, ifaceField.astNode]); + } + }; + + for (var _iterator10 = objectField.args[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { + _loop4(); + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if (!_iteratorNormalCompletion10 && _iterator10.return != null) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if (!_iteratorNormalCompletion8 && _iterator8.return != null) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } +} + +function validateUnionMembers(context, union) { + var memberTypes = union.getTypes(); + + if (memberTypes.length === 0) { + context.reportError("Union type ".concat(union.name, " must define one or more member types."), getAllNodes(union)); + } + + var includedTypeNames = Object.create(null); + var _iteratorNormalCompletion11 = true; + var _didIteratorError11 = false; + var _iteratorError11 = undefined; + + try { + for (var _iterator11 = memberTypes[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { + var memberType = _step11.value; + + if (includedTypeNames[memberType.name]) { + context.reportError("Union type ".concat(union.name, " can only include type ").concat(memberType.name, " once."), getUnionMemberTypeNodes(union, memberType.name)); + continue; + } + + includedTypeNames[memberType.name] = true; + + if (!(0, _definition.isObjectType)(memberType)) { + context.reportError("Union type ".concat(union.name, " can only include Object types, ") + "it cannot include ".concat((0, _inspect.default)(memberType), "."), getUnionMemberTypeNodes(union, String(memberType))); + } + } + } catch (err) { + _didIteratorError11 = true; + _iteratorError11 = err; + } finally { + try { + if (!_iteratorNormalCompletion11 && _iterator11.return != null) { + _iterator11.return(); + } + } finally { + if (_didIteratorError11) { + throw _iteratorError11; + } + } + } +} + +function validateEnumValues(context, enumType) { + var enumValues = enumType.getValues(); + + if (enumValues.length === 0) { + context.reportError("Enum type ".concat(enumType.name, " must define one or more values."), getAllNodes(enumType)); + } + + var _iteratorNormalCompletion12 = true; + var _didIteratorError12 = false; + var _iteratorError12 = undefined; + + try { + for (var _iterator12 = enumValues[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { + var enumValue = _step12.value; + var valueName = enumValue.name; // Ensure valid name. + + validateName(context, enumValue); + + if (valueName === 'true' || valueName === 'false' || valueName === 'null') { + context.reportError("Enum type ".concat(enumType.name, " cannot include value: ").concat(valueName, "."), enumValue.astNode); + } + } + } catch (err) { + _didIteratorError12 = true; + _iteratorError12 = err; + } finally { + try { + if (!_iteratorNormalCompletion12 && _iterator12.return != null) { + _iterator12.return(); + } + } finally { + if (_didIteratorError12) { + throw _iteratorError12; + } + } + } +} + +function validateInputFields(context, inputObj) { + var fields = (0, _objectValues.default)(inputObj.getFields()); + + if (fields.length === 0) { + context.reportError("Input Object type ".concat(inputObj.name, " must define one or more fields."), getAllNodes(inputObj)); + } // Ensure the arguments are valid + + + var _iteratorNormalCompletion13 = true; + var _didIteratorError13 = false; + var _iteratorError13 = undefined; + + try { + for (var _iterator13 = fields[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { + var field = _step13.value; + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an input type + + if (!(0, _definition.isInputType)(field.type)) { + context.reportError("The type of ".concat(inputObj.name, ".").concat(field.name, " must be Input Type ") + "but got: ".concat((0, _inspect.default)(field.type), "."), field.astNode && field.astNode.type); + } + } + } catch (err) { + _didIteratorError13 = true; + _iteratorError13 = err; + } finally { + try { + if (!_iteratorNormalCompletion13 && _iterator13.return != null) { + _iterator13.return(); + } + } finally { + if (_didIteratorError13) { + throw _iteratorError13; + } + } + } +} + +function createInputObjectCircularRefsValidator(context) { + // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. + // Tracks already visited types to maintain O(N) and to ensure that cycles + // are not redundantly reported. + var visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors + + var fieldPath = []; // Position in the type path + + var fieldPathIndexByTypeName = Object.create(null); + return detectCycleRecursive; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(inputObj) { + if (visitedTypes[inputObj.name]) { + return; + } + + visitedTypes[inputObj.name] = true; + fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; + var fields = (0, _objectValues.default)(inputObj.getFields()); + var _iteratorNormalCompletion14 = true; + var _didIteratorError14 = false; + var _iteratorError14 = undefined; + + try { + for (var _iterator14 = fields[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) { + var field = _step14.value; + + if ((0, _definition.isNonNullType)(field.type) && (0, _definition.isInputObjectType)(field.type.ofType)) { + var fieldType = field.type.ofType; + var cycleIndex = fieldPathIndexByTypeName[fieldType.name]; + fieldPath.push(field); + + if (cycleIndex === undefined) { + detectCycleRecursive(fieldType); + } else { + var cyclePath = fieldPath.slice(cycleIndex); + var pathStr = cyclePath.map(function (fieldObj) { + return fieldObj.name; + }).join('.'); + context.reportError("Cannot reference Input Object \"".concat(fieldType.name, "\" within itself through a series of non-null fields: \"").concat(pathStr, "\"."), cyclePath.map(function (fieldObj) { + return fieldObj.astNode; + })); + } + + fieldPath.pop(); + } + } + } catch (err) { + _didIteratorError14 = true; + _iteratorError14 = err; + } finally { + try { + if (!_iteratorNormalCompletion14 && _iterator14.return != null) { + _iterator14.return(); + } + } finally { + if (_didIteratorError14) { + throw _iteratorError14; + } + } + } + + fieldPathIndexByTypeName[inputObj.name] = undefined; + } +} + +function getAllNodes(object) { + var astNode = object.astNode, + extensionASTNodes = object.extensionASTNodes; + return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes || []; +} + +function getAllSubNodes(object, getter) { + return (0, _flatMap.default)(getAllNodes(object), function (item) { + return getter(item) || []; + }); +} + +function getAllImplementsInterfaceNodes(type, iface) { + return getAllSubNodes(type, function (typeNode) { + return typeNode.interfaces; + }).filter(function (ifaceNode) { + return ifaceNode.name.value === iface.name; + }); +} + +function getUnionMemberTypeNodes(union, typeName) { + return getAllSubNodes(union, function (unionNode) { + return unionNode.types; + }).filter(function (typeNode) { + return typeNode.name.value === typeName; + }); +} diff --git a/node_modules/graphql/type/validate.js.flow b/node_modules/graphql/type/validate.js.flow new file mode 100644 index 000000000..3224a95e7 --- /dev/null +++ b/node_modules/graphql/type/validate.js.flow @@ -0,0 +1,607 @@ +// @flow strict + +import find from '../polyfills/find'; +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import objectEntries from '../polyfills/objectEntries'; +import { + type GraphQLObjectType, + type GraphQLInterfaceType, + type GraphQLUnionType, + type GraphQLEnumType, + type GraphQLInputObjectType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isNamedType, + isNonNullType, + isInputType, + isOutputType, + isRequiredArgument, +} from './definition'; +import { isDirective } from './directives'; +import { isIntrospectionType } from './introspection'; +import { type GraphQLSchema, assertSchema } from './schema'; +import inspect from '../jsutils/inspect'; +import { GraphQLError } from '../error/GraphQLError'; +import { type ASTNode, type NamedTypeNode } from '../language/ast'; +import { isValidNameError } from '../utilities/assertValidName'; +import { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators'; + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +export function validateSchema( + schema: GraphQLSchema, +): $ReadOnlyArray { + // First check to ensure the provided value is in fact a GraphQLSchema. + assertSchema(schema); + + // If this Schema has already been validated, return the previous results. + if (schema.__validationErrors) { + return schema.__validationErrors; + } + + // Validate the schema, producing a list of errors. + const context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); + + // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. + const errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} + +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ +export function assertValidSchema(schema: GraphQLSchema): void { + const errors = validateSchema(schema); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); + } +} + +class SchemaValidationContext { + +_errors: Array; + +schema: GraphQLSchema; + + constructor(schema) { + this._errors = []; + this.schema = schema; + } + + reportError( + message: string, + nodes?: $ReadOnlyArray | ?ASTNode, + ): void { + const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; + this.addError(new GraphQLError(message, _nodes)); + } + + addError(error: GraphQLError): void { + this._errors.push(error); + } + + getErrors(): $ReadOnlyArray { + return this._errors; + } +} + +function validateRootTypes(context) { + const schema = context.schema; + const queryType = schema.getQueryType(); + if (!queryType) { + context.reportError('Query root type must be provided.', schema.astNode); + } else if (!isObjectType(queryType)) { + context.reportError( + `Query root type must be Object type, it cannot be ${inspect( + queryType, + )}.`, + getOperationTypeNode(schema, queryType, 'query'), + ); + } + + const mutationType = schema.getMutationType(); + if (mutationType && !isObjectType(mutationType)) { + context.reportError( + 'Mutation root type must be Object type if provided, it cannot be ' + + `${inspect(mutationType)}.`, + getOperationTypeNode(schema, mutationType, 'mutation'), + ); + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && !isObjectType(subscriptionType)) { + context.reportError( + 'Subscription root type must be Object type if provided, it cannot be ' + + `${inspect(subscriptionType)}.`, + getOperationTypeNode(schema, subscriptionType, 'subscription'), + ); + } +} + +function getOperationTypeNode( + schema: GraphQLSchema, + type: GraphQLObjectType, + operation: string, +): ?ASTNode { + const operationNodes = getAllSubNodes(schema, node => node.operationTypes); + for (const node of operationNodes) { + if (node.operation === operation) { + return node.type; + } + } + + return type.astNode; +} + +function validateDirectives(context: SchemaValidationContext): void { + for (const directive of context.schema.getDirectives()) { + // Ensure all directives are in fact GraphQL directives. + if (!isDirective(directive)) { + context.reportError( + `Expected directive but got: ${inspect(directive)}.`, + directive && directive.astNode, + ); + continue; + } + + // Ensure they are named correctly. + validateName(context, directive); + + // TODO: Ensure proper locations. + + // Ensure the arguments are valid. + const argNames = Object.create(null); + for (const arg of directive.args) { + const argName = arg.name; + + // Ensure they are named correctly. + validateName(context, arg); + + // Ensure they are unique per directive. + if (argNames[argName]) { + context.reportError( + `Argument @${directive.name}(${argName}:) can only be defined once.`, + directive.astNode && + directive.args + .filter(({ name }) => name === argName) + .map(({ astNode }) => astNode), + ); + continue; + } + argNames[argName] = true; + + // Ensure the type is an input type. + if (!isInputType(arg.type)) { + context.reportError( + `The type of @${directive.name}(${argName}:) must be Input Type ` + + `but got: ${inspect(arg.type)}.`, + arg.astNode, + ); + } + } + } +} + +function validateName( + context: SchemaValidationContext, + node: { +name: string, +astNode: ?ASTNode, ... }, +): void { + // If a schema explicitly allows some legacy name which is no longer valid, + // allow it to be assumed valid. + if (context.schema.__allowedLegacyNames.indexOf(node.name) !== -1) { + return; + } + // Ensure names are valid, however introspection types opt out. + const error = isValidNameError(node.name, node.astNode || undefined); + if (error) { + context.addError(error); + } +} + +function validateTypes(context: SchemaValidationContext): void { + const validateInputObjectCircularRefs = createInputObjectCircularRefsValidator( + context, + ); + const typeMap = context.schema.getTypeMap(); + for (const type of objectValues(typeMap)) { + // Ensure all provided types are in fact GraphQL type. + if (!isNamedType(type)) { + context.reportError( + `Expected GraphQL named type but got: ${inspect(type)}.`, + type && type.astNode, + ); + continue; + } + + // Ensure it is named correctly (excluding introspection types). + if (!isIntrospectionType(type)) { + validateName(context, type); + } + + if (isObjectType(type)) { + // Ensure fields are valid + validateFields(context, type); + + // Ensure objects implement the interfaces they claim to. + validateObjectInterfaces(context, type); + } else if (isInterfaceType(type)) { + // Ensure fields are valid. + validateFields(context, type); + } else if (isUnionType(type)) { + // Ensure Unions include valid member types. + validateUnionMembers(context, type); + } else if (isEnumType(type)) { + // Ensure Enums have valid values. + validateEnumValues(context, type); + } else if (isInputObjectType(type)) { + // Ensure Input Object fields are valid. + validateInputFields(context, type); + + // Ensure Input Objects do not contain non-nullable circular references + validateInputObjectCircularRefs(type); + } + } +} + +function validateFields( + context: SchemaValidationContext, + type: GraphQLObjectType | GraphQLInterfaceType, +): void { + const fields = objectValues(type.getFields()); + + // Objects and Interfaces both must define one or more fields. + if (fields.length === 0) { + context.reportError( + `Type ${type.name} must define one or more fields.`, + getAllNodes(type), + ); + } + + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); + + // Ensure the type is an output type + if (!isOutputType(field.type)) { + context.reportError( + `The type of ${type.name}.${field.name} must be Output Type ` + + `but got: ${inspect(field.type)}.`, + field.astNode && field.astNode.type, + ); + } + + // Ensure the arguments are valid + const argNames = Object.create(null); + for (const arg of field.args) { + const argName = arg.name; + + // Ensure they are named correctly. + validateName(context, arg); + + // Ensure they are unique per field. + if (argNames[argName]) { + context.reportError( + `Field argument ${type.name}.${field.name}(${argName}:) can only be defined once.`, + field.args + .filter(({ name }) => name === argName) + .map(({ astNode }) => astNode), + ); + } + argNames[argName] = true; + + // Ensure the type is an input type + if (!isInputType(arg.type)) { + context.reportError( + `The type of ${type.name}.${field.name}(${argName}:) must be Input ` + + `Type but got: ${inspect(arg.type)}.`, + arg.astNode && arg.astNode.type, + ); + } + } + } +} + +function validateObjectInterfaces( + context: SchemaValidationContext, + object: GraphQLObjectType, +): void { + const implementedTypeNames = Object.create(null); + for (const iface of object.getInterfaces()) { + if (!isInterfaceType(iface)) { + context.reportError( + `Type ${inspect(object)} must only implement Interface types, ` + + `it cannot implement ${inspect(iface)}.`, + getAllImplementsInterfaceNodes(object, iface), + ); + continue; + } + + if (implementedTypeNames[iface.name]) { + context.reportError( + `Type ${object.name} can only implement ${iface.name} once.`, + getAllImplementsInterfaceNodes(object, iface), + ); + continue; + } + implementedTypeNames[iface.name] = true; + validateObjectImplementsInterface(context, object, iface); + } +} + +function validateObjectImplementsInterface( + context: SchemaValidationContext, + object: GraphQLObjectType, + iface: GraphQLInterfaceType, +): void { + const objectFieldMap = object.getFields(); + const ifaceFieldMap = iface.getFields(); + + // Assert each interface field is implemented. + for (const [fieldName, ifaceField] of objectEntries(ifaceFieldMap)) { + const objectField = objectFieldMap[fieldName]; + + // Assert interface field exists on object. + if (!objectField) { + context.reportError( + `Interface field ${iface.name}.${fieldName} expected but ${object.name} does not provide it.`, + [ifaceField.astNode, ...getAllNodes(object)], + ); + continue; + } + + // Assert interface field type is satisfied by object field type, by being + // a valid subtype. (covariant) + if (!isTypeSubTypeOf(context.schema, objectField.type, ifaceField.type)) { + context.reportError( + `Interface field ${iface.name}.${fieldName} expects type ` + + `${inspect(ifaceField.type)} but ${object.name}.${fieldName} ` + + `is type ${inspect(objectField.type)}.`, + [ + ifaceField.astNode && ifaceField.astNode.type, + objectField.astNode && objectField.astNode.type, + ], + ); + } + + // Assert each interface field arg is implemented. + for (const ifaceArg of ifaceField.args) { + const argName = ifaceArg.name; + const objectArg = find(objectField.args, arg => arg.name === argName); + + // Assert interface field arg exists on object field. + if (!objectArg) { + context.reportError( + `Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${object.name}.${fieldName} does not provide it.`, + [ifaceArg.astNode, objectField.astNode], + ); + continue; + } + + // Assert interface field arg type matches object field arg type. + // (invariant) + // TODO: change to contravariant? + if (!isEqualType(ifaceArg.type, objectArg.type)) { + context.reportError( + `Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + + `expects type ${inspect(ifaceArg.type)} but ` + + `${object.name}.${fieldName}(${argName}:) is type ` + + `${inspect(objectArg.type)}.`, + [ + ifaceArg.astNode && ifaceArg.astNode.type, + objectArg.astNode && objectArg.astNode.type, + ], + ); + } + + // TODO: validate default values? + } + + // Assert additional arguments must not be required. + for (const objectArg of objectField.args) { + const argName = objectArg.name; + const ifaceArg = find(ifaceField.args, arg => arg.name === argName); + if (!ifaceArg && isRequiredArgument(objectArg)) { + context.reportError( + `Object field ${object.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, + [objectArg.astNode, ifaceField.astNode], + ); + } + } + } +} + +function validateUnionMembers( + context: SchemaValidationContext, + union: GraphQLUnionType, +): void { + const memberTypes = union.getTypes(); + + if (memberTypes.length === 0) { + context.reportError( + `Union type ${union.name} must define one or more member types.`, + getAllNodes(union), + ); + } + + const includedTypeNames = Object.create(null); + for (const memberType of memberTypes) { + if (includedTypeNames[memberType.name]) { + context.reportError( + `Union type ${union.name} can only include type ${memberType.name} once.`, + getUnionMemberTypeNodes(union, memberType.name), + ); + continue; + } + includedTypeNames[memberType.name] = true; + if (!isObjectType(memberType)) { + context.reportError( + `Union type ${union.name} can only include Object types, ` + + `it cannot include ${inspect(memberType)}.`, + getUnionMemberTypeNodes(union, String(memberType)), + ); + } + } +} + +function validateEnumValues( + context: SchemaValidationContext, + enumType: GraphQLEnumType, +): void { + const enumValues = enumType.getValues(); + + if (enumValues.length === 0) { + context.reportError( + `Enum type ${enumType.name} must define one or more values.`, + getAllNodes(enumType), + ); + } + + for (const enumValue of enumValues) { + const valueName = enumValue.name; + + // Ensure valid name. + validateName(context, enumValue); + if (valueName === 'true' || valueName === 'false' || valueName === 'null') { + context.reportError( + `Enum type ${enumType.name} cannot include value: ${valueName}.`, + enumValue.astNode, + ); + } + } +} + +function validateInputFields( + context: SchemaValidationContext, + inputObj: GraphQLInputObjectType, +): void { + const fields = objectValues(inputObj.getFields()); + + if (fields.length === 0) { + context.reportError( + `Input Object type ${inputObj.name} must define one or more fields.`, + getAllNodes(inputObj), + ); + } + + // Ensure the arguments are valid + for (const field of fields) { + // Ensure they are named correctly. + validateName(context, field); + + // Ensure the type is an input type + if (!isInputType(field.type)) { + context.reportError( + `The type of ${inputObj.name}.${field.name} must be Input Type ` + + `but got: ${inspect(field.type)}.`, + field.astNode && field.astNode.type, + ); + } + } +} + +function createInputObjectCircularRefsValidator( + context: SchemaValidationContext, +) { + // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. + // Tracks already visited types to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedTypes = Object.create(null); + + // Array of types nodes used to produce meaningful errors + const fieldPath = []; + + // Position in the type path + const fieldPathIndexByTypeName = Object.create(null); + + return detectCycleRecursive; + + // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + function detectCycleRecursive(inputObj: GraphQLInputObjectType) { + if (visitedTypes[inputObj.name]) { + return; + } + + visitedTypes[inputObj.name] = true; + fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; + + const fields = objectValues(inputObj.getFields()); + for (const field of fields) { + if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) { + const fieldType = field.type.ofType; + const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; + + fieldPath.push(field); + if (cycleIndex === undefined) { + detectCycleRecursive(fieldType); + } else { + const cyclePath = fieldPath.slice(cycleIndex); + const pathStr = cyclePath.map(fieldObj => fieldObj.name).join('.'); + context.reportError( + `Cannot reference Input Object "${fieldType.name}" within itself through a series of non-null fields: "${pathStr}".`, + cyclePath.map(fieldObj => fieldObj.astNode), + ); + } + fieldPath.pop(); + } + } + + fieldPathIndexByTypeName[inputObj.name] = undefined; + } +} + +type SDLDefinedObject = { + +astNode: ?T, + +extensionASTNodes?: ?$ReadOnlyArray, + ... +}; + +function getAllNodes( + object: SDLDefinedObject, +): $ReadOnlyArray { + const { astNode, extensionASTNodes } = object; + return astNode + ? extensionASTNodes + ? [astNode].concat(extensionASTNodes) + : [astNode] + : extensionASTNodes || []; +} + +function getAllSubNodes( + object: SDLDefinedObject, + getter: (T | K) => ?(L | $ReadOnlyArray), +): $ReadOnlyArray { + return flatMap(getAllNodes(object), item => getter(item) || []); +} + +function getAllImplementsInterfaceNodes( + type: GraphQLObjectType, + iface: GraphQLInterfaceType, +): $ReadOnlyArray { + return getAllSubNodes(type, typeNode => typeNode.interfaces).filter( + ifaceNode => ifaceNode.name.value === iface.name, + ); +} + +function getUnionMemberTypeNodes( + union: GraphQLUnionType, + typeName: string, +): ?$ReadOnlyArray { + return getAllSubNodes(union, unionNode => unionNode.types).filter( + typeNode => typeNode.name.value === typeName, + ); +} diff --git a/node_modules/graphql/type/validate.mjs b/node_modules/graphql/type/validate.mjs new file mode 100644 index 000000000..f5ded354c --- /dev/null +++ b/node_modules/graphql/type/validate.mjs @@ -0,0 +1,760 @@ +import find from '../polyfills/find'; +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import objectEntries from '../polyfills/objectEntries'; +import { isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNamedType, isNonNullType, isInputType, isOutputType, isRequiredArgument } from './definition'; +import { isDirective } from './directives'; +import { isIntrospectionType } from './introspection'; +import { assertSchema } from './schema'; +import inspect from '../jsutils/inspect'; +import { GraphQLError } from '../error/GraphQLError'; +import { isValidNameError } from '../utilities/assertValidName'; +import { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators'; +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ + +export function validateSchema(schema) { + // First check to ensure the provided value is in fact a GraphQLSchema. + assertSchema(schema); // If this Schema has already been validated, return the previous results. + + if (schema.__validationErrors) { + return schema.__validationErrors; + } // Validate the schema, producing a list of errors. + + + var context = new SchemaValidationContext(schema); + validateRootTypes(context); + validateDirectives(context); + validateTypes(context); // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. + + var errors = context.getErrors(); + schema.__validationErrors = errors; + return errors; +} +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ + +export function assertValidSchema(schema) { + var errors = validateSchema(schema); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} + +var SchemaValidationContext = +/*#__PURE__*/ +function () { + function SchemaValidationContext(schema) { + this._errors = []; + this.schema = schema; + } + + var _proto = SchemaValidationContext.prototype; + + _proto.reportError = function reportError(message, nodes) { + var _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; + + this.addError(new GraphQLError(message, _nodes)); + }; + + _proto.addError = function addError(error) { + this._errors.push(error); + }; + + _proto.getErrors = function getErrors() { + return this._errors; + }; + + return SchemaValidationContext; +}(); + +function validateRootTypes(context) { + var schema = context.schema; + var queryType = schema.getQueryType(); + + if (!queryType) { + context.reportError('Query root type must be provided.', schema.astNode); + } else if (!isObjectType(queryType)) { + context.reportError("Query root type must be Object type, it cannot be ".concat(inspect(queryType), "."), getOperationTypeNode(schema, queryType, 'query')); + } + + var mutationType = schema.getMutationType(); + + if (mutationType && !isObjectType(mutationType)) { + context.reportError('Mutation root type must be Object type if provided, it cannot be ' + "".concat(inspect(mutationType), "."), getOperationTypeNode(schema, mutationType, 'mutation')); + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType && !isObjectType(subscriptionType)) { + context.reportError('Subscription root type must be Object type if provided, it cannot be ' + "".concat(inspect(subscriptionType), "."), getOperationTypeNode(schema, subscriptionType, 'subscription')); + } +} + +function getOperationTypeNode(schema, type, operation) { + var operationNodes = getAllSubNodes(schema, function (node) { + return node.operationTypes; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = operationNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var node = _step.value; + + if (node.operation === operation) { + return node.type; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return type.astNode; +} + +function validateDirectives(context) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = context.schema.getDirectives()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var directive = _step2.value; + + // Ensure all directives are in fact GraphQL directives. + if (!isDirective(directive)) { + context.reportError("Expected directive but got: ".concat(inspect(directive), "."), directive && directive.astNode); + continue; + } // Ensure they are named correctly. + + + validateName(context, directive); // TODO: Ensure proper locations. + // Ensure the arguments are valid. + + var argNames = Object.create(null); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + var _loop = function _loop() { + var arg = _step3.value; + var argName = arg.name; // Ensure they are named correctly. + + validateName(context, arg); // Ensure they are unique per directive. + + if (argNames[argName]) { + context.reportError("Argument @".concat(directive.name, "(").concat(argName, ":) can only be defined once."), directive.astNode && directive.args.filter(function (_ref) { + var name = _ref.name; + return name === argName; + }).map(function (_ref2) { + var astNode = _ref2.astNode; + return astNode; + })); + return "continue"; + } + + argNames[argName] = true; // Ensure the type is an input type. + + if (!isInputType(arg.type)) { + context.reportError("The type of @".concat(directive.name, "(").concat(argName, ":) must be Input Type ") + "but got: ".concat(inspect(arg.type), "."), arg.astNode); + } + }; + + for (var _iterator3 = directive.args[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _ret = _loop(); + + if (_ret === "continue") continue; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } +} + +function validateName(context, node) { + // If a schema explicitly allows some legacy name which is no longer valid, + // allow it to be assumed valid. + if (context.schema.__allowedLegacyNames.indexOf(node.name) !== -1) { + return; + } // Ensure names are valid, however introspection types opt out. + + + var error = isValidNameError(node.name, node.astNode || undefined); + + if (error) { + context.addError(error); + } +} + +function validateTypes(context) { + var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); + var typeMap = context.schema.getTypeMap(); + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = objectValues(typeMap)[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var type = _step4.value; + + // Ensure all provided types are in fact GraphQL type. + if (!isNamedType(type)) { + context.reportError("Expected GraphQL named type but got: ".concat(inspect(type), "."), type && type.astNode); + continue; + } // Ensure it is named correctly (excluding introspection types). + + + if (!isIntrospectionType(type)) { + validateName(context, type); + } + + if (isObjectType(type)) { + // Ensure fields are valid + validateFields(context, type); // Ensure objects implement the interfaces they claim to. + + validateObjectInterfaces(context, type); + } else if (isInterfaceType(type)) { + // Ensure fields are valid. + validateFields(context, type); + } else if (isUnionType(type)) { + // Ensure Unions include valid member types. + validateUnionMembers(context, type); + } else if (isEnumType(type)) { + // Ensure Enums have valid values. + validateEnumValues(context, type); + } else if (isInputObjectType(type)) { + // Ensure Input Object fields are valid. + validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references + + validateInputObjectCircularRefs(type); + } + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } +} + +function validateFields(context, type) { + var fields = objectValues(type.getFields()); // Objects and Interfaces both must define one or more fields. + + if (fields.length === 0) { + context.reportError("Type ".concat(type.name, " must define one or more fields."), getAllNodes(type)); + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = fields[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var field = _step5.value; + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an output type + + if (!isOutputType(field.type)) { + context.reportError("The type of ".concat(type.name, ".").concat(field.name, " must be Output Type ") + "but got: ".concat(inspect(field.type), "."), field.astNode && field.astNode.type); + } // Ensure the arguments are valid + + + var argNames = Object.create(null); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + var _loop2 = function _loop2() { + var arg = _step6.value; + var argName = arg.name; // Ensure they are named correctly. + + validateName(context, arg); // Ensure they are unique per field. + + if (argNames[argName]) { + context.reportError("Field argument ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) can only be defined once."), field.args.filter(function (_ref3) { + var name = _ref3.name; + return name === argName; + }).map(function (_ref4) { + var astNode = _ref4.astNode; + return astNode; + })); + } + + argNames[argName] = true; // Ensure the type is an input type + + if (!isInputType(arg.type)) { + context.reportError("The type of ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) must be Input ") + "Type but got: ".concat(inspect(arg.type), "."), arg.astNode && arg.astNode.type); + } + }; + + for (var _iterator6 = field.args[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + _loop2(); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } +} + +function validateObjectInterfaces(context, object) { + var implementedTypeNames = Object.create(null); + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = object.getInterfaces()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var iface = _step7.value; + + if (!isInterfaceType(iface)) { + context.reportError("Type ".concat(inspect(object), " must only implement Interface types, ") + "it cannot implement ".concat(inspect(iface), "."), getAllImplementsInterfaceNodes(object, iface)); + continue; + } + + if (implementedTypeNames[iface.name]) { + context.reportError("Type ".concat(object.name, " can only implement ").concat(iface.name, " once."), getAllImplementsInterfaceNodes(object, iface)); + continue; + } + + implementedTypeNames[iface.name] = true; + validateObjectImplementsInterface(context, object, iface); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return != null) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } +} + +function validateObjectImplementsInterface(context, object, iface) { + var objectFieldMap = object.getFields(); + var ifaceFieldMap = iface.getFields(); // Assert each interface field is implemented. + + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + + try { + for (var _iterator8 = objectEntries(ifaceFieldMap)[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { + var _ref6 = _step8.value; + var fieldName = _ref6[0]; + var ifaceField = _ref6[1]; + var objectField = objectFieldMap[fieldName]; // Assert interface field exists on object. + + if (!objectField) { + context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expected but ").concat(object.name, " does not provide it."), [ifaceField.astNode].concat(getAllNodes(object))); + continue; + } // Assert interface field type is satisfied by object field type, by being + // a valid subtype. (covariant) + + + if (!isTypeSubTypeOf(context.schema, objectField.type, ifaceField.type)) { + context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expects type ") + "".concat(inspect(ifaceField.type), " but ").concat(object.name, ".").concat(fieldName, " ") + "is type ".concat(inspect(objectField.type), "."), [ifaceField.astNode && ifaceField.astNode.type, objectField.astNode && objectField.astNode.type]); + } // Assert each interface field arg is implemented. + + + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + + try { + var _loop3 = function _loop3() { + var ifaceArg = _step9.value; + var argName = ifaceArg.name; + var objectArg = find(objectField.args, function (arg) { + return arg.name === argName; + }); // Assert interface field arg exists on object field. + + if (!objectArg) { + context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) expected but ").concat(object.name, ".").concat(fieldName, " does not provide it."), [ifaceArg.astNode, objectField.astNode]); + return "continue"; + } // Assert interface field arg type matches object field arg type. + // (invariant) + // TODO: change to contravariant? + + + if (!isEqualType(ifaceArg.type, objectArg.type)) { + context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) ") + "expects type ".concat(inspect(ifaceArg.type), " but ") + "".concat(object.name, ".").concat(fieldName, "(").concat(argName, ":) is type ") + "".concat(inspect(objectArg.type), "."), [ifaceArg.astNode && ifaceArg.astNode.type, objectArg.astNode && objectArg.astNode.type]); + } // TODO: validate default values? + + }; + + for (var _iterator9 = ifaceField.args[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { + var _ret2 = _loop3(); + + if (_ret2 === "continue") continue; + } // Assert additional arguments must not be required. + + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + + try { + var _loop4 = function _loop4() { + var objectArg = _step10.value; + var argName = objectArg.name; + var ifaceArg = find(ifaceField.args, function (arg) { + return arg.name === argName; + }); + + if (!ifaceArg && isRequiredArgument(objectArg)) { + context.reportError("Object field ".concat(object.name, ".").concat(fieldName, " includes required argument ").concat(argName, " that is missing from the Interface field ").concat(iface.name, ".").concat(fieldName, "."), [objectArg.astNode, ifaceField.astNode]); + } + }; + + for (var _iterator10 = objectField.args[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { + _loop4(); + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if (!_iteratorNormalCompletion10 && _iterator10.return != null) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if (!_iteratorNormalCompletion8 && _iterator8.return != null) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } +} + +function validateUnionMembers(context, union) { + var memberTypes = union.getTypes(); + + if (memberTypes.length === 0) { + context.reportError("Union type ".concat(union.name, " must define one or more member types."), getAllNodes(union)); + } + + var includedTypeNames = Object.create(null); + var _iteratorNormalCompletion11 = true; + var _didIteratorError11 = false; + var _iteratorError11 = undefined; + + try { + for (var _iterator11 = memberTypes[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { + var memberType = _step11.value; + + if (includedTypeNames[memberType.name]) { + context.reportError("Union type ".concat(union.name, " can only include type ").concat(memberType.name, " once."), getUnionMemberTypeNodes(union, memberType.name)); + continue; + } + + includedTypeNames[memberType.name] = true; + + if (!isObjectType(memberType)) { + context.reportError("Union type ".concat(union.name, " can only include Object types, ") + "it cannot include ".concat(inspect(memberType), "."), getUnionMemberTypeNodes(union, String(memberType))); + } + } + } catch (err) { + _didIteratorError11 = true; + _iteratorError11 = err; + } finally { + try { + if (!_iteratorNormalCompletion11 && _iterator11.return != null) { + _iterator11.return(); + } + } finally { + if (_didIteratorError11) { + throw _iteratorError11; + } + } + } +} + +function validateEnumValues(context, enumType) { + var enumValues = enumType.getValues(); + + if (enumValues.length === 0) { + context.reportError("Enum type ".concat(enumType.name, " must define one or more values."), getAllNodes(enumType)); + } + + var _iteratorNormalCompletion12 = true; + var _didIteratorError12 = false; + var _iteratorError12 = undefined; + + try { + for (var _iterator12 = enumValues[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { + var enumValue = _step12.value; + var valueName = enumValue.name; // Ensure valid name. + + validateName(context, enumValue); + + if (valueName === 'true' || valueName === 'false' || valueName === 'null') { + context.reportError("Enum type ".concat(enumType.name, " cannot include value: ").concat(valueName, "."), enumValue.astNode); + } + } + } catch (err) { + _didIteratorError12 = true; + _iteratorError12 = err; + } finally { + try { + if (!_iteratorNormalCompletion12 && _iterator12.return != null) { + _iterator12.return(); + } + } finally { + if (_didIteratorError12) { + throw _iteratorError12; + } + } + } +} + +function validateInputFields(context, inputObj) { + var fields = objectValues(inputObj.getFields()); + + if (fields.length === 0) { + context.reportError("Input Object type ".concat(inputObj.name, " must define one or more fields."), getAllNodes(inputObj)); + } // Ensure the arguments are valid + + + var _iteratorNormalCompletion13 = true; + var _didIteratorError13 = false; + var _iteratorError13 = undefined; + + try { + for (var _iterator13 = fields[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { + var field = _step13.value; + // Ensure they are named correctly. + validateName(context, field); // Ensure the type is an input type + + if (!isInputType(field.type)) { + context.reportError("The type of ".concat(inputObj.name, ".").concat(field.name, " must be Input Type ") + "but got: ".concat(inspect(field.type), "."), field.astNode && field.astNode.type); + } + } + } catch (err) { + _didIteratorError13 = true; + _iteratorError13 = err; + } finally { + try { + if (!_iteratorNormalCompletion13 && _iterator13.return != null) { + _iterator13.return(); + } + } finally { + if (_didIteratorError13) { + throw _iteratorError13; + } + } + } +} + +function createInputObjectCircularRefsValidator(context) { + // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'. + // Tracks already visited types to maintain O(N) and to ensure that cycles + // are not redundantly reported. + var visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors + + var fieldPath = []; // Position in the type path + + var fieldPathIndexByTypeName = Object.create(null); + return detectCycleRecursive; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(inputObj) { + if (visitedTypes[inputObj.name]) { + return; + } + + visitedTypes[inputObj.name] = true; + fieldPathIndexByTypeName[inputObj.name] = fieldPath.length; + var fields = objectValues(inputObj.getFields()); + var _iteratorNormalCompletion14 = true; + var _didIteratorError14 = false; + var _iteratorError14 = undefined; + + try { + for (var _iterator14 = fields[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) { + var field = _step14.value; + + if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) { + var fieldType = field.type.ofType; + var cycleIndex = fieldPathIndexByTypeName[fieldType.name]; + fieldPath.push(field); + + if (cycleIndex === undefined) { + detectCycleRecursive(fieldType); + } else { + var cyclePath = fieldPath.slice(cycleIndex); + var pathStr = cyclePath.map(function (fieldObj) { + return fieldObj.name; + }).join('.'); + context.reportError("Cannot reference Input Object \"".concat(fieldType.name, "\" within itself through a series of non-null fields: \"").concat(pathStr, "\"."), cyclePath.map(function (fieldObj) { + return fieldObj.astNode; + })); + } + + fieldPath.pop(); + } + } + } catch (err) { + _didIteratorError14 = true; + _iteratorError14 = err; + } finally { + try { + if (!_iteratorNormalCompletion14 && _iterator14.return != null) { + _iterator14.return(); + } + } finally { + if (_didIteratorError14) { + throw _iteratorError14; + } + } + } + + fieldPathIndexByTypeName[inputObj.name] = undefined; + } +} + +function getAllNodes(object) { + var astNode = object.astNode, + extensionASTNodes = object.extensionASTNodes; + return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes || []; +} + +function getAllSubNodes(object, getter) { + return flatMap(getAllNodes(object), function (item) { + return getter(item) || []; + }); +} + +function getAllImplementsInterfaceNodes(type, iface) { + return getAllSubNodes(type, function (typeNode) { + return typeNode.interfaces; + }).filter(function (ifaceNode) { + return ifaceNode.name.value === iface.name; + }); +} + +function getUnionMemberTypeNodes(union, typeName) { + return getAllSubNodes(union, function (unionNode) { + return unionNode.types; + }).filter(function (typeNode) { + return typeNode.name.value === typeName; + }); +} diff --git a/node_modules/graphql/utilities/TypeInfo.js b/node_modules/graphql/utilities/TypeInfo.js new file mode 100644 index 000000000..0118e30f0 --- /dev/null +++ b/node_modules/graphql/utilities/TypeInfo.js @@ -0,0 +1,343 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TypeInfo = void 0; + +var _find = _interopRequireDefault(require("../polyfills/find")); + +var _kinds = require("../language/kinds"); + +var _definition = require("../type/definition"); + +var _introspection = require("../type/introspection"); + +var _typeFromAST = require("./typeFromAST"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ +var TypeInfo = +/*#__PURE__*/ +function () { + function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._getFieldDef = getFieldDefFn || getFieldDef; + + if (initialType) { + if ((0, _definition.isInputType)(initialType)) { + this._inputTypeStack.push(initialType); + } + + if ((0, _definition.isCompositeType)(initialType)) { + this._parentTypeStack.push(initialType); + } + + if ((0, _definition.isOutputType)(initialType)) { + this._typeStack.push(initialType); + } + } + } + + var _proto = TypeInfo.prototype; + + _proto.getType = function getType() { + if (this._typeStack.length > 0) { + return this._typeStack[this._typeStack.length - 1]; + } + }; + + _proto.getParentType = function getParentType() { + if (this._parentTypeStack.length > 0) { + return this._parentTypeStack[this._parentTypeStack.length - 1]; + } + }; + + _proto.getInputType = function getInputType() { + if (this._inputTypeStack.length > 0) { + return this._inputTypeStack[this._inputTypeStack.length - 1]; + } + }; + + _proto.getParentInputType = function getParentInputType() { + if (this._inputTypeStack.length > 1) { + return this._inputTypeStack[this._inputTypeStack.length - 2]; + } + }; + + _proto.getFieldDef = function getFieldDef() { + if (this._fieldDefStack.length > 0) { + return this._fieldDefStack[this._fieldDefStack.length - 1]; + } + }; + + _proto.getDefaultValue = function getDefaultValue() { + if (this._defaultValueStack.length > 0) { + return this._defaultValueStack[this._defaultValueStack.length - 1]; + } + }; + + _proto.getDirective = function getDirective() { + return this._directive; + }; + + _proto.getArgument = function getArgument() { + return this._argument; + }; + + _proto.getEnumValue = function getEnumValue() { + return this._enumValue; + }; + + _proto.enter = function enter(node) { + var schema = this._schema; // Note: many of the types below are explicitly typed as "mixed" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. + + switch (node.kind) { + case _kinds.Kind.SELECTION_SET: + { + var namedType = (0, _definition.getNamedType)(this.getType()); + + this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined); + + break; + } + + case _kinds.Kind.FIELD: + { + var parentType = this.getParentType(); + var fieldDef; + var fieldType; + + if (parentType) { + fieldDef = this._getFieldDef(schema, parentType, node); + + if (fieldDef) { + fieldType = fieldDef.type; + } + } + + this._fieldDefStack.push(fieldDef); + + this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined); + + break; + } + + case _kinds.Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + + case _kinds.Kind.OPERATION_DEFINITION: + { + var type; + + if (node.operation === 'query') { + type = schema.getQueryType(); + } else if (node.operation === 'mutation') { + type = schema.getMutationType(); + } else if (node.operation === 'subscription') { + type = schema.getSubscriptionType(); + } + + this._typeStack.push((0, _definition.isObjectType)(type) ? type : undefined); + + break; + } + + case _kinds.Kind.INLINE_FRAGMENT: + case _kinds.Kind.FRAGMENT_DEFINITION: + { + var typeConditionAST = node.typeCondition; + var outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType()); + + this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined); + + break; + } + + case _kinds.Kind.VARIABLE_DEFINITION: + { + var inputType = (0, _typeFromAST.typeFromAST)(schema, node.type); + + this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined); + + break; + } + + case _kinds.Kind.ARGUMENT: + { + var argDef; + var argType; + var fieldOrDirective = this.getDirective() || this.getFieldDef(); + + if (fieldOrDirective) { + argDef = (0, _find.default)(fieldOrDirective.args, function (arg) { + return arg.name === node.name.value; + }); + + if (argDef) { + argType = argDef.type; + } + } + + this._argument = argDef; + + this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); + + this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined); + + break; + } + + case _kinds.Kind.LIST: + { + var listType = (0, _definition.getNullableType)(this.getInputType()); + var itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value. + + this._defaultValueStack.push(undefined); + + this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined); + + break; + } + + case _kinds.Kind.OBJECT_FIELD: + { + var objectType = (0, _definition.getNamedType)(this.getInputType()); + var inputFieldType; + var inputField; + + if ((0, _definition.isInputObjectType)(objectType)) { + inputField = objectType.getFields()[node.name.value]; + + if (inputField) { + inputFieldType = inputField.type; + } + } + + this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined); + + this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined); + + break; + } + + case _kinds.Kind.ENUM: + { + var enumType = (0, _definition.getNamedType)(this.getInputType()); + var enumValue; + + if ((0, _definition.isEnumType)(enumType)) { + enumValue = enumType.getValue(node.value); + } + + this._enumValue = enumValue; + break; + } + } + }; + + _proto.leave = function leave(node) { + switch (node.kind) { + case _kinds.Kind.SELECTION_SET: + this._parentTypeStack.pop(); + + break; + + case _kinds.Kind.FIELD: + this._fieldDefStack.pop(); + + this._typeStack.pop(); + + break; + + case _kinds.Kind.DIRECTIVE: + this._directive = null; + break; + + case _kinds.Kind.OPERATION_DEFINITION: + case _kinds.Kind.INLINE_FRAGMENT: + case _kinds.Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + + break; + + case _kinds.Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + + break; + + case _kinds.Kind.ARGUMENT: + this._argument = null; + + this._defaultValueStack.pop(); + + this._inputTypeStack.pop(); + + break; + + case _kinds.Kind.LIST: + case _kinds.Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + + this._inputTypeStack.pop(); + + break; + + case _kinds.Kind.ENUM: + this._enumValue = null; + break; + } + }; + + return TypeInfo; +}(); +/** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ + + +exports.TypeInfo = TypeInfo; + +function getFieldDef(schema, parentType, fieldNode) { + var name = fieldNode.name.value; + + if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.SchemaMetaFieldDef; + } + + if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return _introspection.TypeMetaFieldDef; + } + + if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) { + return _introspection.TypeNameMetaFieldDef; + } + + if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { + return parentType.getFields()[name]; + } +} diff --git a/node_modules/graphql/utilities/TypeInfo.js.flow b/node_modules/graphql/utilities/TypeInfo.js.flow new file mode 100644 index 000000000..1f2c8d887 --- /dev/null +++ b/node_modules/graphql/utilities/TypeInfo.js.flow @@ -0,0 +1,313 @@ +// @flow strict + +import find from '../polyfills/find'; +import { Kind } from '../language/kinds'; +import { + type GraphQLType, + type GraphQLInputType, + type GraphQLOutputType, + type GraphQLCompositeType, + type GraphQLField, + type GraphQLArgument, + type GraphQLInputField, + type GraphQLEnumValue, + isObjectType, + isInterfaceType, + isEnumType, + isInputObjectType, + isListType, + isCompositeType, + isInputType, + isOutputType, + getNullableType, + getNamedType, +} from '../type/definition'; +import { type GraphQLDirective } from '../type/directives'; +import { + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, +} from '../type/introspection'; +import { type GraphQLSchema } from '../type/schema'; +import { type ASTNode, type FieldNode } from '../language/ast'; +import { typeFromAST } from './typeFromAST'; + +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ +export class TypeInfo { + _schema: GraphQLSchema; + _typeStack: Array; + _parentTypeStack: Array; + _inputTypeStack: Array; + _fieldDefStack: Array>; + _defaultValueStack: Array; + _directive: ?GraphQLDirective; + _argument: ?GraphQLArgument; + _enumValue: ?GraphQLEnumValue; + _getFieldDef: typeof getFieldDef; + + constructor( + schema: GraphQLSchema, + // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn?: typeof getFieldDef, + // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType?: GraphQLType, + ): void { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._getFieldDef = getFieldDefFn || getFieldDef; + if (initialType) { + if (isInputType(initialType)) { + this._inputTypeStack.push(initialType); + } + if (isCompositeType(initialType)) { + this._parentTypeStack.push(initialType); + } + if (isOutputType(initialType)) { + this._typeStack.push(initialType); + } + } + } + + getType(): ?GraphQLOutputType { + if (this._typeStack.length > 0) { + return this._typeStack[this._typeStack.length - 1]; + } + } + + getParentType(): ?GraphQLCompositeType { + if (this._parentTypeStack.length > 0) { + return this._parentTypeStack[this._parentTypeStack.length - 1]; + } + } + + getInputType(): ?GraphQLInputType { + if (this._inputTypeStack.length > 0) { + return this._inputTypeStack[this._inputTypeStack.length - 1]; + } + } + + getParentInputType(): ?GraphQLInputType { + if (this._inputTypeStack.length > 1) { + return this._inputTypeStack[this._inputTypeStack.length - 2]; + } + } + + getFieldDef(): ?GraphQLField<*, *> { + if (this._fieldDefStack.length > 0) { + return this._fieldDefStack[this._fieldDefStack.length - 1]; + } + } + + getDefaultValue(): ?mixed { + if (this._defaultValueStack.length > 0) { + return this._defaultValueStack[this._defaultValueStack.length - 1]; + } + } + + getDirective(): ?GraphQLDirective { + return this._directive; + } + + getArgument(): ?GraphQLArgument { + return this._argument; + } + + getEnumValue(): ?GraphQLEnumValue { + return this._enumValue; + } + + enter(node: ASTNode) { + const schema = this._schema; + // Note: many of the types below are explicitly typed as "mixed" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. + switch (node.kind) { + case Kind.SELECTION_SET: { + const namedType: mixed = getNamedType(this.getType()); + this._parentTypeStack.push( + isCompositeType(namedType) ? namedType : undefined, + ); + break; + } + case Kind.FIELD: { + const parentType = this.getParentType(); + let fieldDef; + let fieldType: mixed; + if (parentType) { + fieldDef = this._getFieldDef(schema, parentType, node); + if (fieldDef) { + fieldType = fieldDef.type; + } + } + this._fieldDefStack.push(fieldDef); + this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined); + break; + } + case Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + case Kind.OPERATION_DEFINITION: { + let type: mixed; + if (node.operation === 'query') { + type = schema.getQueryType(); + } else if (node.operation === 'mutation') { + type = schema.getMutationType(); + } else if (node.operation === 'subscription') { + type = schema.getSubscriptionType(); + } + this._typeStack.push(isObjectType(type) ? type : undefined); + break; + } + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: { + const typeConditionAST = node.typeCondition; + const outputType: mixed = typeConditionAST + ? typeFromAST(schema, typeConditionAST) + : getNamedType(this.getType()); + this._typeStack.push(isOutputType(outputType) ? outputType : undefined); + break; + } + case Kind.VARIABLE_DEFINITION: { + const inputType: mixed = typeFromAST(schema, node.type); + this._inputTypeStack.push( + isInputType(inputType) ? inputType : undefined, + ); + break; + } + case Kind.ARGUMENT: { + let argDef; + let argType: mixed; + const fieldOrDirective = this.getDirective() || this.getFieldDef(); + if (fieldOrDirective) { + argDef = find( + fieldOrDirective.args, + arg => arg.name === node.name.value, + ); + if (argDef) { + argType = argDef.type; + } + } + this._argument = argDef; + this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); + this._inputTypeStack.push(isInputType(argType) ? argType : undefined); + break; + } + case Kind.LIST: { + const listType: mixed = getNullableType(this.getInputType()); + const itemType: mixed = isListType(listType) + ? listType.ofType + : listType; + // List positions never have a default value. + this._defaultValueStack.push(undefined); + this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined); + break; + } + case Kind.OBJECT_FIELD: { + const objectType: mixed = getNamedType(this.getInputType()); + let inputFieldType: GraphQLInputType | void; + let inputField: GraphQLInputField | void; + if (isInputObjectType(objectType)) { + inputField = objectType.getFields()[node.name.value]; + if (inputField) { + inputFieldType = inputField.type; + } + } + this._defaultValueStack.push( + inputField ? inputField.defaultValue : undefined, + ); + this._inputTypeStack.push( + isInputType(inputFieldType) ? inputFieldType : undefined, + ); + break; + } + case Kind.ENUM: { + const enumType: mixed = getNamedType(this.getInputType()); + let enumValue; + if (isEnumType(enumType)) { + enumValue = enumType.getValue(node.value); + } + this._enumValue = enumValue; + break; + } + } + } + + leave(node: ASTNode) { + switch (node.kind) { + case Kind.SELECTION_SET: + this._parentTypeStack.pop(); + break; + case Kind.FIELD: + this._fieldDefStack.pop(); + this._typeStack.pop(); + break; + case Kind.DIRECTIVE: + this._directive = null; + break; + case Kind.OPERATION_DEFINITION: + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + break; + case Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + break; + case Kind.ARGUMENT: + this._argument = null; + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.LIST: + case Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + this._inputTypeStack.pop(); + break; + case Kind.ENUM: + this._enumValue = null; + break; + } + } +} + +/** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ +function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLType, + fieldNode: FieldNode, +): ?GraphQLField<*, *> { + const name = fieldNode.name.value; + if ( + name === SchemaMetaFieldDef.name && + schema.getQueryType() === parentType + ) { + return SchemaMetaFieldDef; + } + if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return TypeMetaFieldDef; + } + if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) { + return TypeNameMetaFieldDef; + } + if (isObjectType(parentType) || isInterfaceType(parentType)) { + return parentType.getFields()[name]; + } +} diff --git a/node_modules/graphql/utilities/TypeInfo.mjs b/node_modules/graphql/utilities/TypeInfo.mjs new file mode 100644 index 000000000..0639fac70 --- /dev/null +++ b/node_modules/graphql/utilities/TypeInfo.mjs @@ -0,0 +1,327 @@ +import find from '../polyfills/find'; +import { Kind } from '../language/kinds'; +import { isObjectType, isInterfaceType, isEnumType, isInputObjectType, isListType, isCompositeType, isInputType, isOutputType, getNullableType, getNamedType } from '../type/definition'; +import { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from '../type/introspection'; +import { typeFromAST } from './typeFromAST'; +/** + * TypeInfo is a utility class which, given a GraphQL schema, can keep track + * of the current field and type definitions at any point in a GraphQL document + * AST during a recursive descent by calling `enter(node)` and `leave(node)`. + */ + +export var TypeInfo = +/*#__PURE__*/ +function () { + function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order + // to support non-spec-compliant codebases. You should never need to use it. + // It may disappear in the future. + getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType) { + this._schema = schema; + this._typeStack = []; + this._parentTypeStack = []; + this._inputTypeStack = []; + this._fieldDefStack = []; + this._defaultValueStack = []; + this._directive = null; + this._argument = null; + this._enumValue = null; + this._getFieldDef = getFieldDefFn || getFieldDef; + + if (initialType) { + if (isInputType(initialType)) { + this._inputTypeStack.push(initialType); + } + + if (isCompositeType(initialType)) { + this._parentTypeStack.push(initialType); + } + + if (isOutputType(initialType)) { + this._typeStack.push(initialType); + } + } + } + + var _proto = TypeInfo.prototype; + + _proto.getType = function getType() { + if (this._typeStack.length > 0) { + return this._typeStack[this._typeStack.length - 1]; + } + }; + + _proto.getParentType = function getParentType() { + if (this._parentTypeStack.length > 0) { + return this._parentTypeStack[this._parentTypeStack.length - 1]; + } + }; + + _proto.getInputType = function getInputType() { + if (this._inputTypeStack.length > 0) { + return this._inputTypeStack[this._inputTypeStack.length - 1]; + } + }; + + _proto.getParentInputType = function getParentInputType() { + if (this._inputTypeStack.length > 1) { + return this._inputTypeStack[this._inputTypeStack.length - 2]; + } + }; + + _proto.getFieldDef = function getFieldDef() { + if (this._fieldDefStack.length > 0) { + return this._fieldDefStack[this._fieldDefStack.length - 1]; + } + }; + + _proto.getDefaultValue = function getDefaultValue() { + if (this._defaultValueStack.length > 0) { + return this._defaultValueStack[this._defaultValueStack.length - 1]; + } + }; + + _proto.getDirective = function getDirective() { + return this._directive; + }; + + _proto.getArgument = function getArgument() { + return this._argument; + }; + + _proto.getEnumValue = function getEnumValue() { + return this._enumValue; + }; + + _proto.enter = function enter(node) { + var schema = this._schema; // Note: many of the types below are explicitly typed as "mixed" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. + + switch (node.kind) { + case Kind.SELECTION_SET: + { + var namedType = getNamedType(this.getType()); + + this._parentTypeStack.push(isCompositeType(namedType) ? namedType : undefined); + + break; + } + + case Kind.FIELD: + { + var parentType = this.getParentType(); + var fieldDef; + var fieldType; + + if (parentType) { + fieldDef = this._getFieldDef(schema, parentType, node); + + if (fieldDef) { + fieldType = fieldDef.type; + } + } + + this._fieldDefStack.push(fieldDef); + + this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined); + + break; + } + + case Kind.DIRECTIVE: + this._directive = schema.getDirective(node.name.value); + break; + + case Kind.OPERATION_DEFINITION: + { + var type; + + if (node.operation === 'query') { + type = schema.getQueryType(); + } else if (node.operation === 'mutation') { + type = schema.getMutationType(); + } else if (node.operation === 'subscription') { + type = schema.getSubscriptionType(); + } + + this._typeStack.push(isObjectType(type) ? type : undefined); + + break; + } + + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: + { + var typeConditionAST = node.typeCondition; + var outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType()); + + this._typeStack.push(isOutputType(outputType) ? outputType : undefined); + + break; + } + + case Kind.VARIABLE_DEFINITION: + { + var inputType = typeFromAST(schema, node.type); + + this._inputTypeStack.push(isInputType(inputType) ? inputType : undefined); + + break; + } + + case Kind.ARGUMENT: + { + var argDef; + var argType; + var fieldOrDirective = this.getDirective() || this.getFieldDef(); + + if (fieldOrDirective) { + argDef = find(fieldOrDirective.args, function (arg) { + return arg.name === node.name.value; + }); + + if (argDef) { + argType = argDef.type; + } + } + + this._argument = argDef; + + this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined); + + this._inputTypeStack.push(isInputType(argType) ? argType : undefined); + + break; + } + + case Kind.LIST: + { + var listType = getNullableType(this.getInputType()); + var itemType = isListType(listType) ? listType.ofType : listType; // List positions never have a default value. + + this._defaultValueStack.push(undefined); + + this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined); + + break; + } + + case Kind.OBJECT_FIELD: + { + var objectType = getNamedType(this.getInputType()); + var inputFieldType; + var inputField; + + if (isInputObjectType(objectType)) { + inputField = objectType.getFields()[node.name.value]; + + if (inputField) { + inputFieldType = inputField.type; + } + } + + this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined); + + this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : undefined); + + break; + } + + case Kind.ENUM: + { + var enumType = getNamedType(this.getInputType()); + var enumValue; + + if (isEnumType(enumType)) { + enumValue = enumType.getValue(node.value); + } + + this._enumValue = enumValue; + break; + } + } + }; + + _proto.leave = function leave(node) { + switch (node.kind) { + case Kind.SELECTION_SET: + this._parentTypeStack.pop(); + + break; + + case Kind.FIELD: + this._fieldDefStack.pop(); + + this._typeStack.pop(); + + break; + + case Kind.DIRECTIVE: + this._directive = null; + break; + + case Kind.OPERATION_DEFINITION: + case Kind.INLINE_FRAGMENT: + case Kind.FRAGMENT_DEFINITION: + this._typeStack.pop(); + + break; + + case Kind.VARIABLE_DEFINITION: + this._inputTypeStack.pop(); + + break; + + case Kind.ARGUMENT: + this._argument = null; + + this._defaultValueStack.pop(); + + this._inputTypeStack.pop(); + + break; + + case Kind.LIST: + case Kind.OBJECT_FIELD: + this._defaultValueStack.pop(); + + this._inputTypeStack.pop(); + + break; + + case Kind.ENUM: + this._enumValue = null; + break; + } + }; + + return TypeInfo; +}(); +/** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ + +function getFieldDef(schema, parentType, fieldNode) { + var name = fieldNode.name.value; + + if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { + return SchemaMetaFieldDef; + } + + if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { + return TypeMetaFieldDef; + } + + if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) { + return TypeNameMetaFieldDef; + } + + if (isObjectType(parentType) || isInterfaceType(parentType)) { + return parentType.getFields()[name]; + } +} diff --git a/node_modules/graphql/utilities/assertValidName.js b/node_modules/graphql/utilities/assertValidName.js new file mode 100644 index 000000000..cfd78cc7f --- /dev/null +++ b/node_modules/graphql/utilities/assertValidName.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assertValidName = assertValidName; +exports.isValidNameError = isValidNameError; + +var _GraphQLError = require("../error/GraphQLError"); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/; +/** + * Upholds the spec rules about naming. + */ + +function assertValidName(name) { + var error = isValidNameError(name); + + if (error) { + throw error; + } + + return name; +} +/** + * Returns an Error if a name is invalid. + */ + + +function isValidNameError(name, node) { + !(typeof name === 'string') ? (0, _invariant.default)(0, 'Expected string') : void 0; + + if (name.length > 1 && name[0] === '_' && name[1] === '_') { + return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); + } + + if (!NAME_RX.test(name)) { + return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); + } +} diff --git a/node_modules/graphql/utilities/assertValidName.js.flow b/node_modules/graphql/utilities/assertValidName.js.flow new file mode 100644 index 000000000..632b2230d --- /dev/null +++ b/node_modules/graphql/utilities/assertValidName.js.flow @@ -0,0 +1,40 @@ +// @flow strict + +import { GraphQLError } from '../error/GraphQLError'; +import { type ASTNode } from '../language/ast'; +import invariant from '../jsutils/invariant'; + +const NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/; + +/** + * Upholds the spec rules about naming. + */ +export function assertValidName(name: string): string { + const error = isValidNameError(name); + if (error) { + throw error; + } + return name; +} + +/** + * Returns an Error if a name is invalid. + */ +export function isValidNameError( + name: string, + node?: ASTNode | void, +): GraphQLError | void { + invariant(typeof name === 'string', 'Expected string'); + if (name.length > 1 && name[0] === '_' && name[1] === '_') { + return new GraphQLError( + `Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`, + node, + ); + } + if (!NAME_RX.test(name)) { + return new GraphQLError( + `Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "${name}" does not.`, + node, + ); + } +} diff --git a/node_modules/graphql/utilities/assertValidName.mjs b/node_modules/graphql/utilities/assertValidName.mjs new file mode 100644 index 000000000..40bec24a5 --- /dev/null +++ b/node_modules/graphql/utilities/assertValidName.mjs @@ -0,0 +1,31 @@ +import { GraphQLError } from '../error/GraphQLError'; +import invariant from '../jsutils/invariant'; +var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/; +/** + * Upholds the spec rules about naming. + */ + +export function assertValidName(name) { + var error = isValidNameError(name); + + if (error) { + throw error; + } + + return name; +} +/** + * Returns an Error if a name is invalid. + */ + +export function isValidNameError(name, node) { + !(typeof name === 'string') ? invariant(0, 'Expected string') : void 0; + + if (name.length > 1 && name[0] === '_' && name[1] === '_') { + return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); + } + + if (!NAME_RX.test(name)) { + return new GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); + } +} diff --git a/node_modules/graphql/utilities/astFromValue.js b/node_modules/graphql/utilities/astFromValue.js new file mode 100644 index 000000000..3c6e12ae6 --- /dev/null +++ b/node_modules/graphql/utilities/astFromValue.js @@ -0,0 +1,207 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.astFromValue = astFromValue; + +var _iterall = require("iterall"); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _isNullish = _interopRequireDefault(require("../jsutils/isNullish")); + +var _isInvalid = _interopRequireDefault(require("../jsutils/isInvalid")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _kinds = require("../language/kinds"); + +var _definition = require("../type/definition"); + +var _scalars = require("../type/scalars"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a GraphQL Value AST given a JavaScript value. + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | Mixed | Enum Value | + * | null | NullValue | + * + */ +function astFromValue(value, type) { + if ((0, _definition.isNonNullType)(type)) { + var astValue = astFromValue(value, type.ofType); + + if (astValue && astValue.kind === _kinds.Kind.NULL) { + return null; + } + + return astValue; + } // only explicit null, not undefined, NaN + + + if (value === null) { + return { + kind: _kinds.Kind.NULL + }; + } // undefined, NaN + + + if ((0, _isInvalid.default)(value)) { + return null; + } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + + + if ((0, _definition.isListType)(type)) { + var itemType = type.ofType; + + if ((0, _iterall.isCollection)(value)) { + var valuesNodes = []; + (0, _iterall.forEach)(value, function (item) { + var itemNode = astFromValue(item, itemType); + + if (itemNode) { + valuesNodes.push(itemNode); + } + }); + return { + kind: _kinds.Kind.LIST, + values: valuesNodes + }; + } + + return astFromValue(value, itemType); + } // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + + + if ((0, _definition.isInputObjectType)(type)) { + if (!(0, _isObjectLike.default)(value)) { + return null; + } + + var fieldNodes = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectValues.default)(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var field = _step.value; + var fieldValue = astFromValue(value[field.name], field.type); + + if (fieldValue) { + fieldNodes.push({ + kind: _kinds.Kind.OBJECT_FIELD, + name: { + kind: _kinds.Kind.NAME, + value: field.name + }, + value: fieldValue + }); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + kind: _kinds.Kind.OBJECT, + fields: fieldNodes + }; + } + + if ((0, _definition.isLeafType)(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + var serialized = type.serialize(value); + + if ((0, _isNullish.default)(serialized)) { + return null; + } // Others serialize based on their corresponding JavaScript scalar types. + + + if (typeof serialized === 'boolean') { + return { + kind: _kinds.Kind.BOOLEAN, + value: serialized + }; + } // JavaScript numbers can be Int or Float values. + + + if (typeof serialized === 'number') { + var stringNum = String(serialized); + return integerStringRegExp.test(stringNum) ? { + kind: _kinds.Kind.INT, + value: stringNum + } : { + kind: _kinds.Kind.FLOAT, + value: stringNum + }; + } + + if (typeof serialized === 'string') { + // Enum types use Enum literals. + if ((0, _definition.isEnumType)(type)) { + return { + kind: _kinds.Kind.ENUM, + value: serialized + }; + } // ID types can use Int literals. + + + if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) { + return { + kind: _kinds.Kind.INT, + value: serialized + }; + } + + return { + kind: _kinds.Kind.STRING, + value: serialized + }; + } + + throw new TypeError("Cannot convert value to AST: ".concat((0, _inspect.default)(serialized))); + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat((0, _inspect.default)(type), "\".")); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ + + +var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/node_modules/graphql/utilities/astFromValue.js.flow b/node_modules/graphql/utilities/astFromValue.js.flow new file mode 100644 index 000000000..a697cbcca --- /dev/null +++ b/node_modules/graphql/utilities/astFromValue.js.flow @@ -0,0 +1,146 @@ +// @flow strict + +import { forEach, isCollection } from 'iterall'; + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import isNullish from '../jsutils/isNullish'; +import isInvalid from '../jsutils/isInvalid'; +import isObjectLike from '../jsutils/isObjectLike'; +import { type ValueNode } from '../language/ast'; +import { Kind } from '../language/kinds'; +import { + type GraphQLInputType, + isLeafType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, +} from '../type/definition'; +import { GraphQLID } from '../type/scalars'; + +/** + * Produces a GraphQL Value AST given a JavaScript value. + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | Mixed | Enum Value | + * | null | NullValue | + * + */ +export function astFromValue(value: mixed, type: GraphQLInputType): ?ValueNode { + if (isNonNullType(type)) { + const astValue = astFromValue(value, type.ofType); + if (astValue && astValue.kind === Kind.NULL) { + return null; + } + return astValue; + } + + // only explicit null, not undefined, NaN + if (value === null) { + return { kind: Kind.NULL }; + } + + // undefined, NaN + if (isInvalid(value)) { + return null; + } + + // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if (isListType(type)) { + const itemType = type.ofType; + if (isCollection(value)) { + const valuesNodes = []; + forEach((value: any), item => { + const itemNode = astFromValue(item, itemType); + if (itemNode) { + valuesNodes.push(itemNode); + } + }); + return { kind: Kind.LIST, values: valuesNodes }; + } + return astFromValue(value, itemType); + } + + // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return null; + } + const fieldNodes = []; + for (const field of objectValues(type.getFields())) { + const fieldValue = astFromValue(value[field.name], field.type); + if (fieldValue) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { kind: Kind.NAME, value: field.name }, + value: fieldValue, + }); + } + } + return { kind: Kind.OBJECT, fields: fieldNodes }; + } + + if (isLeafType(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + const serialized = type.serialize(value); + if (isNullish(serialized)) { + return null; + } + + // Others serialize based on their corresponding JavaScript scalar types. + if (typeof serialized === 'boolean') { + return { kind: Kind.BOOLEAN, value: serialized }; + } + + // JavaScript numbers can be Int or Float values. + if (typeof serialized === 'number') { + const stringNum = String(serialized); + return integerStringRegExp.test(stringNum) + ? { kind: Kind.INT, value: stringNum } + : { kind: Kind.FLOAT, value: stringNum }; + } + + if (typeof serialized === 'string') { + // Enum types use Enum literals. + if (isEnumType(type)) { + return { kind: Kind.ENUM, value: serialized }; + } + + // ID types can use Int literals. + if (type === GraphQLID && integerStringRegExp.test(serialized)) { + return { kind: Kind.INT, value: serialized }; + } + + return { + kind: Kind.STRING, + value: serialized, + }; + } + + throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}`); + } + + // Not reachable. All possible input types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected input type: "${inspect((type: empty))}".`); +} + +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ +const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/node_modules/graphql/utilities/astFromValue.mjs b/node_modules/graphql/utilities/astFromValue.mjs new file mode 100644 index 000000000..f8991d483 --- /dev/null +++ b/node_modules/graphql/utilities/astFromValue.mjs @@ -0,0 +1,189 @@ +import { forEach, isCollection } from 'iterall'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import isNullish from '../jsutils/isNullish'; +import isInvalid from '../jsutils/isInvalid'; +import isObjectLike from '../jsutils/isObjectLike'; +import { Kind } from '../language/kinds'; +import { isLeafType, isEnumType, isInputObjectType, isListType, isNonNullType } from '../type/definition'; +import { GraphQLID } from '../type/scalars'; +/** + * Produces a GraphQL Value AST given a JavaScript value. + * + * A GraphQL type must be provided, which will be used to interpret different + * JavaScript values. + * + * | JSON Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Number | Int / Float | + * | Mixed | Enum Value | + * | null | NullValue | + * + */ + +export function astFromValue(value, type) { + if (isNonNullType(type)) { + var astValue = astFromValue(value, type.ofType); + + if (astValue && astValue.kind === Kind.NULL) { + return null; + } + + return astValue; + } // only explicit null, not undefined, NaN + + + if (value === null) { + return { + kind: Kind.NULL + }; + } // undefined, NaN + + + if (isInvalid(value)) { + return null; + } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + + + if (isListType(type)) { + var itemType = type.ofType; + + if (isCollection(value)) { + var valuesNodes = []; + forEach(value, function (item) { + var itemNode = astFromValue(item, itemType); + + if (itemNode) { + valuesNodes.push(itemNode); + } + }); + return { + kind: Kind.LIST, + values: valuesNodes + }; + } + + return astFromValue(value, itemType); + } // Populate the fields of the input object by creating ASTs from each value + // in the JavaScript object according to the fields in the input type. + + + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return null; + } + + var fieldNodes = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectValues(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var field = _step.value; + var fieldValue = astFromValue(value[field.name], field.type); + + if (fieldValue) { + fieldNodes.push({ + kind: Kind.OBJECT_FIELD, + name: { + kind: Kind.NAME, + value: field.name + }, + value: fieldValue + }); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + kind: Kind.OBJECT, + fields: fieldNodes + }; + } + + if (isLeafType(type)) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + var serialized = type.serialize(value); + + if (isNullish(serialized)) { + return null; + } // Others serialize based on their corresponding JavaScript scalar types. + + + if (typeof serialized === 'boolean') { + return { + kind: Kind.BOOLEAN, + value: serialized + }; + } // JavaScript numbers can be Int or Float values. + + + if (typeof serialized === 'number') { + var stringNum = String(serialized); + return integerStringRegExp.test(stringNum) ? { + kind: Kind.INT, + value: stringNum + } : { + kind: Kind.FLOAT, + value: stringNum + }; + } + + if (typeof serialized === 'string') { + // Enum types use Enum literals. + if (isEnumType(type)) { + return { + kind: Kind.ENUM, + value: serialized + }; + } // ID types can use Int literals. + + + if (type === GraphQLID && integerStringRegExp.test(serialized)) { + return { + kind: Kind.INT, + value: serialized + }; + } + + return { + kind: Kind.STRING, + value: serialized + }; + } + + throw new TypeError("Cannot convert value to AST: ".concat(inspect(serialized))); + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat(inspect(type), "\".")); +} +/** + * IntValue: + * - NegativeSign? 0 + * - NegativeSign? NonZeroDigit ( Digit+ )? + */ + +var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/node_modules/graphql/utilities/buildASTSchema.js b/node_modules/graphql/utilities/buildASTSchema.js new file mode 100644 index 000000000..eeb190dbb --- /dev/null +++ b/node_modules/graphql/utilities/buildASTSchema.js @@ -0,0 +1,494 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildASTSchema = buildASTSchema; +exports.getDescription = getDescription; +exports.buildSchema = buildSchema; +exports.ASTDefinitionBuilder = void 0; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _keyMap = _interopRequireDefault(require("../jsutils/keyMap")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _valueFromAST = require("./valueFromAST"); + +var _validate = require("../validation/validate"); + +var _blockString = require("../language/blockString"); + +var _tokenKind = require("../language/tokenKind"); + +var _parser = require("../language/parser"); + +var _values = require("../execution/values"); + +var _kinds = require("../language/kinds"); + +var _predicates = require("../language/predicates"); + +var _definition = require("../type/definition"); + +var _directives = require("../type/directives"); + +var _introspection = require("../type/introspection"); + +var _scalars = require("../type/scalars"); + +var _schema = require("../type/schema"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This takes the ast of a schema document produced by the parse function in + * src/language/parser.js. + * + * If no schema definition is provided, then it will look for types named Query + * and Mutation. + * + * Given that AST it constructs a GraphQLSchema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +function buildASTSchema(documentAST, options) { + !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0; + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + (0, _validate.assertValidSDL)(documentAST); + } + + var schemaDef; + var typeDefs = []; + var directiveDefs = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if ((0, _predicates.isTypeDefinitionNode)(def)) { + typeDefs.push(def); + } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astBuilder = new ASTDefinitionBuilder(options, function (typeName) { + var type = typeMap[typeName]; + !type ? (0, _invariant.default)(0, "Type \"".concat(typeName, "\" not found in document.")) : void 0; + return type; + }); + var typeMap = keyByNameNode(typeDefs, function (node) { + return astBuilder.buildType(node); + }); + var operationTypes = schemaDef ? getOperationTypes(schemaDef) : { + query: 'Query', + mutation: 'Mutation', + subscription: 'Subscription' + }; + var directives = directiveDefs.map(function (def) { + return astBuilder.buildDirective(def); + }); // If specified directives were not explicitly declared, add them. + + if (!directives.some(function (directive) { + return directive.name === 'skip'; + })) { + directives.push(_directives.GraphQLSkipDirective); + } + + if (!directives.some(function (directive) { + return directive.name === 'include'; + })) { + directives.push(_directives.GraphQLIncludeDirective); + } + + if (!directives.some(function (directive) { + return directive.name === 'deprecated'; + })) { + directives.push(_directives.GraphQLDeprecatedDirective); + } + + return new _schema.GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: operationTypes.query ? typeMap[operationTypes.query] : null, + mutation: operationTypes.mutation ? typeMap[operationTypes.mutation] : null, + subscription: operationTypes.subscription ? typeMap[operationTypes.subscription] : null, + types: (0, _objectValues.default)(typeMap), + directives: directives, + astNode: schemaDef, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames + }); + + function getOperationTypes(schema) { + var opTypes = {}; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = schema.operationTypes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var operationType = _step2.value; + opTypes[operationType.operation] = operationType.type.name.value; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return opTypes; + } +} + +var stdTypeMap = (0, _keyMap.default)(_scalars.specifiedScalarTypes.concat(_introspection.introspectionTypes), function (type) { + return type.name; +}); + +var ASTDefinitionBuilder = +/*#__PURE__*/ +function () { + function ASTDefinitionBuilder(options, resolveType) { + this._options = options; + this._resolveType = resolveType; + } + + var _proto = ASTDefinitionBuilder.prototype; + + _proto.getNamedType = function getNamedType(node) { + var name = node.name.value; + return stdTypeMap[name] || this._resolveType(name); + }; + + _proto.getWrappedType = function getWrappedType(node) { + if (node.kind === _kinds.Kind.LIST_TYPE) { + return new _definition.GraphQLList(this.getWrappedType(node.type)); + } + + if (node.kind === _kinds.Kind.NON_NULL_TYPE) { + return new _definition.GraphQLNonNull(this.getWrappedType(node.type)); + } + + return this.getNamedType(node); + }; + + _proto.buildDirective = function buildDirective(directive) { + var _this = this; + + var locations = directive.locations.map(function (_ref) { + var value = _ref.value; + return value; + }); + return new _directives.GraphQLDirective({ + name: directive.name.value, + description: getDescription(directive, this._options), + locations: locations, + isRepeatable: directive.repeatable, + args: keyByNameNode(directive.arguments || [], function (arg) { + return _this.buildArg(arg); + }), + astNode: directive + }); + }; + + _proto.buildField = function buildField(field) { + var _this2 = this; + + return { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + type: this.getWrappedType(field.type), + description: getDescription(field, this._options), + args: keyByNameNode(field.arguments || [], function (arg) { + return _this2.buildArg(arg); + }), + deprecationReason: getDeprecationReason(field), + astNode: field + }; + }; + + _proto.buildArg = function buildArg(value) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + var type = this.getWrappedType(value.type); + return { + type: type, + description: getDescription(value, this._options), + defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type), + astNode: value + }; + }; + + _proto.buildInputField = function buildInputField(value) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + var type = this.getWrappedType(value.type); + return { + type: type, + description: getDescription(value, this._options), + defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type), + astNode: value + }; + }; + + _proto.buildEnumValue = function buildEnumValue(value) { + return { + description: getDescription(value, this._options), + deprecationReason: getDeprecationReason(value), + astNode: value + }; + }; + + _proto.buildType = function buildType(astNode) { + var name = astNode.name.value; + + if (stdTypeMap[name]) { + return stdTypeMap[name]; + } + + switch (astNode.kind) { + case _kinds.Kind.OBJECT_TYPE_DEFINITION: + return this._makeTypeDef(astNode); + + case _kinds.Kind.INTERFACE_TYPE_DEFINITION: + return this._makeInterfaceDef(astNode); + + case _kinds.Kind.ENUM_TYPE_DEFINITION: + return this._makeEnumDef(astNode); + + case _kinds.Kind.UNION_TYPE_DEFINITION: + return this._makeUnionDef(astNode); + + case _kinds.Kind.SCALAR_TYPE_DEFINITION: + return this._makeScalarDef(astNode); + + case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: + return this._makeInputObjectDef(astNode); + } // Not reachable. All possible type definition nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type definition node: \"".concat((0, _inspect.default)(astNode), "\".")); + }; + + _proto._makeTypeDef = function _makeTypeDef(astNode) { + var _this3 = this; + + var interfaceNodes = astNode.interfaces; + var fieldNodes = astNode.fields; // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + + var interfaces = interfaceNodes && interfaceNodes.length > 0 ? function () { + return interfaceNodes.map(function (ref) { + return _this3.getNamedType(ref); + }); + } : []; + var fields = fieldNodes && fieldNodes.length > 0 ? function () { + return keyByNameNode(fieldNodes, function (field) { + return _this3.buildField(field); + }); + } : Object.create(null); + return new _definition.GraphQLObjectType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + interfaces: interfaces, + fields: fields, + astNode: astNode + }); + }; + + _proto._makeInterfaceDef = function _makeInterfaceDef(astNode) { + var _this4 = this; + + var fieldNodes = astNode.fields; + var fields = fieldNodes && fieldNodes.length > 0 ? function () { + return keyByNameNode(fieldNodes, function (field) { + return _this4.buildField(field); + }); + } : Object.create(null); + return new _definition.GraphQLInterfaceType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + fields: fields, + astNode: astNode + }); + }; + + _proto._makeEnumDef = function _makeEnumDef(astNode) { + var _this5 = this; + + var valueNodes = astNode.values || []; + return new _definition.GraphQLEnumType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + values: keyByNameNode(valueNodes, function (value) { + return _this5.buildEnumValue(value); + }), + astNode: astNode + }); + }; + + _proto._makeUnionDef = function _makeUnionDef(astNode) { + var _this6 = this; + + var typeNodes = astNode.types; // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + + var types = typeNodes && typeNodes.length > 0 ? function () { + return typeNodes.map(function (ref) { + return _this6.getNamedType(ref); + }); + } : []; + return new _definition.GraphQLUnionType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + types: types, + astNode: astNode + }); + }; + + _proto._makeScalarDef = function _makeScalarDef(astNode) { + return new _definition.GraphQLScalarType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + astNode: astNode + }); + }; + + _proto._makeInputObjectDef = function _makeInputObjectDef(def) { + var _this7 = this; + + var fields = def.fields; + return new _definition.GraphQLInputObjectType({ + name: def.name.value, + description: getDescription(def, this._options), + fields: fields ? function () { + return keyByNameNode(fields, function (field) { + return _this7.buildInputField(field); + }); + } : Object.create(null), + astNode: def + }); + }; + + return ASTDefinitionBuilder; +}(); + +exports.ASTDefinitionBuilder = ASTDefinitionBuilder; + +function keyByNameNode(list, valFn) { + return (0, _keyValMap.default)(list, function (_ref2) { + var name = _ref2.name; + return name.value; + }, valFn); +} +/** + * Given a field or enum value node, returns the string value for the + * deprecation reason. + */ + + +function getDeprecationReason(node) { + var deprecated = (0, _values.getDirectiveValues)(_directives.GraphQLDeprecatedDirective, node); + return deprecated && deprecated.reason; +} +/** + * Given an ast node, returns its string description. + * @deprecated: provided to ease adoption and will be removed in v16. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ + + +function getDescription(node, options) { + if (node.description) { + return node.description.value; + } + + if (options && options.commentDescriptions) { + var rawValue = getLeadingCommentBlock(node); + + if (rawValue !== undefined) { + return (0, _blockString.dedentBlockStringValue)('\n' + rawValue); + } + } +} + +function getLeadingCommentBlock(node) { + var loc = node.loc; + + if (!loc) { + return; + } + + var comments = []; + var token = loc.startToken.prev; + + while (token && token.kind === _tokenKind.TokenKind.COMMENT && token.next && token.prev && token.line + 1 === token.next.line && token.line !== token.prev.line) { + var value = String(token.value); + comments.push(value); + token = token.prev; + } + + return comments.reverse().join('\n'); +} +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + */ + + +function buildSchema(source, options) { + return buildASTSchema((0, _parser.parse)(source, options), options); +} diff --git a/node_modules/graphql/utilities/buildASTSchema.js.flow b/node_modules/graphql/utilities/buildASTSchema.js.flow new file mode 100644 index 000000000..3694e81cf --- /dev/null +++ b/node_modules/graphql/utilities/buildASTSchema.js.flow @@ -0,0 +1,489 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import keyValMap from '../jsutils/keyValMap'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { valueFromAST } from './valueFromAST'; +import { assertValidSDL } from '../validation/validate'; +import { dedentBlockStringValue } from '../language/blockString'; +import { TokenKind } from '../language/tokenKind'; +import { type ParseOptions, parse } from '../language/parser'; +import { type Source } from '../language/source'; +import { getDirectiveValues } from '../execution/values'; +import { Kind } from '../language/kinds'; + +import { + type DocumentNode, + type NameNode, + type TypeNode, + type NamedTypeNode, + type SchemaDefinitionNode, + type TypeDefinitionNode, + type ScalarTypeDefinitionNode, + type ObjectTypeDefinitionNode, + type FieldDefinitionNode, + type InputValueDefinitionNode, + type InterfaceTypeDefinitionNode, + type UnionTypeDefinitionNode, + type EnumTypeDefinitionNode, + type EnumValueDefinitionNode, + type InputObjectTypeDefinitionNode, + type DirectiveDefinitionNode, + type StringValueNode, + type Location, +} from '../language/ast'; +import { isTypeDefinitionNode } from '../language/predicates'; + +import { type DirectiveLocationEnum } from '../language/directiveLocation'; + +import { + type GraphQLType, + type GraphQLNamedType, + type GraphQLFieldConfig, + type GraphQLArgumentConfig, + type GraphQLEnumValueConfig, + type GraphQLInputFieldConfig, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, +} from '../type/definition'; + +import { + GraphQLDirective, + GraphQLSkipDirective, + GraphQLIncludeDirective, + GraphQLDeprecatedDirective, +} from '../type/directives'; + +import { introspectionTypes } from '../type/introspection'; + +import { specifiedScalarTypes } from '../type/scalars'; + +import { + type GraphQLSchemaValidationOptions, + GraphQLSchema, +} from '../type/schema'; + +export type BuildSchemaOptions = { + ...GraphQLSchemaValidationOptions, + + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean, + + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean, + + ... +}; + +/** + * This takes the ast of a schema document produced by the parse function in + * src/language/parser.js. + * + * If no schema definition is provided, then it will look for types named Query + * and Mutation. + * + * Given that AST it constructs a GraphQLSchema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function buildASTSchema( + documentAST: DocumentNode, + options?: BuildSchemaOptions, +): GraphQLSchema { + invariant( + documentAST && documentAST.kind === Kind.DOCUMENT, + 'Must provide valid Document AST', + ); + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + assertValidSDL(documentAST); + } + + let schemaDef: ?SchemaDefinitionNode; + const typeDefs: Array = []; + const directiveDefs: Array = []; + + for (const def of documentAST.definitions) { + if (def.kind === Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (isTypeDefinitionNode(def)) { + typeDefs.push(def); + } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } + + const astBuilder = new ASTDefinitionBuilder(options, typeName => { + const type = typeMap[typeName]; + invariant(type, `Type "${typeName}" not found in document.`); + return type; + }); + + const typeMap = keyByNameNode(typeDefs, node => astBuilder.buildType(node)); + + const operationTypes = schemaDef + ? getOperationTypes(schemaDef) + : { + query: 'Query', + mutation: 'Mutation', + subscription: 'Subscription', + }; + + const directives = directiveDefs.map(def => astBuilder.buildDirective(def)); + + // If specified directives were not explicitly declared, add them. + if (!directives.some(directive => directive.name === 'skip')) { + directives.push(GraphQLSkipDirective); + } + + if (!directives.some(directive => directive.name === 'include')) { + directives.push(GraphQLIncludeDirective); + } + + if (!directives.some(directive => directive.name === 'deprecated')) { + directives.push(GraphQLDeprecatedDirective); + } + + return new GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: operationTypes.query ? (typeMap[operationTypes.query]: any) : null, + mutation: operationTypes.mutation + ? (typeMap[operationTypes.mutation]: any) + : null, + subscription: operationTypes.subscription + ? (typeMap[operationTypes.subscription]: any) + : null, + + types: objectValues(typeMap), + directives, + astNode: schemaDef, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames, + }); + + function getOperationTypes(schema: SchemaDefinitionNode) { + const opTypes = {}; + for (const operationType of schema.operationTypes) { + opTypes[operationType.operation] = operationType.type.name.value; + } + return opTypes; + } +} + +type TypeResolver = (typeName: string) => GraphQLNamedType; + +const stdTypeMap = keyMap( + specifiedScalarTypes.concat(introspectionTypes), + type => type.name, +); + +export class ASTDefinitionBuilder { + _options: ?BuildSchemaOptions; + _resolveType: TypeResolver; + + constructor(options: ?BuildSchemaOptions, resolveType: TypeResolver) { + this._options = options; + this._resolveType = resolveType; + } + + getNamedType(node: NamedTypeNode): GraphQLNamedType { + const name = node.name.value; + return stdTypeMap[name] || this._resolveType(name); + } + + getWrappedType(node: TypeNode): GraphQLType { + if (node.kind === Kind.LIST_TYPE) { + return new GraphQLList(this.getWrappedType(node.type)); + } + if (node.kind === Kind.NON_NULL_TYPE) { + return new GraphQLNonNull(this.getWrappedType(node.type)); + } + return this.getNamedType(node); + } + + buildDirective(directive: DirectiveDefinitionNode): GraphQLDirective { + const locations = directive.locations.map( + ({ value }) => ((value: any): DirectiveLocationEnum), + ); + + return new GraphQLDirective({ + name: directive.name.value, + description: getDescription(directive, this._options), + locations, + isRepeatable: directive.repeatable, + args: keyByNameNode(directive.arguments || [], arg => this.buildArg(arg)), + astNode: directive, + }); + } + + buildField(field: FieldDefinitionNode): GraphQLFieldConfig { + return { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + type: (this.getWrappedType(field.type): any), + description: getDescription(field, this._options), + args: keyByNameNode(field.arguments || [], arg => this.buildArg(arg)), + deprecationReason: getDeprecationReason(field), + astNode: field, + }; + } + + buildArg(value: InputValueDefinitionNode): GraphQLArgumentConfig { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type: any = this.getWrappedType(value.type); + return { + type, + description: getDescription(value, this._options), + defaultValue: valueFromAST(value.defaultValue, type), + astNode: value, + }; + } + + buildInputField(value: InputValueDefinitionNode): GraphQLInputFieldConfig { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + const type: any = this.getWrappedType(value.type); + return { + type, + description: getDescription(value, this._options), + defaultValue: valueFromAST(value.defaultValue, type), + astNode: value, + }; + } + + buildEnumValue(value: EnumValueDefinitionNode): GraphQLEnumValueConfig { + return { + description: getDescription(value, this._options), + deprecationReason: getDeprecationReason(value), + astNode: value, + }; + } + + buildType(astNode: TypeDefinitionNode): GraphQLNamedType { + const name = astNode.name.value; + if (stdTypeMap[name]) { + return stdTypeMap[name]; + } + + switch (astNode.kind) { + case Kind.OBJECT_TYPE_DEFINITION: + return this._makeTypeDef(astNode); + case Kind.INTERFACE_TYPE_DEFINITION: + return this._makeInterfaceDef(astNode); + case Kind.ENUM_TYPE_DEFINITION: + return this._makeEnumDef(astNode); + case Kind.UNION_TYPE_DEFINITION: + return this._makeUnionDef(astNode); + case Kind.SCALAR_TYPE_DEFINITION: + return this._makeScalarDef(astNode); + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + return this._makeInputObjectDef(astNode); + } + + // Not reachable. All possible type definition nodes have been considered. + /* istanbul ignore next */ + throw new Error( + `Unexpected type definition node: "${inspect((astNode: empty))}".`, + ); + } + + _makeTypeDef(astNode: ObjectTypeDefinitionNode) { + const interfaceNodes = astNode.interfaces; + const fieldNodes = astNode.fields; + + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + const interfaces = + interfaceNodes && interfaceNodes.length > 0 + ? () => interfaceNodes.map(ref => (this.getNamedType(ref): any)) + : []; + + const fields = + fieldNodes && fieldNodes.length > 0 + ? () => keyByNameNode(fieldNodes, field => this.buildField(field)) + : Object.create(null); + + return new GraphQLObjectType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + interfaces, + fields, + astNode, + }); + } + + _makeInterfaceDef(astNode: InterfaceTypeDefinitionNode) { + const fieldNodes = astNode.fields; + + const fields = + fieldNodes && fieldNodes.length > 0 + ? () => keyByNameNode(fieldNodes, field => this.buildField(field)) + : Object.create(null); + + return new GraphQLInterfaceType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + fields, + astNode, + }); + } + + _makeEnumDef(astNode: EnumTypeDefinitionNode) { + const valueNodes = astNode.values || []; + + return new GraphQLEnumType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + values: keyByNameNode(valueNodes, value => this.buildEnumValue(value)), + astNode, + }); + } + + _makeUnionDef(astNode: UnionTypeDefinitionNode) { + const typeNodes = astNode.types; + + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + const types = + typeNodes && typeNodes.length > 0 + ? () => typeNodes.map(ref => (this.getNamedType(ref): any)) + : []; + + return new GraphQLUnionType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + types, + astNode, + }); + } + + _makeScalarDef(astNode: ScalarTypeDefinitionNode) { + return new GraphQLScalarType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + astNode, + }); + } + + _makeInputObjectDef(def: InputObjectTypeDefinitionNode) { + const { fields } = def; + + return new GraphQLInputObjectType({ + name: def.name.value, + description: getDescription(def, this._options), + fields: fields + ? () => keyByNameNode(fields, field => this.buildInputField(field)) + : Object.create(null), + astNode: def, + }); + } +} + +function keyByNameNode( + list: $ReadOnlyArray, + valFn: (item: T) => V, +): ObjMap { + return keyValMap(list, ({ name }) => name.value, valFn); +} + +/** + * Given a field or enum value node, returns the string value for the + * deprecation reason. + */ +function getDeprecationReason( + node: EnumValueDefinitionNode | FieldDefinitionNode, +): ?string { + const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); + return deprecated && (deprecated.reason: any); +} + +/** + * Given an ast node, returns its string description. + * @deprecated: provided to ease adoption and will be removed in v16. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function getDescription( + node: { +description?: StringValueNode, +loc?: Location, ... }, + options: ?BuildSchemaOptions, +): void | string { + if (node.description) { + return node.description.value; + } + if (options && options.commentDescriptions) { + const rawValue = getLeadingCommentBlock(node); + if (rawValue !== undefined) { + return dedentBlockStringValue('\n' + rawValue); + } + } +} + +function getLeadingCommentBlock(node): void | string { + const loc = node.loc; + if (!loc) { + return; + } + const comments = []; + let token = loc.startToken.prev; + while ( + token && + token.kind === TokenKind.COMMENT && + token.next && + token.prev && + token.line + 1 === token.next.line && + token.line !== token.prev.line + ) { + const value = String(token.value); + comments.push(value); + token = token.prev; + } + return comments.reverse().join('\n'); +} + +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + */ +export function buildSchema( + source: string | Source, + options?: BuildSchemaOptions & ParseOptions, +): GraphQLSchema { + return buildASTSchema(parse(source, options), options); +} diff --git a/node_modules/graphql/utilities/buildASTSchema.mjs b/node_modules/graphql/utilities/buildASTSchema.mjs new file mode 100644 index 000000000..7ac3ec150 --- /dev/null +++ b/node_modules/graphql/utilities/buildASTSchema.mjs @@ -0,0 +1,461 @@ +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyMap from '../jsutils/keyMap'; +import keyValMap from '../jsutils/keyValMap'; +import { valueFromAST } from './valueFromAST'; +import { assertValidSDL } from '../validation/validate'; +import { dedentBlockStringValue } from '../language/blockString'; +import { TokenKind } from '../language/tokenKind'; +import { parse } from '../language/parser'; +import { getDirectiveValues } from '../execution/values'; +import { Kind } from '../language/kinds'; +import { isTypeDefinitionNode } from '../language/predicates'; +import { GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull } from '../type/definition'; +import { GraphQLDirective, GraphQLSkipDirective, GraphQLIncludeDirective, GraphQLDeprecatedDirective } from '../type/directives'; +import { introspectionTypes } from '../type/introspection'; +import { specifiedScalarTypes } from '../type/scalars'; +import { GraphQLSchema } from '../type/schema'; + +/** + * This takes the ast of a schema document produced by the parse function in + * src/language/parser.js. + * + * If no schema definition is provided, then it will look for types named Query + * and Mutation. + * + * Given that AST it constructs a GraphQLSchema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function buildASTSchema(documentAST, options) { + !(documentAST && documentAST.kind === Kind.DOCUMENT) ? invariant(0, 'Must provide valid Document AST') : void 0; + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + assertValidSDL(documentAST); + } + + var schemaDef; + var typeDefs = []; + var directiveDefs = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (def.kind === Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (isTypeDefinitionNode(def)) { + typeDefs.push(def); + } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astBuilder = new ASTDefinitionBuilder(options, function (typeName) { + var type = typeMap[typeName]; + !type ? invariant(0, "Type \"".concat(typeName, "\" not found in document.")) : void 0; + return type; + }); + var typeMap = keyByNameNode(typeDefs, function (node) { + return astBuilder.buildType(node); + }); + var operationTypes = schemaDef ? getOperationTypes(schemaDef) : { + query: 'Query', + mutation: 'Mutation', + subscription: 'Subscription' + }; + var directives = directiveDefs.map(function (def) { + return astBuilder.buildDirective(def); + }); // If specified directives were not explicitly declared, add them. + + if (!directives.some(function (directive) { + return directive.name === 'skip'; + })) { + directives.push(GraphQLSkipDirective); + } + + if (!directives.some(function (directive) { + return directive.name === 'include'; + })) { + directives.push(GraphQLIncludeDirective); + } + + if (!directives.some(function (directive) { + return directive.name === 'deprecated'; + })) { + directives.push(GraphQLDeprecatedDirective); + } + + return new GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: operationTypes.query ? typeMap[operationTypes.query] : null, + mutation: operationTypes.mutation ? typeMap[operationTypes.mutation] : null, + subscription: operationTypes.subscription ? typeMap[operationTypes.subscription] : null, + types: objectValues(typeMap), + directives: directives, + astNode: schemaDef, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames + }); + + function getOperationTypes(schema) { + var opTypes = {}; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = schema.operationTypes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var operationType = _step2.value; + opTypes[operationType.operation] = operationType.type.name.value; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return opTypes; + } +} +var stdTypeMap = keyMap(specifiedScalarTypes.concat(introspectionTypes), function (type) { + return type.name; +}); +export var ASTDefinitionBuilder = +/*#__PURE__*/ +function () { + function ASTDefinitionBuilder(options, resolveType) { + this._options = options; + this._resolveType = resolveType; + } + + var _proto = ASTDefinitionBuilder.prototype; + + _proto.getNamedType = function getNamedType(node) { + var name = node.name.value; + return stdTypeMap[name] || this._resolveType(name); + }; + + _proto.getWrappedType = function getWrappedType(node) { + if (node.kind === Kind.LIST_TYPE) { + return new GraphQLList(this.getWrappedType(node.type)); + } + + if (node.kind === Kind.NON_NULL_TYPE) { + return new GraphQLNonNull(this.getWrappedType(node.type)); + } + + return this.getNamedType(node); + }; + + _proto.buildDirective = function buildDirective(directive) { + var _this = this; + + var locations = directive.locations.map(function (_ref) { + var value = _ref.value; + return value; + }); + return new GraphQLDirective({ + name: directive.name.value, + description: getDescription(directive, this._options), + locations: locations, + isRepeatable: directive.repeatable, + args: keyByNameNode(directive.arguments || [], function (arg) { + return _this.buildArg(arg); + }), + astNode: directive + }); + }; + + _proto.buildField = function buildField(field) { + var _this2 = this; + + return { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + type: this.getWrappedType(field.type), + description: getDescription(field, this._options), + args: keyByNameNode(field.arguments || [], function (arg) { + return _this2.buildArg(arg); + }), + deprecationReason: getDeprecationReason(field), + astNode: field + }; + }; + + _proto.buildArg = function buildArg(value) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + var type = this.getWrappedType(value.type); + return { + type: type, + description: getDescription(value, this._options), + defaultValue: valueFromAST(value.defaultValue, type), + astNode: value + }; + }; + + _proto.buildInputField = function buildInputField(value) { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + var type = this.getWrappedType(value.type); + return { + type: type, + description: getDescription(value, this._options), + defaultValue: valueFromAST(value.defaultValue, type), + astNode: value + }; + }; + + _proto.buildEnumValue = function buildEnumValue(value) { + return { + description: getDescription(value, this._options), + deprecationReason: getDeprecationReason(value), + astNode: value + }; + }; + + _proto.buildType = function buildType(astNode) { + var name = astNode.name.value; + + if (stdTypeMap[name]) { + return stdTypeMap[name]; + } + + switch (astNode.kind) { + case Kind.OBJECT_TYPE_DEFINITION: + return this._makeTypeDef(astNode); + + case Kind.INTERFACE_TYPE_DEFINITION: + return this._makeInterfaceDef(astNode); + + case Kind.ENUM_TYPE_DEFINITION: + return this._makeEnumDef(astNode); + + case Kind.UNION_TYPE_DEFINITION: + return this._makeUnionDef(astNode); + + case Kind.SCALAR_TYPE_DEFINITION: + return this._makeScalarDef(astNode); + + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + return this._makeInputObjectDef(astNode); + } // Not reachable. All possible type definition nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type definition node: \"".concat(inspect(astNode), "\".")); + }; + + _proto._makeTypeDef = function _makeTypeDef(astNode) { + var _this3 = this; + + var interfaceNodes = astNode.interfaces; + var fieldNodes = astNode.fields; // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + + var interfaces = interfaceNodes && interfaceNodes.length > 0 ? function () { + return interfaceNodes.map(function (ref) { + return _this3.getNamedType(ref); + }); + } : []; + var fields = fieldNodes && fieldNodes.length > 0 ? function () { + return keyByNameNode(fieldNodes, function (field) { + return _this3.buildField(field); + }); + } : Object.create(null); + return new GraphQLObjectType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + interfaces: interfaces, + fields: fields, + astNode: astNode + }); + }; + + _proto._makeInterfaceDef = function _makeInterfaceDef(astNode) { + var _this4 = this; + + var fieldNodes = astNode.fields; + var fields = fieldNodes && fieldNodes.length > 0 ? function () { + return keyByNameNode(fieldNodes, function (field) { + return _this4.buildField(field); + }); + } : Object.create(null); + return new GraphQLInterfaceType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + fields: fields, + astNode: astNode + }); + }; + + _proto._makeEnumDef = function _makeEnumDef(astNode) { + var _this5 = this; + + var valueNodes = astNode.values || []; + return new GraphQLEnumType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + values: keyByNameNode(valueNodes, function (value) { + return _this5.buildEnumValue(value); + }), + astNode: astNode + }); + }; + + _proto._makeUnionDef = function _makeUnionDef(astNode) { + var _this6 = this; + + var typeNodes = astNode.types; // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + + var types = typeNodes && typeNodes.length > 0 ? function () { + return typeNodes.map(function (ref) { + return _this6.getNamedType(ref); + }); + } : []; + return new GraphQLUnionType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + types: types, + astNode: astNode + }); + }; + + _proto._makeScalarDef = function _makeScalarDef(astNode) { + return new GraphQLScalarType({ + name: astNode.name.value, + description: getDescription(astNode, this._options), + astNode: astNode + }); + }; + + _proto._makeInputObjectDef = function _makeInputObjectDef(def) { + var _this7 = this; + + var fields = def.fields; + return new GraphQLInputObjectType({ + name: def.name.value, + description: getDescription(def, this._options), + fields: fields ? function () { + return keyByNameNode(fields, function (field) { + return _this7.buildInputField(field); + }); + } : Object.create(null), + astNode: def + }); + }; + + return ASTDefinitionBuilder; +}(); + +function keyByNameNode(list, valFn) { + return keyValMap(list, function (_ref2) { + var name = _ref2.name; + return name.value; + }, valFn); +} +/** + * Given a field or enum value node, returns the string value for the + * deprecation reason. + */ + + +function getDeprecationReason(node) { + var deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); + return deprecated && deprecated.reason; +} +/** + * Given an ast node, returns its string description. + * @deprecated: provided to ease adoption and will be removed in v16. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ + + +export function getDescription(node, options) { + if (node.description) { + return node.description.value; + } + + if (options && options.commentDescriptions) { + var rawValue = getLeadingCommentBlock(node); + + if (rawValue !== undefined) { + return dedentBlockStringValue('\n' + rawValue); + } + } +} + +function getLeadingCommentBlock(node) { + var loc = node.loc; + + if (!loc) { + return; + } + + var comments = []; + var token = loc.startToken.prev; + + while (token && token.kind === TokenKind.COMMENT && token.next && token.prev && token.line + 1 === token.next.line && token.line !== token.prev.line) { + var value = String(token.value); + comments.push(value); + token = token.prev; + } + + return comments.reverse().join('\n'); +} +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + */ + + +export function buildSchema(source, options) { + return buildASTSchema(parse(source, options), options); +} diff --git a/node_modules/graphql/utilities/buildClientSchema.js b/node_modules/graphql/utilities/buildClientSchema.js new file mode 100644 index 000000000..d43af91dc --- /dev/null +++ b/node_modules/graphql/utilities/buildClientSchema.js @@ -0,0 +1,307 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildClientSchema = buildClientSchema; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _valueFromAST = require("./valueFromAST"); + +var _parser = require("../language/parser"); + +var _schema = require("../type/schema"); + +var _definition = require("../type/definition"); + +var _directives = require("../type/directives"); + +var _introspection = require("../type/introspection"); + +var _scalars = require("../type/scalars"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + */ +function buildClientSchema(introspection, options) { + !((0, _isObjectLike.default)(introspection) && (0, _isObjectLike.default)(introspection.__schema)) ? (0, _invariant.default)(0, 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' + (0, _inspect.default)(introspection)) : void 0; // Get the schema from the introspection result. + + var schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. + + var typeMap = (0, _keyValMap.default)(schemaIntrospection.types, function (typeIntrospection) { + return typeIntrospection.name; + }, function (typeIntrospection) { + return buildType(typeIntrospection); + }); + + for (var _i = 0, _arr = [].concat(_scalars.specifiedScalarTypes, _introspection.introspectionTypes); _i < _arr.length; _i++) { + var stdType = _arr[_i]; + + if (typeMap[stdType.name]) { + typeMap[stdType.name] = stdType; + } + } // Get the root Query, Mutation, and Subscription types. + + + var queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; + var mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; + var subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if + // directives were not queried for. + + var directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types. + + return new _schema.GraphQLSchema({ + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: (0, _objectValues.default)(typeMap), + directives: directives, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames + }); // Given a type reference in introspection, return the GraphQLType instance. + // preferring cached instances before building new instances. + + function getType(typeRef) { + if (typeRef.kind === _introspection.TypeKind.LIST) { + var itemRef = typeRef.ofType; + + if (!itemRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + + return (0, _definition.GraphQLList)(getType(itemRef)); + } + + if (typeRef.kind === _introspection.TypeKind.NON_NULL) { + var nullableRef = typeRef.ofType; + + if (!nullableRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + + var nullableType = getType(nullableRef); + return (0, _definition.GraphQLNonNull)((0, _definition.assertNullableType)(nullableType)); + } + + if (!typeRef.name) { + throw new Error('Unknown type reference: ' + (0, _inspect.default)(typeRef)); + } + + return getNamedType(typeRef.name); + } + + function getNamedType(typeName) { + var type = typeMap[typeName]; + + if (!type) { + throw new Error("Invalid or incomplete schema, unknown type: ".concat(typeName, ". Ensure that a full introspection query is used in order to build a client schema.")); + } + + return type; + } + + function getInputType(typeRef) { + var type = getType(typeRef); + !(0, _definition.isInputType)(type) ? (0, _invariant.default)(0, 'Introspection must provide input type for arguments, but received: ' + (0, _inspect.default)(type) + '.') : void 0; + return type; + } + + function getOutputType(typeRef) { + var type = getType(typeRef); + !(0, _definition.isOutputType)(type) ? (0, _invariant.default)(0, 'Introspection must provide output type for fields, but received: ' + (0, _inspect.default)(type) + '.') : void 0; + return type; + } + + function getObjectType(typeRef) { + var type = getType(typeRef); + return (0, _definition.assertObjectType)(type); + } + + function getInterfaceType(typeRef) { + var type = getType(typeRef); + return (0, _definition.assertInterfaceType)(type); + } // Given a type's introspection result, construct the correct + // GraphQLType instance. + + + function buildType(type) { + if (type && type.name && type.kind) { + switch (type.kind) { + case _introspection.TypeKind.SCALAR: + return buildScalarDef(type); + + case _introspection.TypeKind.OBJECT: + return buildObjectDef(type); + + case _introspection.TypeKind.INTERFACE: + return buildInterfaceDef(type); + + case _introspection.TypeKind.UNION: + return buildUnionDef(type); + + case _introspection.TypeKind.ENUM: + return buildEnumDef(type); + + case _introspection.TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + } + } + + throw new Error('Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema:' + (0, _inspect.default)(type)); + } + + function buildScalarDef(scalarIntrospection) { + return new _definition.GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description + }); + } + + function buildObjectDef(objectIntrospection) { + if (!objectIntrospection.interfaces) { + throw new Error('Introspection result missing interfaces: ' + (0, _inspect.default)(objectIntrospection)); + } + + return new _definition.GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: function interfaces() { + return objectIntrospection.interfaces.map(getInterfaceType); + }, + fields: function fields() { + return buildFieldDefMap(objectIntrospection); + } + }); + } + + function buildInterfaceDef(interfaceIntrospection) { + return new _definition.GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + fields: function fields() { + return buildFieldDefMap(interfaceIntrospection); + } + }); + } + + function buildUnionDef(unionIntrospection) { + if (!unionIntrospection.possibleTypes) { + throw new Error('Introspection result missing possibleTypes: ' + (0, _inspect.default)(unionIntrospection)); + } + + return new _definition.GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: function types() { + return unionIntrospection.possibleTypes.map(getObjectType); + } + }); + } + + function buildEnumDef(enumIntrospection) { + if (!enumIntrospection.enumValues) { + throw new Error('Introspection result missing enumValues: ' + (0, _inspect.default)(enumIntrospection)); + } + + return new _definition.GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: (0, _keyValMap.default)(enumIntrospection.enumValues, function (valueIntrospection) { + return valueIntrospection.name; + }, function (valueIntrospection) { + return { + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason + }; + }) + }); + } + + function buildInputObjectDef(inputObjectIntrospection) { + if (!inputObjectIntrospection.inputFields) { + throw new Error('Introspection result missing inputFields: ' + (0, _inspect.default)(inputObjectIntrospection)); + } + + return new _definition.GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: function fields() { + return buildInputValueDefMap(inputObjectIntrospection.inputFields); + } + }); + } + + function buildFieldDefMap(typeIntrospection) { + if (!typeIntrospection.fields) { + throw new Error('Introspection result missing fields: ' + (0, _inspect.default)(typeIntrospection)); + } + + return (0, _keyValMap.default)(typeIntrospection.fields, function (fieldIntrospection) { + return fieldIntrospection.name; + }, function (fieldIntrospection) { + if (!fieldIntrospection.args) { + throw new Error('Introspection result missing field args: ' + (0, _inspect.default)(fieldIntrospection)); + } + + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type: getOutputType(fieldIntrospection.type), + args: buildInputValueDefMap(fieldIntrospection.args) + }; + }); + } + + function buildInputValueDefMap(inputValueIntrospections) { + return (0, _keyValMap.default)(inputValueIntrospections, function (inputValue) { + return inputValue.name; + }, buildInputValue); + } + + function buildInputValue(inputValueIntrospection) { + var type = getInputType(inputValueIntrospection.type); + var defaultValue = inputValueIntrospection.defaultValue ? (0, _valueFromAST.valueFromAST)((0, _parser.parseValue)(inputValueIntrospection.defaultValue), type) : undefined; + return { + description: inputValueIntrospection.description, + type: type, + defaultValue: defaultValue + }; + } + + function buildDirective(directiveIntrospection) { + if (!directiveIntrospection.args) { + throw new Error('Introspection result missing directive args: ' + (0, _inspect.default)(directiveIntrospection)); + } + + if (!directiveIntrospection.locations) { + throw new Error('Introspection result missing directive locations: ' + (0, _inspect.default)(directiveIntrospection)); + } + + return new _directives.GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args) + }); + } +} diff --git a/node_modules/graphql/utilities/buildClientSchema.js.flow b/node_modules/graphql/utilities/buildClientSchema.js.flow new file mode 100644 index 000000000..fb1d23609 --- /dev/null +++ b/node_modules/graphql/utilities/buildClientSchema.js.flow @@ -0,0 +1,383 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyValMap from '../jsutils/keyValMap'; +import isObjectLike from '../jsutils/isObjectLike'; +import { valueFromAST } from './valueFromAST'; +import { parseValue } from '../language/parser'; +import { + type GraphQLSchemaValidationOptions, + GraphQLSchema, +} from '../type/schema'; + +import { + type GraphQLType, + type GraphQLInputType, + type GraphQLOutputType, + type GraphQLNamedType, + isInputType, + isOutputType, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + assertNullableType, + assertObjectType, + assertInterfaceType, +} from '../type/definition'; + +import { GraphQLDirective } from '../type/directives'; + +import { introspectionTypes, TypeKind } from '../type/introspection'; + +import { specifiedScalarTypes } from '../type/scalars'; + +import { + type IntrospectionQuery, + type IntrospectionType, + type IntrospectionScalarType, + type IntrospectionObjectType, + type IntrospectionInterfaceType, + type IntrospectionUnionType, + type IntrospectionEnumType, + type IntrospectionInputObjectType, + type IntrospectionTypeRef, + type IntrospectionInputTypeRef, + type IntrospectionOutputTypeRef, + type IntrospectionNamedTypeRef, +} from './introspectionQuery'; + +type Options = {| + ...GraphQLSchemaValidationOptions, +|}; + +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + */ +export function buildClientSchema( + introspection: IntrospectionQuery, + options?: Options, +): GraphQLSchema { + invariant( + isObjectLike(introspection) && isObjectLike(introspection.__schema), + 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' + + inspect(introspection), + ); + + // Get the schema from the introspection result. + const schemaIntrospection = introspection.__schema; + + // Iterate through all types, getting the type definition for each. + const typeMap = keyValMap( + schemaIntrospection.types, + typeIntrospection => typeIntrospection.name, + typeIntrospection => buildType(typeIntrospection), + ); + + for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) { + if (typeMap[stdType.name]) { + typeMap[stdType.name] = stdType; + } + } + + // Get the root Query, Mutation, and Subscription types. + const queryType = schemaIntrospection.queryType + ? getObjectType(schemaIntrospection.queryType) + : null; + + const mutationType = schemaIntrospection.mutationType + ? getObjectType(schemaIntrospection.mutationType) + : null; + + const subscriptionType = schemaIntrospection.subscriptionType + ? getObjectType(schemaIntrospection.subscriptionType) + : null; + + // Get the directives supported by Introspection, assuming empty-set if + // directives were not queried for. + const directives = schemaIntrospection.directives + ? schemaIntrospection.directives.map(buildDirective) + : []; + + // Then produce and return a Schema with these types. + return new GraphQLSchema({ + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: objectValues(typeMap), + directives, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames, + }); + + // Given a type reference in introspection, return the GraphQLType instance. + // preferring cached instances before building new instances. + function getType(typeRef: IntrospectionTypeRef): GraphQLType { + if (typeRef.kind === TypeKind.LIST) { + const itemRef = typeRef.ofType; + if (!itemRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + return GraphQLList(getType(itemRef)); + } + if (typeRef.kind === TypeKind.NON_NULL) { + const nullableRef = typeRef.ofType; + if (!nullableRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + const nullableType = getType(nullableRef); + return GraphQLNonNull(assertNullableType(nullableType)); + } + if (!typeRef.name) { + throw new Error('Unknown type reference: ' + inspect(typeRef)); + } + return getNamedType(typeRef.name); + } + + function getNamedType(typeName: string): GraphQLNamedType { + const type = typeMap[typeName]; + if (!type) { + throw new Error( + `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`, + ); + } + + return type; + } + + function getInputType(typeRef: IntrospectionInputTypeRef): GraphQLInputType { + const type = getType(typeRef); + invariant( + isInputType(type), + 'Introspection must provide input type for arguments, but received: ' + + inspect(type) + + '.', + ); + return type; + } + + function getOutputType( + typeRef: IntrospectionOutputTypeRef, + ): GraphQLOutputType { + const type = getType(typeRef); + invariant( + isOutputType(type), + 'Introspection must provide output type for fields, but received: ' + + inspect(type) + + '.', + ); + return type; + } + + function getObjectType( + typeRef: IntrospectionNamedTypeRef, + ): GraphQLObjectType { + const type = getType(typeRef); + return assertObjectType(type); + } + + function getInterfaceType( + typeRef: IntrospectionTypeRef, + ): GraphQLInterfaceType { + const type = getType(typeRef); + return assertInterfaceType(type); + } + + // Given a type's introspection result, construct the correct + // GraphQLType instance. + function buildType(type: IntrospectionType): GraphQLNamedType { + if (type && type.name && type.kind) { + switch (type.kind) { + case TypeKind.SCALAR: + return buildScalarDef(type); + case TypeKind.OBJECT: + return buildObjectDef(type); + case TypeKind.INTERFACE: + return buildInterfaceDef(type); + case TypeKind.UNION: + return buildUnionDef(type); + case TypeKind.ENUM: + return buildEnumDef(type); + case TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + } + } + throw new Error( + 'Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema:' + + inspect(type), + ); + } + + function buildScalarDef( + scalarIntrospection: IntrospectionScalarType, + ): GraphQLScalarType { + return new GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description, + }); + } + + function buildObjectDef( + objectIntrospection: IntrospectionObjectType, + ): GraphQLObjectType { + if (!objectIntrospection.interfaces) { + throw new Error( + 'Introspection result missing interfaces: ' + + inspect(objectIntrospection), + ); + } + return new GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: () => objectIntrospection.interfaces.map(getInterfaceType), + fields: () => buildFieldDefMap(objectIntrospection), + }); + } + + function buildInterfaceDef( + interfaceIntrospection: IntrospectionInterfaceType, + ): GraphQLInterfaceType { + return new GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + fields: () => buildFieldDefMap(interfaceIntrospection), + }); + } + + function buildUnionDef( + unionIntrospection: IntrospectionUnionType, + ): GraphQLUnionType { + if (!unionIntrospection.possibleTypes) { + throw new Error( + 'Introspection result missing possibleTypes: ' + + inspect(unionIntrospection), + ); + } + return new GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: () => unionIntrospection.possibleTypes.map(getObjectType), + }); + } + + function buildEnumDef( + enumIntrospection: IntrospectionEnumType, + ): GraphQLEnumType { + if (!enumIntrospection.enumValues) { + throw new Error( + 'Introspection result missing enumValues: ' + + inspect(enumIntrospection), + ); + } + return new GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: keyValMap( + enumIntrospection.enumValues, + valueIntrospection => valueIntrospection.name, + valueIntrospection => ({ + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason, + }), + ), + }); + } + + function buildInputObjectDef( + inputObjectIntrospection: IntrospectionInputObjectType, + ): GraphQLInputObjectType { + if (!inputObjectIntrospection.inputFields) { + throw new Error( + 'Introspection result missing inputFields: ' + + inspect(inputObjectIntrospection), + ); + } + return new GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), + }); + } + + function buildFieldDefMap(typeIntrospection) { + if (!typeIntrospection.fields) { + throw new Error( + 'Introspection result missing fields: ' + inspect(typeIntrospection), + ); + } + return keyValMap( + typeIntrospection.fields, + fieldIntrospection => fieldIntrospection.name, + fieldIntrospection => { + if (!fieldIntrospection.args) { + throw new Error( + 'Introspection result missing field args: ' + + inspect(fieldIntrospection), + ); + } + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type: getOutputType(fieldIntrospection.type), + args: buildInputValueDefMap(fieldIntrospection.args), + }; + }, + ); + } + + function buildInputValueDefMap(inputValueIntrospections) { + return keyValMap( + inputValueIntrospections, + inputValue => inputValue.name, + buildInputValue, + ); + } + + function buildInputValue(inputValueIntrospection) { + const type = getInputType(inputValueIntrospection.type); + const defaultValue = inputValueIntrospection.defaultValue + ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) + : undefined; + return { + description: inputValueIntrospection.description, + type, + defaultValue, + }; + } + + function buildDirective(directiveIntrospection) { + if (!directiveIntrospection.args) { + throw new Error( + 'Introspection result missing directive args: ' + + inspect(directiveIntrospection), + ); + } + if (!directiveIntrospection.locations) { + throw new Error( + 'Introspection result missing directive locations: ' + + inspect(directiveIntrospection), + ); + } + return new GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args), + }); + } +} diff --git a/node_modules/graphql/utilities/buildClientSchema.mjs b/node_modules/graphql/utilities/buildClientSchema.mjs new file mode 100644 index 000000000..c427d7dbf --- /dev/null +++ b/node_modules/graphql/utilities/buildClientSchema.mjs @@ -0,0 +1,287 @@ +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import keyValMap from '../jsutils/keyValMap'; +import isObjectLike from '../jsutils/isObjectLike'; +import { valueFromAST } from './valueFromAST'; +import { parseValue } from '../language/parser'; +import { GraphQLSchema } from '../type/schema'; +import { isInputType, isOutputType, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, assertNullableType, assertObjectType, assertInterfaceType } from '../type/definition'; +import { GraphQLDirective } from '../type/directives'; +import { introspectionTypes, TypeKind } from '../type/introspection'; +import { specifiedScalarTypes } from '../type/scalars'; + +/** + * Build a GraphQLSchema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a GraphQLSchema instance which can be then used with all graphql-js + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + */ +export function buildClientSchema(introspection, options) { + !(isObjectLike(introspection) && isObjectLike(introspection.__schema)) ? invariant(0, 'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' + inspect(introspection)) : void 0; // Get the schema from the introspection result. + + var schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each. + + var typeMap = keyValMap(schemaIntrospection.types, function (typeIntrospection) { + return typeIntrospection.name; + }, function (typeIntrospection) { + return buildType(typeIntrospection); + }); + + for (var _i = 0, _arr = [].concat(specifiedScalarTypes, introspectionTypes); _i < _arr.length; _i++) { + var stdType = _arr[_i]; + + if (typeMap[stdType.name]) { + typeMap[stdType.name] = stdType; + } + } // Get the root Query, Mutation, and Subscription types. + + + var queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; + var mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; + var subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; // Get the directives supported by Introspection, assuming empty-set if + // directives were not queried for. + + var directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; // Then produce and return a Schema with these types. + + return new GraphQLSchema({ + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + types: objectValues(typeMap), + directives: directives, + assumeValid: options && options.assumeValid, + allowedLegacyNames: options && options.allowedLegacyNames + }); // Given a type reference in introspection, return the GraphQLType instance. + // preferring cached instances before building new instances. + + function getType(typeRef) { + if (typeRef.kind === TypeKind.LIST) { + var itemRef = typeRef.ofType; + + if (!itemRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + + return GraphQLList(getType(itemRef)); + } + + if (typeRef.kind === TypeKind.NON_NULL) { + var nullableRef = typeRef.ofType; + + if (!nullableRef) { + throw new Error('Decorated type deeper than introspection query.'); + } + + var nullableType = getType(nullableRef); + return GraphQLNonNull(assertNullableType(nullableType)); + } + + if (!typeRef.name) { + throw new Error('Unknown type reference: ' + inspect(typeRef)); + } + + return getNamedType(typeRef.name); + } + + function getNamedType(typeName) { + var type = typeMap[typeName]; + + if (!type) { + throw new Error("Invalid or incomplete schema, unknown type: ".concat(typeName, ". Ensure that a full introspection query is used in order to build a client schema.")); + } + + return type; + } + + function getInputType(typeRef) { + var type = getType(typeRef); + !isInputType(type) ? invariant(0, 'Introspection must provide input type for arguments, but received: ' + inspect(type) + '.') : void 0; + return type; + } + + function getOutputType(typeRef) { + var type = getType(typeRef); + !isOutputType(type) ? invariant(0, 'Introspection must provide output type for fields, but received: ' + inspect(type) + '.') : void 0; + return type; + } + + function getObjectType(typeRef) { + var type = getType(typeRef); + return assertObjectType(type); + } + + function getInterfaceType(typeRef) { + var type = getType(typeRef); + return assertInterfaceType(type); + } // Given a type's introspection result, construct the correct + // GraphQLType instance. + + + function buildType(type) { + if (type && type.name && type.kind) { + switch (type.kind) { + case TypeKind.SCALAR: + return buildScalarDef(type); + + case TypeKind.OBJECT: + return buildObjectDef(type); + + case TypeKind.INTERFACE: + return buildInterfaceDef(type); + + case TypeKind.UNION: + return buildUnionDef(type); + + case TypeKind.ENUM: + return buildEnumDef(type); + + case TypeKind.INPUT_OBJECT: + return buildInputObjectDef(type); + } + } + + throw new Error('Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema:' + inspect(type)); + } + + function buildScalarDef(scalarIntrospection) { + return new GraphQLScalarType({ + name: scalarIntrospection.name, + description: scalarIntrospection.description + }); + } + + function buildObjectDef(objectIntrospection) { + if (!objectIntrospection.interfaces) { + throw new Error('Introspection result missing interfaces: ' + inspect(objectIntrospection)); + } + + return new GraphQLObjectType({ + name: objectIntrospection.name, + description: objectIntrospection.description, + interfaces: function interfaces() { + return objectIntrospection.interfaces.map(getInterfaceType); + }, + fields: function fields() { + return buildFieldDefMap(objectIntrospection); + } + }); + } + + function buildInterfaceDef(interfaceIntrospection) { + return new GraphQLInterfaceType({ + name: interfaceIntrospection.name, + description: interfaceIntrospection.description, + fields: function fields() { + return buildFieldDefMap(interfaceIntrospection); + } + }); + } + + function buildUnionDef(unionIntrospection) { + if (!unionIntrospection.possibleTypes) { + throw new Error('Introspection result missing possibleTypes: ' + inspect(unionIntrospection)); + } + + return new GraphQLUnionType({ + name: unionIntrospection.name, + description: unionIntrospection.description, + types: function types() { + return unionIntrospection.possibleTypes.map(getObjectType); + } + }); + } + + function buildEnumDef(enumIntrospection) { + if (!enumIntrospection.enumValues) { + throw new Error('Introspection result missing enumValues: ' + inspect(enumIntrospection)); + } + + return new GraphQLEnumType({ + name: enumIntrospection.name, + description: enumIntrospection.description, + values: keyValMap(enumIntrospection.enumValues, function (valueIntrospection) { + return valueIntrospection.name; + }, function (valueIntrospection) { + return { + description: valueIntrospection.description, + deprecationReason: valueIntrospection.deprecationReason + }; + }) + }); + } + + function buildInputObjectDef(inputObjectIntrospection) { + if (!inputObjectIntrospection.inputFields) { + throw new Error('Introspection result missing inputFields: ' + inspect(inputObjectIntrospection)); + } + + return new GraphQLInputObjectType({ + name: inputObjectIntrospection.name, + description: inputObjectIntrospection.description, + fields: function fields() { + return buildInputValueDefMap(inputObjectIntrospection.inputFields); + } + }); + } + + function buildFieldDefMap(typeIntrospection) { + if (!typeIntrospection.fields) { + throw new Error('Introspection result missing fields: ' + inspect(typeIntrospection)); + } + + return keyValMap(typeIntrospection.fields, function (fieldIntrospection) { + return fieldIntrospection.name; + }, function (fieldIntrospection) { + if (!fieldIntrospection.args) { + throw new Error('Introspection result missing field args: ' + inspect(fieldIntrospection)); + } + + return { + description: fieldIntrospection.description, + deprecationReason: fieldIntrospection.deprecationReason, + type: getOutputType(fieldIntrospection.type), + args: buildInputValueDefMap(fieldIntrospection.args) + }; + }); + } + + function buildInputValueDefMap(inputValueIntrospections) { + return keyValMap(inputValueIntrospections, function (inputValue) { + return inputValue.name; + }, buildInputValue); + } + + function buildInputValue(inputValueIntrospection) { + var type = getInputType(inputValueIntrospection.type); + var defaultValue = inputValueIntrospection.defaultValue ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) : undefined; + return { + description: inputValueIntrospection.description, + type: type, + defaultValue: defaultValue + }; + } + + function buildDirective(directiveIntrospection) { + if (!directiveIntrospection.args) { + throw new Error('Introspection result missing directive args: ' + inspect(directiveIntrospection)); + } + + if (!directiveIntrospection.locations) { + throw new Error('Introspection result missing directive locations: ' + inspect(directiveIntrospection)); + } + + return new GraphQLDirective({ + name: directiveIntrospection.name, + description: directiveIntrospection.description, + locations: directiveIntrospection.locations.slice(), + args: buildInputValueDefMap(directiveIntrospection.args) + }); + } +} diff --git a/node_modules/graphql/utilities/coerceValue.js b/node_modules/graphql/utilities/coerceValue.js new file mode 100644 index 000000000..ac767a4a6 --- /dev/null +++ b/node_modules/graphql/utilities/coerceValue.js @@ -0,0 +1,224 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.coerceValue = coerceValue; + +var _iterall = require("iterall"); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _isInvalid = _interopRequireDefault(require("../jsutils/isInvalid")); + +var _didYouMean = _interopRequireDefault(require("../jsutils/didYouMean")); + +var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike")); + +var _suggestionList = _interopRequireDefault(require("../jsutils/suggestionList")); + +var _GraphQLError = require("../error/GraphQLError"); + +var _definition = require("../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +function coerceValue(value, type, blameNode, path) { + // A value must be provided if the type is non-null. + if ((0, _definition.isNonNullType)(type)) { + if (value == null) { + return ofErrors([coercionError("Expected non-nullable type ".concat((0, _inspect.default)(type), " not to be null"), blameNode, path)]); + } + + return coerceValue(value, type.ofType, blameNode, path); + } + + if (value == null) { + // Explicitly return the value null. + return ofValue(null); + } + + if ((0, _definition.isScalarType)(type)) { + // Scalars determine if a value is valid via parseValue(), which can + // throw to indicate failure. If it throws, maintain a reference to + // the original error. + try { + var parseResult = type.parseValue(value); + + if ((0, _isInvalid.default)(parseResult)) { + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path)]); + } + + return ofValue(parseResult); + } catch (error) { + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path, ' ' + error.message, error)]); + } + } + + if ((0, _definition.isEnumType)(type)) { + if (typeof value === 'string') { + var enumValue = type.getValue(value); + + if (enumValue) { + return ofValue(enumValue.value); + } + } + + var suggestions = (0, _suggestionList.default)(String(value), type.getValues().map(function (enumValue) { + return enumValue.name; + })); + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path, (0, _didYouMean.default)(suggestions))]); + } + + if ((0, _definition.isListType)(type)) { + var itemType = type.ofType; + + if ((0, _iterall.isCollection)(value)) { + var errors; + var coercedValue = []; + (0, _iterall.forEach)(value, function (itemValue, index) { + var coercedItem = coerceValue(itemValue, itemType, blameNode, atPath(path, index)); + + if (coercedItem.errors) { + errors = add(errors, coercedItem.errors); + } else if (!errors) { + coercedValue.push(coercedItem.value); + } + }); + return errors ? ofErrors(errors) : ofValue(coercedValue); + } // Lists accept a non-list value as a list of one. + + + var coercedItem = coerceValue(value, itemType, blameNode); + return coercedItem.errors ? coercedItem : ofValue([coercedItem.value]); + } + + if ((0, _definition.isInputObjectType)(type)) { + if (!(0, _isObjectLike.default)(value)) { + return ofErrors([coercionError("Expected type ".concat(type.name, " to be an object"), blameNode, path)]); + } + + var _errors; + + var _coercedValue = {}; + var fields = type.getFields(); // Ensure every defined field is valid. + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectValues.default)(fields)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var field = _step.value; + var fieldValue = value[field.name]; + + if ((0, _isInvalid.default)(fieldValue)) { + if (!(0, _isInvalid.default)(field.defaultValue)) { + _coercedValue[field.name] = field.defaultValue; + } else if ((0, _definition.isNonNullType)(field.type)) { + _errors = add(_errors, coercionError("Field ".concat(printPath(atPath(path, field.name)), " of required ") + "type ".concat((0, _inspect.default)(field.type), " was not provided"), blameNode)); + } + } else { + var coercedField = coerceValue(fieldValue, field.type, blameNode, atPath(path, field.name)); + + if (coercedField.errors) { + _errors = add(_errors, coercedField.errors); + } else if (!_errors) { + _coercedValue[field.name] = coercedField.value; + } + } + } // Ensure every provided field is defined. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) { + var fieldName = _Object$keys[_i]; + + if (!fields[fieldName]) { + var _suggestions = (0, _suggestionList.default)(fieldName, Object.keys(fields)); + + _errors = add(_errors, coercionError("Field \"".concat(fieldName, "\" is not defined by type ").concat(type.name), blameNode, path, (0, _didYouMean.default)(_suggestions))); + } + } + + return _errors ? ofErrors(_errors) : ofValue(_coercedValue); + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat((0, _inspect.default)(type), "\".")); +} + +function ofValue(value) { + return { + errors: undefined, + value: value + }; +} + +function ofErrors(errors) { + return { + errors: errors, + value: undefined + }; +} + +function add(errors, moreErrors) { + return (errors || []).concat(moreErrors); +} + +function atPath(prev, key) { + return { + prev: prev, + key: key + }; +} + +function coercionError(message, blameNode, path, subMessage, originalError) { + var pathStr = printPath(path); + var fullMessage = message; + + if (pathStr) { + fullMessage += ' at ' + pathStr; + } + + fullMessage += subMessage ? '.' + subMessage : '.'; // Return a GraphQLError instance + + return new _GraphQLError.GraphQLError(fullMessage, blameNode, undefined, undefined, undefined, originalError); +} // Build a string describing the path into the value where the error was found + + +function printPath(path) { + var pathStr = ''; + var currentPath = path; + + while (currentPath) { + pathStr = (typeof currentPath.key === 'string' ? '.' + currentPath.key : '[' + String(currentPath.key) + ']') + pathStr; + currentPath = currentPath.prev; + } + + return pathStr ? 'value' + pathStr : ''; +} diff --git a/node_modules/graphql/utilities/coerceValue.js.flow b/node_modules/graphql/utilities/coerceValue.js.flow new file mode 100644 index 000000000..b42514731 --- /dev/null +++ b/node_modules/graphql/utilities/coerceValue.js.flow @@ -0,0 +1,248 @@ +// @flow strict + +import { forEach, isCollection } from 'iterall'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import isInvalid from '../jsutils/isInvalid'; +import didYouMean from '../jsutils/didYouMean'; +import isObjectLike from '../jsutils/isObjectLike'; +import suggestionList from '../jsutils/suggestionList'; +import { GraphQLError } from '../error/GraphQLError'; +import { type ASTNode } from '../language/ast'; +import { + type GraphQLInputType, + isScalarType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, +} from '../type/definition'; + +type CoercedValue = {| + +errors: $ReadOnlyArray | void, + +value: mixed, +|}; + +type Path = {| +prev: Path | void, +key: string | number |}; + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +export function coerceValue( + value: mixed, + type: GraphQLInputType, + blameNode?: ASTNode, + path?: Path, +): CoercedValue { + // A value must be provided if the type is non-null. + if (isNonNullType(type)) { + if (value == null) { + return ofErrors([ + coercionError( + `Expected non-nullable type ${inspect(type)} not to be null`, + blameNode, + path, + ), + ]); + } + return coerceValue(value, type.ofType, blameNode, path); + } + + if (value == null) { + // Explicitly return the value null. + return ofValue(null); + } + + if (isScalarType(type)) { + // Scalars determine if a value is valid via parseValue(), which can + // throw to indicate failure. If it throws, maintain a reference to + // the original error. + try { + const parseResult = type.parseValue(value); + if (isInvalid(parseResult)) { + return ofErrors([ + coercionError(`Expected type ${type.name}`, blameNode, path), + ]); + } + return ofValue(parseResult); + } catch (error) { + return ofErrors([ + coercionError( + `Expected type ${type.name}`, + blameNode, + path, + ' ' + error.message, + error, + ), + ]); + } + } + + if (isEnumType(type)) { + if (typeof value === 'string') { + const enumValue = type.getValue(value); + if (enumValue) { + return ofValue(enumValue.value); + } + } + const suggestions = suggestionList( + String(value), + type.getValues().map(enumValue => enumValue.name), + ); + return ofErrors([ + coercionError( + `Expected type ${type.name}`, + blameNode, + path, + didYouMean(suggestions), + ), + ]); + } + + if (isListType(type)) { + const itemType = type.ofType; + if (isCollection(value)) { + let errors; + const coercedValue = []; + forEach((value: any), (itemValue, index) => { + const coercedItem = coerceValue( + itemValue, + itemType, + blameNode, + atPath(path, index), + ); + if (coercedItem.errors) { + errors = add(errors, coercedItem.errors); + } else if (!errors) { + coercedValue.push(coercedItem.value); + } + }); + return errors ? ofErrors(errors) : ofValue(coercedValue); + } + // Lists accept a non-list value as a list of one. + const coercedItem = coerceValue(value, itemType, blameNode); + return coercedItem.errors ? coercedItem : ofValue([coercedItem.value]); + } + + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return ofErrors([ + coercionError( + `Expected type ${type.name} to be an object`, + blameNode, + path, + ), + ]); + } + let errors; + const coercedValue = {}; + const fields = type.getFields(); + + // Ensure every defined field is valid. + for (const field of objectValues(fields)) { + const fieldValue = value[field.name]; + if (isInvalid(fieldValue)) { + if (!isInvalid(field.defaultValue)) { + coercedValue[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + errors = add( + errors, + coercionError( + `Field ${printPath(atPath(path, field.name))} of required ` + + `type ${inspect(field.type)} was not provided`, + blameNode, + ), + ); + } + } else { + const coercedField = coerceValue( + fieldValue, + field.type, + blameNode, + atPath(path, field.name), + ); + if (coercedField.errors) { + errors = add(errors, coercedField.errors); + } else if (!errors) { + coercedValue[field.name] = coercedField.value; + } + } + } + + // Ensure every provided field is defined. + for (const fieldName of Object.keys(value)) { + if (!fields[fieldName]) { + const suggestions = suggestionList(fieldName, Object.keys(fields)); + errors = add( + errors, + coercionError( + `Field "${fieldName}" is not defined by type ${type.name}`, + blameNode, + path, + didYouMean(suggestions), + ), + ); + } + } + + return errors ? ofErrors(errors) : ofValue(coercedValue); + } + + // Not reachable. All possible input types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected input type: "${inspect((type: empty))}".`); +} + +function ofValue(value) { + return { errors: undefined, value }; +} + +function ofErrors(errors) { + return { errors, value: undefined }; +} + +function add(errors, moreErrors) { + return (errors || []).concat(moreErrors); +} + +function atPath(prev, key) { + return { prev, key }; +} + +function coercionError(message, blameNode, path, subMessage, originalError) { + const pathStr = printPath(path); + let fullMessage = message; + + if (pathStr) { + fullMessage += ' at ' + pathStr; + } + fullMessage += subMessage ? '.' + subMessage : '.'; + + // Return a GraphQLError instance + return new GraphQLError( + fullMessage, + blameNode, + undefined, + undefined, + undefined, + originalError, + ); +} + +// Build a string describing the path into the value where the error was found +function printPath(path) { + let pathStr = ''; + let currentPath = path; + while (currentPath) { + pathStr = + (typeof currentPath.key === 'string' + ? '.' + currentPath.key + : '[' + String(currentPath.key) + ']') + pathStr; + currentPath = currentPath.prev; + } + return pathStr ? 'value' + pathStr : ''; +} diff --git a/node_modules/graphql/utilities/coerceValue.mjs b/node_modules/graphql/utilities/coerceValue.mjs new file mode 100644 index 000000000..d9d3313c6 --- /dev/null +++ b/node_modules/graphql/utilities/coerceValue.mjs @@ -0,0 +1,207 @@ +import { forEach, isCollection } from 'iterall'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import isInvalid from '../jsutils/isInvalid'; +import didYouMean from '../jsutils/didYouMean'; +import isObjectLike from '../jsutils/isObjectLike'; +import suggestionList from '../jsutils/suggestionList'; +import { GraphQLError } from '../error/GraphQLError'; +import { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType } from '../type/definition'; + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +export function coerceValue(value, type, blameNode, path) { + // A value must be provided if the type is non-null. + if (isNonNullType(type)) { + if (value == null) { + return ofErrors([coercionError("Expected non-nullable type ".concat(inspect(type), " not to be null"), blameNode, path)]); + } + + return coerceValue(value, type.ofType, blameNode, path); + } + + if (value == null) { + // Explicitly return the value null. + return ofValue(null); + } + + if (isScalarType(type)) { + // Scalars determine if a value is valid via parseValue(), which can + // throw to indicate failure. If it throws, maintain a reference to + // the original error. + try { + var parseResult = type.parseValue(value); + + if (isInvalid(parseResult)) { + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path)]); + } + + return ofValue(parseResult); + } catch (error) { + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path, ' ' + error.message, error)]); + } + } + + if (isEnumType(type)) { + if (typeof value === 'string') { + var enumValue = type.getValue(value); + + if (enumValue) { + return ofValue(enumValue.value); + } + } + + var suggestions = suggestionList(String(value), type.getValues().map(function (enumValue) { + return enumValue.name; + })); + return ofErrors([coercionError("Expected type ".concat(type.name), blameNode, path, didYouMean(suggestions))]); + } + + if (isListType(type)) { + var itemType = type.ofType; + + if (isCollection(value)) { + var errors; + var coercedValue = []; + forEach(value, function (itemValue, index) { + var coercedItem = coerceValue(itemValue, itemType, blameNode, atPath(path, index)); + + if (coercedItem.errors) { + errors = add(errors, coercedItem.errors); + } else if (!errors) { + coercedValue.push(coercedItem.value); + } + }); + return errors ? ofErrors(errors) : ofValue(coercedValue); + } // Lists accept a non-list value as a list of one. + + + var coercedItem = coerceValue(value, itemType, blameNode); + return coercedItem.errors ? coercedItem : ofValue([coercedItem.value]); + } + + if (isInputObjectType(type)) { + if (!isObjectLike(value)) { + return ofErrors([coercionError("Expected type ".concat(type.name, " to be an object"), blameNode, path)]); + } + + var _errors; + + var _coercedValue = {}; + var fields = type.getFields(); // Ensure every defined field is valid. + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectValues(fields)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var field = _step.value; + var fieldValue = value[field.name]; + + if (isInvalid(fieldValue)) { + if (!isInvalid(field.defaultValue)) { + _coercedValue[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + _errors = add(_errors, coercionError("Field ".concat(printPath(atPath(path, field.name)), " of required ") + "type ".concat(inspect(field.type), " was not provided"), blameNode)); + } + } else { + var coercedField = coerceValue(fieldValue, field.type, blameNode, atPath(path, field.name)); + + if (coercedField.errors) { + _errors = add(_errors, coercedField.errors); + } else if (!_errors) { + _coercedValue[field.name] = coercedField.value; + } + } + } // Ensure every provided field is defined. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) { + var fieldName = _Object$keys[_i]; + + if (!fields[fieldName]) { + var _suggestions = suggestionList(fieldName, Object.keys(fields)); + + _errors = add(_errors, coercionError("Field \"".concat(fieldName, "\" is not defined by type ").concat(type.name), blameNode, path, didYouMean(_suggestions))); + } + } + + return _errors ? ofErrors(_errors) : ofValue(_coercedValue); + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat(inspect(type), "\".")); +} + +function ofValue(value) { + return { + errors: undefined, + value: value + }; +} + +function ofErrors(errors) { + return { + errors: errors, + value: undefined + }; +} + +function add(errors, moreErrors) { + return (errors || []).concat(moreErrors); +} + +function atPath(prev, key) { + return { + prev: prev, + key: key + }; +} + +function coercionError(message, blameNode, path, subMessage, originalError) { + var pathStr = printPath(path); + var fullMessage = message; + + if (pathStr) { + fullMessage += ' at ' + pathStr; + } + + fullMessage += subMessage ? '.' + subMessage : '.'; // Return a GraphQLError instance + + return new GraphQLError(fullMessage, blameNode, undefined, undefined, undefined, originalError); +} // Build a string describing the path into the value where the error was found + + +function printPath(path) { + var pathStr = ''; + var currentPath = path; + + while (currentPath) { + pathStr = (typeof currentPath.key === 'string' ? '.' + currentPath.key : '[' + String(currentPath.key) + ']') + pathStr; + currentPath = currentPath.prev; + } + + return pathStr ? 'value' + pathStr : ''; +} diff --git a/node_modules/graphql/utilities/concatAST.js b/node_modules/graphql/utilities/concatAST.js new file mode 100644 index 000000000..e65705222 --- /dev/null +++ b/node_modules/graphql/utilities/concatAST.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.concatAST = concatAST; + +var _flatMap = _interopRequireDefault(require("../polyfills/flatMap")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + */ +function concatAST(asts) { + return { + kind: 'Document', + definitions: (0, _flatMap.default)(asts, function (ast) { + return ast.definitions; + }) + }; +} diff --git a/node_modules/graphql/utilities/concatAST.js.flow b/node_modules/graphql/utilities/concatAST.js.flow new file mode 100644 index 000000000..bc9904eed --- /dev/null +++ b/node_modules/graphql/utilities/concatAST.js.flow @@ -0,0 +1,16 @@ +// @flow strict + +import flatMap from '../polyfills/flatMap'; +import { type DocumentNode } from '../language/ast'; + +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + */ +export function concatAST(asts: $ReadOnlyArray): DocumentNode { + return { + kind: 'Document', + definitions: flatMap(asts, ast => ast.definitions), + }; +} diff --git a/node_modules/graphql/utilities/concatAST.mjs b/node_modules/graphql/utilities/concatAST.mjs new file mode 100644 index 000000000..0a427fc8e --- /dev/null +++ b/node_modules/graphql/utilities/concatAST.mjs @@ -0,0 +1,15 @@ +import flatMap from '../polyfills/flatMap'; + +/** + * Provided a collection of ASTs, presumably each from different files, + * concatenate the ASTs together into batched AST, useful for validating many + * GraphQL source files which together represent one conceptual application. + */ +export function concatAST(asts) { + return { + kind: 'Document', + definitions: flatMap(asts, function (ast) { + return ast.definitions; + }) + }; +} diff --git a/node_modules/graphql/utilities/extendSchema.js b/node_modules/graphql/utilities/extendSchema.js new file mode 100644 index 000000000..22480d56d --- /dev/null +++ b/node_modules/graphql/utilities/extendSchema.js @@ -0,0 +1,418 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.extendSchema = extendSchema; + +var _flatMap = _interopRequireDefault(require("../polyfills/flatMap")); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _mapValue = _interopRequireDefault(require("../jsutils/mapValue")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _buildASTSchema = require("./buildASTSchema"); + +var _validate = require("../validation/validate"); + +var _schema = require("../type/schema"); + +var _introspection = require("../type/introspection"); + +var _scalars = require("../type/scalars"); + +var _definition = require("../type/definition"); + +var _directives = require("../type/directives"); + +var _kinds = require("../language/kinds"); + +var _predicates = require("../language/predicates"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +function extendSchema(schema, documentAST, options) { + (0, _schema.assertSchema)(schema); + !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0; + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + (0, _validate.assertValidSDLExtension)(documentAST, schema); + } // Collect the type definitions and extensions found in the document. + + + var typeDefs = []; + var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can + // have the same name. For example, a type named "skip". + + var directiveDefs = []; + var schemaDef; // Schema extensions are collected which may add additional operation types. + + var schemaExts = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) { + schemaExts.push(def); + } else if ((0, _predicates.isTypeDefinitionNode)(def)) { + typeDefs.push(def); + } else if ((0, _predicates.isTypeExtensionNode)(def)) { + var extendedTypeName = def.name.value; + var existingTypeExts = typeExtsMap[extendedTypeName]; + typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def]; + } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } // If this document contains no new types, extensions, or directives then + // return the same unmodified GraphQLSchema instance. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) { + return schema; + } + + var schemaConfig = schema.toConfig(); + var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(options, function (typeName) { + var type = typeMap[typeName]; + !type ? (0, _invariant.default)(0, "Unknown type: \"".concat(typeName, "\".")) : void 0; + return type; + }); + var typeMap = (0, _keyValMap.default)(typeDefs, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildType(node); + }); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = schemaConfig.types[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var existingType = _step2.value; + typeMap[existingType.name] = extendNamedType(existingType); + } // Get the extended root operation types. + + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var operationTypes = { + query: schemaConfig.query && schemaConfig.query.name, + mutation: schemaConfig.mutation && schemaConfig.mutation.name, + subscription: schemaConfig.subscription && schemaConfig.subscription.name + }; + + if (schemaDef) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = schemaDef.operationTypes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _ref2 = _step3.value; + var operation = _ref2.operation; + var type = _ref2.type; + operationTypes[operation] = type.name.value; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } // Then, incorporate schema definition and all schema extensions. + + + for (var _i = 0, _schemaExts = schemaExts; _i < _schemaExts.length; _i++) { + var schemaExt = _schemaExts[_i]; + + if (schemaExt.operationTypes) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = schemaExt.operationTypes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _ref4 = _step4.value; + var _operation = _ref4.operation; + var _type = _ref4.type; + operationTypes[_operation] = _type.name.value; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } + } // Support both original legacy names and extended legacy names. + + + var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types. + + return new _schema.GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: getMaybeTypeByName(operationTypes.query), + mutation: getMaybeTypeByName(operationTypes.mutation), + subscription: getMaybeTypeByName(operationTypes.subscription), + types: (0, _objectValues.default)(typeMap), + directives: getMergedDirectives(), + astNode: schemaDef || schemaConfig.astNode, + extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts), + allowedLegacyNames: allowedLegacyNames + }); // Below are functions used for producing this schema that have closed over + // this scope and have access to the schema, cache, and newly defined types. + + function replaceType(type) { + if ((0, _definition.isListType)(type)) { + return new _definition.GraphQLList(replaceType(type.ofType)); + } else if ((0, _definition.isNonNullType)(type)) { + return new _definition.GraphQLNonNull(replaceType(type.ofType)); + } + + return replaceNamedType(type); + } + + function replaceNamedType(type) { + return typeMap[type.name]; + } + + function getMaybeTypeByName(typeName) { + return typeName ? typeMap[typeName] : null; + } + + function getMergedDirectives() { + var existingDirectives = schema.getDirectives().map(extendDirective); + !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0; + return existingDirectives.concat(directiveDefs.map(function (node) { + return astBuilder.buildDirective(node); + })); + } + + function extendNamedType(type) { + if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) { + // Builtin types are not extended. + return type; + } else if ((0, _definition.isScalarType)(type)) { + return extendScalarType(type); + } else if ((0, _definition.isObjectType)(type)) { + return extendObjectType(type); + } else if ((0, _definition.isInterfaceType)(type)) { + return extendInterfaceType(type); + } else if ((0, _definition.isUnionType)(type)) { + return extendUnionType(type); + } else if ((0, _definition.isEnumType)(type)) { + return extendEnumType(type); + } else if ((0, _definition.isInputObjectType)(type)) { + return extendInputObjectType(type); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); + } + + function extendDirective(directive) { + var config = directive.toConfig(); + return new _directives.GraphQLDirective(_objectSpread({}, config, { + args: (0, _mapValue.default)(config.args, extendArg) + })); + } + + function extendInputObjectType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var fieldNodes = (0, _flatMap.default)(extensions, function (node) { + return node.fields || []; + }); + return new _definition.GraphQLInputObjectType(_objectSpread({}, config, { + fields: function fields() { + return _objectSpread({}, (0, _mapValue.default)(config.fields, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type) + }); + }), (0, _keyValMap.default)(fieldNodes, function (field) { + return field.name.value; + }, function (field) { + return astBuilder.buildInputField(field); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendEnumType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[type.name] || []; + var valueNodes = (0, _flatMap.default)(extensions, function (node) { + return node.values || []; + }); + return new _definition.GraphQLEnumType(_objectSpread({}, config, { + values: _objectSpread({}, config.values, (0, _keyValMap.default)(valueNodes, function (value) { + return value.name.value; + }, function (value) { + return astBuilder.buildEnumValue(value); + })), + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendScalarType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + return new _definition.GraphQLScalarType(_objectSpread({}, config, { + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendObjectType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var interfaceNodes = (0, _flatMap.default)(extensions, function (node) { + return node.interfaces || []; + }); + var fieldNodes = (0, _flatMap.default)(extensions, function (node) { + return node.fields || []; + }); + return new _definition.GraphQLObjectType(_objectSpread({}, config, { + interfaces: function interfaces() { + return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) { + return astBuilder.getNamedType(node); + })); + }, + fields: function fields() { + return _objectSpread({}, (0, _mapValue.default)(config.fields, extendField), (0, _keyValMap.default)(fieldNodes, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildField(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendInterfaceType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var fieldNodes = (0, _flatMap.default)(extensions, function (node) { + return node.fields || []; + }); + return new _definition.GraphQLInterfaceType(_objectSpread({}, config, { + fields: function fields() { + return _objectSpread({}, (0, _mapValue.default)(config.fields, extendField), (0, _keyValMap.default)(fieldNodes, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildField(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendUnionType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var typeNodes = (0, _flatMap.default)(extensions, function (node) { + return node.types || []; + }); + return new _definition.GraphQLUnionType(_objectSpread({}, config, { + types: function types() { + return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) { + return astBuilder.getNamedType(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendField(field) { + return _objectSpread({}, field, { + type: replaceType(field.type), + args: (0, _mapValue.default)(field.args, extendArg) + }); + } + + function extendArg(arg) { + return _objectSpread({}, arg, { + type: replaceType(arg.type) + }); + } +} diff --git a/node_modules/graphql/utilities/extendSchema.js.flow b/node_modules/graphql/utilities/extendSchema.js.flow new file mode 100644 index 000000000..123a1c0ab --- /dev/null +++ b/node_modules/graphql/utilities/extendSchema.js.flow @@ -0,0 +1,404 @@ +// @flow strict + +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import mapValue from '../jsutils/mapValue'; +import keyValMap from '../jsutils/keyValMap'; +import { ASTDefinitionBuilder } from './buildASTSchema'; +import { assertValidSDLExtension } from '../validation/validate'; +import { + type GraphQLSchemaValidationOptions, + assertSchema, + GraphQLSchema, +} from '../type/schema'; +import { isIntrospectionType } from '../type/introspection'; +import { isSpecifiedScalarType } from '../type/scalars'; + +import { + type GraphQLNamedType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isListType, + isNonNullType, + isEnumType, + isInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, +} from '../type/definition'; + +import { GraphQLDirective } from '../type/directives'; + +import { Kind } from '../language/kinds'; + +import { + type DocumentNode, + type DirectiveDefinitionNode, + type SchemaExtensionNode, + type SchemaDefinitionNode, +} from '../language/ast'; +import { + isTypeDefinitionNode, + isTypeExtensionNode, +} from '../language/predicates'; + +type Options = {| + ...GraphQLSchemaValidationOptions, + + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean, + + /** + * Set to true to assume the SDL is valid. + * + * Default: false + */ + assumeValidSDL?: boolean, +|}; + +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function extendSchema( + schema: GraphQLSchema, + documentAST: DocumentNode, + options?: Options, +): GraphQLSchema { + assertSchema(schema); + + invariant( + documentAST && documentAST.kind === Kind.DOCUMENT, + 'Must provide valid Document AST', + ); + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + assertValidSDLExtension(documentAST, schema); + } + + // Collect the type definitions and extensions found in the document. + const typeDefs = []; + const typeExtsMap = Object.create(null); + + // New directives and types are separate because a directives and types can + // have the same name. For example, a type named "skip". + const directiveDefs: Array = []; + + let schemaDef: ?SchemaDefinitionNode; + // Schema extensions are collected which may add additional operation types. + const schemaExts: Array = []; + + for (const def of documentAST.definitions) { + if (def.kind === Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (def.kind === Kind.SCHEMA_EXTENSION) { + schemaExts.push(def); + } else if (isTypeDefinitionNode(def)) { + typeDefs.push(def); + } else if (isTypeExtensionNode(def)) { + const extendedTypeName = def.name.value; + const existingTypeExts = typeExtsMap[extendedTypeName]; + typeExtsMap[extendedTypeName] = existingTypeExts + ? existingTypeExts.concat([def]) + : [def]; + } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } + + // If this document contains no new types, extensions, or directives then + // return the same unmodified GraphQLSchema instance. + if ( + Object.keys(typeExtsMap).length === 0 && + typeDefs.length === 0 && + directiveDefs.length === 0 && + schemaExts.length === 0 && + !schemaDef + ) { + return schema; + } + + const schemaConfig = schema.toConfig(); + const astBuilder = new ASTDefinitionBuilder(options, typeName => { + const type = typeMap[typeName]; + invariant(type, `Unknown type: "${typeName}".`); + return type; + }); + + const typeMap = keyValMap( + typeDefs, + node => node.name.value, + node => astBuilder.buildType(node), + ); + for (const existingType of schemaConfig.types) { + typeMap[existingType.name] = extendNamedType(existingType); + } + + // Get the extended root operation types. + const operationTypes = { + query: schemaConfig.query && schemaConfig.query.name, + mutation: schemaConfig.mutation && schemaConfig.mutation.name, + subscription: schemaConfig.subscription && schemaConfig.subscription.name, + }; + + if (schemaDef) { + for (const { operation, type } of schemaDef.operationTypes) { + operationTypes[operation] = type.name.value; + } + } + + // Then, incorporate schema definition and all schema extensions. + for (const schemaExt of schemaExts) { + if (schemaExt.operationTypes) { + for (const { operation, type } of schemaExt.operationTypes) { + operationTypes[operation] = type.name.value; + } + } + } + + // Support both original legacy names and extended legacy names. + const allowedLegacyNames = schemaConfig.allowedLegacyNames.concat( + (options && options.allowedLegacyNames) || [], + ); + + // Then produce and return a Schema with these types. + return new GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: (getMaybeTypeByName(operationTypes.query): any), + mutation: (getMaybeTypeByName(operationTypes.mutation): any), + subscription: (getMaybeTypeByName(operationTypes.subscription): any), + + types: objectValues(typeMap), + directives: getMergedDirectives(), + astNode: schemaDef || schemaConfig.astNode, + extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts), + allowedLegacyNames, + }); + + // Below are functions used for producing this schema that have closed over + // this scope and have access to the schema, cache, and newly defined types. + + function replaceType(type) { + if (isListType(type)) { + return new GraphQLList(replaceType(type.ofType)); + } else if (isNonNullType(type)) { + return new GraphQLNonNull(replaceType(type.ofType)); + } + return replaceNamedType(type); + } + + function replaceNamedType(type: T): T { + return ((typeMap[type.name]: any): T); + } + + function getMaybeTypeByName(typeName: ?string): ?GraphQLNamedType { + return typeName ? typeMap[typeName] : null; + } + + function getMergedDirectives(): Array { + const existingDirectives = schema.getDirectives().map(extendDirective); + invariant(existingDirectives, 'schema must have default directives'); + + return existingDirectives.concat( + directiveDefs.map(node => astBuilder.buildDirective(node)), + ); + } + + function extendNamedType(type: GraphQLNamedType): GraphQLNamedType { + if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { + // Builtin types are not extended. + return type; + } else if (isScalarType(type)) { + return extendScalarType(type); + } else if (isObjectType(type)) { + return extendObjectType(type); + } else if (isInterfaceType(type)) { + return extendInterfaceType(type); + } else if (isUnionType(type)) { + return extendUnionType(type); + } else if (isEnumType(type)) { + return extendEnumType(type); + } else if (isInputObjectType(type)) { + return extendInputObjectType(type); + } + + // Not reachable. All possible types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected type: "${inspect((type: empty))}".`); + } + + function extendDirective(directive: GraphQLDirective): GraphQLDirective { + const config = directive.toConfig(); + + return new GraphQLDirective({ + ...config, + args: mapValue(config.args, extendArg), + }); + } + + function extendInputObjectType( + type: GraphQLInputObjectType, + ): GraphQLInputObjectType { + const config = type.toConfig(); + const extensions = typeExtsMap[config.name] || []; + const fieldNodes = flatMap(extensions, node => node.fields || []); + + return new GraphQLInputObjectType({ + ...config, + fields: () => ({ + ...mapValue(config.fields, field => ({ + ...field, + type: replaceType(field.type), + })), + ...keyValMap( + fieldNodes, + field => field.name.value, + field => astBuilder.buildInputField(field), + ), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendEnumType(type: GraphQLEnumType): GraphQLEnumType { + const config = type.toConfig(); + const extensions = typeExtsMap[type.name] || []; + const valueNodes = flatMap(extensions, node => node.values || []); + + return new GraphQLEnumType({ + ...config, + values: { + ...config.values, + ...keyValMap( + valueNodes, + value => value.name.value, + value => astBuilder.buildEnumValue(value), + ), + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendScalarType(type: GraphQLScalarType): GraphQLScalarType { + const config = type.toConfig(); + const extensions = typeExtsMap[config.name] || []; + + return new GraphQLScalarType({ + ...config, + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendObjectType(type: GraphQLObjectType): GraphQLObjectType { + const config = type.toConfig(); + const extensions = typeExtsMap[config.name] || []; + const interfaceNodes = flatMap(extensions, node => node.interfaces || []); + const fieldNodes = flatMap(extensions, node => node.fields || []); + + return new GraphQLObjectType({ + ...config, + interfaces: () => [ + ...type.getInterfaces().map(replaceNamedType), + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + ...interfaceNodes.map(node => (astBuilder.getNamedType(node): any)), + ], + fields: () => ({ + ...mapValue(config.fields, extendField), + ...keyValMap( + fieldNodes, + node => node.name.value, + node => astBuilder.buildField(node), + ), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendInterfaceType( + type: GraphQLInterfaceType, + ): GraphQLInterfaceType { + const config = type.toConfig(); + const extensions = typeExtsMap[config.name] || []; + const fieldNodes = flatMap(extensions, node => node.fields || []); + + return new GraphQLInterfaceType({ + ...config, + fields: () => ({ + ...mapValue(config.fields, extendField), + ...keyValMap( + fieldNodes, + node => node.name.value, + node => astBuilder.buildField(node), + ), + }), + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendUnionType(type: GraphQLUnionType): GraphQLUnionType { + const config = type.toConfig(); + const extensions = typeExtsMap[config.name] || []; + const typeNodes = flatMap(extensions, node => node.types || []); + + return new GraphQLUnionType({ + ...config, + types: () => [ + ...type.getTypes().map(replaceNamedType), + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + ...typeNodes.map(node => (astBuilder.getNamedType(node): any)), + ], + extensionASTNodes: config.extensionASTNodes.concat(extensions), + }); + } + + function extendField(field) { + return { + ...field, + type: replaceType(field.type), + args: mapValue(field.args, extendArg), + }; + } + + function extendArg(arg) { + return { + ...arg, + type: replaceType(arg.type), + }; + } +} diff --git a/node_modules/graphql/utilities/extendSchema.mjs b/node_modules/graphql/utilities/extendSchema.mjs new file mode 100644 index 000000000..62668462a --- /dev/null +++ b/node_modules/graphql/utilities/extendSchema.mjs @@ -0,0 +1,395 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import mapValue from '../jsutils/mapValue'; +import keyValMap from '../jsutils/keyValMap'; +import { ASTDefinitionBuilder } from './buildASTSchema'; +import { assertValidSDLExtension } from '../validation/validate'; +import { assertSchema, GraphQLSchema } from '../type/schema'; +import { isIntrospectionType } from '../type/introspection'; +import { isSpecifiedScalarType } from '../type/scalars'; +import { isScalarType, isObjectType, isInterfaceType, isUnionType, isListType, isNonNullType, isEnumType, isInputObjectType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType } from '../type/definition'; +import { GraphQLDirective } from '../type/directives'; +import { Kind } from '../language/kinds'; +import { isTypeDefinitionNode, isTypeExtensionNode } from '../language/predicates'; + +/** + * Produces a new schema given an existing schema and a document which may + * contain GraphQL type extensions and definitions. The original schema will + * remain unaltered. + * + * Because a schema represents a graph of references, a schema cannot be + * extended without effectively making an entire copy. We do not know until it's + * too late if subgraphs remain unchanged. + * + * This algorithm copies the provided schema, applying extensions while + * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function extendSchema(schema, documentAST, options) { + assertSchema(schema); + !(documentAST && documentAST.kind === Kind.DOCUMENT) ? invariant(0, 'Must provide valid Document AST') : void 0; + + if (!options || !(options.assumeValid || options.assumeValidSDL)) { + assertValidSDLExtension(documentAST, schema); + } // Collect the type definitions and extensions found in the document. + + + var typeDefs = []; + var typeExtsMap = Object.create(null); // New directives and types are separate because a directives and types can + // have the same name. For example, a type named "skip". + + var directiveDefs = []; + var schemaDef; // Schema extensions are collected which may add additional operation types. + + var schemaExts = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (def.kind === Kind.SCHEMA_DEFINITION) { + schemaDef = def; + } else if (def.kind === Kind.SCHEMA_EXTENSION) { + schemaExts.push(def); + } else if (isTypeDefinitionNode(def)) { + typeDefs.push(def); + } else if (isTypeExtensionNode(def)) { + var extendedTypeName = def.name.value; + var existingTypeExts = typeExtsMap[extendedTypeName]; + typeExtsMap[extendedTypeName] = existingTypeExts ? existingTypeExts.concat([def]) : [def]; + } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveDefs.push(def); + } + } // If this document contains no new types, extensions, or directives then + // return the same unmodified GraphQLSchema instance. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + if (Object.keys(typeExtsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExts.length === 0 && !schemaDef) { + return schema; + } + + var schemaConfig = schema.toConfig(); + var astBuilder = new ASTDefinitionBuilder(options, function (typeName) { + var type = typeMap[typeName]; + !type ? invariant(0, "Unknown type: \"".concat(typeName, "\".")) : void 0; + return type; + }); + var typeMap = keyValMap(typeDefs, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildType(node); + }); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = schemaConfig.types[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var existingType = _step2.value; + typeMap[existingType.name] = extendNamedType(existingType); + } // Get the extended root operation types. + + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var operationTypes = { + query: schemaConfig.query && schemaConfig.query.name, + mutation: schemaConfig.mutation && schemaConfig.mutation.name, + subscription: schemaConfig.subscription && schemaConfig.subscription.name + }; + + if (schemaDef) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = schemaDef.operationTypes[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _ref2 = _step3.value; + var operation = _ref2.operation; + var type = _ref2.type; + operationTypes[operation] = type.name.value; + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } // Then, incorporate schema definition and all schema extensions. + + + for (var _i = 0, _schemaExts = schemaExts; _i < _schemaExts.length; _i++) { + var schemaExt = _schemaExts[_i]; + + if (schemaExt.operationTypes) { + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = schemaExt.operationTypes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _ref4 = _step4.value; + var _operation = _ref4.operation; + var _type = _ref4.type; + operationTypes[_operation] = _type.name.value; + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + } + } // Support both original legacy names and extended legacy names. + + + var allowedLegacyNames = schemaConfig.allowedLegacyNames.concat(options && options.allowedLegacyNames || []); // Then produce and return a Schema with these types. + + return new GraphQLSchema({ + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + query: getMaybeTypeByName(operationTypes.query), + mutation: getMaybeTypeByName(operationTypes.mutation), + subscription: getMaybeTypeByName(operationTypes.subscription), + types: objectValues(typeMap), + directives: getMergedDirectives(), + astNode: schemaDef || schemaConfig.astNode, + extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts), + allowedLegacyNames: allowedLegacyNames + }); // Below are functions used for producing this schema that have closed over + // this scope and have access to the schema, cache, and newly defined types. + + function replaceType(type) { + if (isListType(type)) { + return new GraphQLList(replaceType(type.ofType)); + } else if (isNonNullType(type)) { + return new GraphQLNonNull(replaceType(type.ofType)); + } + + return replaceNamedType(type); + } + + function replaceNamedType(type) { + return typeMap[type.name]; + } + + function getMaybeTypeByName(typeName) { + return typeName ? typeMap[typeName] : null; + } + + function getMergedDirectives() { + var existingDirectives = schema.getDirectives().map(extendDirective); + !existingDirectives ? invariant(0, 'schema must have default directives') : void 0; + return existingDirectives.concat(directiveDefs.map(function (node) { + return astBuilder.buildDirective(node); + })); + } + + function extendNamedType(type) { + if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { + // Builtin types are not extended. + return type; + } else if (isScalarType(type)) { + return extendScalarType(type); + } else if (isObjectType(type)) { + return extendObjectType(type); + } else if (isInterfaceType(type)) { + return extendInterfaceType(type); + } else if (isUnionType(type)) { + return extendUnionType(type); + } else if (isEnumType(type)) { + return extendEnumType(type); + } else if (isInputObjectType(type)) { + return extendInputObjectType(type); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat(inspect(type), "\".")); + } + + function extendDirective(directive) { + var config = directive.toConfig(); + return new GraphQLDirective(_objectSpread({}, config, { + args: mapValue(config.args, extendArg) + })); + } + + function extendInputObjectType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var fieldNodes = flatMap(extensions, function (node) { + return node.fields || []; + }); + return new GraphQLInputObjectType(_objectSpread({}, config, { + fields: function fields() { + return _objectSpread({}, mapValue(config.fields, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type) + }); + }), keyValMap(fieldNodes, function (field) { + return field.name.value; + }, function (field) { + return astBuilder.buildInputField(field); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendEnumType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[type.name] || []; + var valueNodes = flatMap(extensions, function (node) { + return node.values || []; + }); + return new GraphQLEnumType(_objectSpread({}, config, { + values: _objectSpread({}, config.values, keyValMap(valueNodes, function (value) { + return value.name.value; + }, function (value) { + return astBuilder.buildEnumValue(value); + })), + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendScalarType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + return new GraphQLScalarType(_objectSpread({}, config, { + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendObjectType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var interfaceNodes = flatMap(extensions, function (node) { + return node.interfaces || []; + }); + var fieldNodes = flatMap(extensions, function (node) { + return node.fields || []; + }); + return new GraphQLObjectType(_objectSpread({}, config, { + interfaces: function interfaces() { + return [].concat(type.getInterfaces().map(replaceNamedType), interfaceNodes.map(function (node) { + return astBuilder.getNamedType(node); + })); + }, + fields: function fields() { + return _objectSpread({}, mapValue(config.fields, extendField), keyValMap(fieldNodes, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildField(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendInterfaceType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var fieldNodes = flatMap(extensions, function (node) { + return node.fields || []; + }); + return new GraphQLInterfaceType(_objectSpread({}, config, { + fields: function fields() { + return _objectSpread({}, mapValue(config.fields, extendField), keyValMap(fieldNodes, function (node) { + return node.name.value; + }, function (node) { + return astBuilder.buildField(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendUnionType(type) { + var config = type.toConfig(); + var extensions = typeExtsMap[config.name] || []; + var typeNodes = flatMap(extensions, function (node) { + return node.types || []; + }); + return new GraphQLUnionType(_objectSpread({}, config, { + types: function types() { + return [].concat(type.getTypes().map(replaceNamedType), typeNodes.map(function (node) { + return astBuilder.getNamedType(node); + })); + }, + extensionASTNodes: config.extensionASTNodes.concat(extensions) + })); + } + + function extendField(field) { + return _objectSpread({}, field, { + type: replaceType(field.type), + args: mapValue(field.args, extendArg) + }); + } + + function extendArg(arg) { + return _objectSpread({}, arg, { + type: replaceType(arg.type) + }); + } +} diff --git a/node_modules/graphql/utilities/findBreakingChanges.js b/node_modules/graphql/utilities/findBreakingChanges.js new file mode 100644 index 000000000..aa52d7b6c --- /dev/null +++ b/node_modules/graphql/utilities/findBreakingChanges.js @@ -0,0 +1,915 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findBreakingChanges = findBreakingChanges; +exports.findDangerousChanges = findDangerousChanges; +exports.DangerousChangeType = exports.BreakingChangeType = void 0; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _keyMap = _interopRequireDefault(require("../jsutils/keyMap")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _printer = require("../language/printer"); + +var _definition = require("../type/definition"); + +var _astFromValue = require("./astFromValue"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BreakingChangeType = Object.freeze({ + TYPE_REMOVED: 'TYPE_REMOVED', + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', + INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT', + FIELD_REMOVED: 'FIELD_REMOVED', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', + ARG_REMOVED: 'ARG_REMOVED', + ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED' +}); +exports.BreakingChangeType = BreakingChangeType; +var DangerousChangeType = Object.freeze({ + VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT', + ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE' +}); +exports.DangerousChangeType = DangerousChangeType; + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. + */ +function findBreakingChanges(oldSchema, newSchema) { + var breakingChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { + return change.type in BreakingChangeType; + }); + return breakingChanges; +} +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ + + +function findDangerousChanges(oldSchema, newSchema) { + var dangerousChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { + return change.type in DangerousChangeType; + }); + return dangerousChanges; +} + +function findSchemaChanges(oldSchema, newSchema) { + return [].concat(findTypeChanges(oldSchema, newSchema), findDirectiveChanges(oldSchema, newSchema)); +} + +function findDirectiveChanges(oldSchema, newSchema) { + var schemaChanges = []; + var directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = directivesDiff.removed[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var oldDirective = _step.value; + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: "".concat(oldDirective.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = directivesDiff.persisted[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _ref2 = _step2.value; + var _oldDirective = _ref2[0]; + var newDirective = _ref2[1]; + var argsDiff = diff(_oldDirective.args, newDirective.args); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = argsDiff.added[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var newArg = _step3.value; + + if ((0, _definition.isRequiredArgument)(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: "A required arg ".concat(newArg.name, " on directive ").concat(_oldDirective.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = argsDiff.removed[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var oldArg = _step4.value; + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".") + }); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = _oldDirective.locations[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var location = _step5.value; + + if (newDirective.locations.indexOf(location) === -1) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".") + }); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return schemaChanges; +} + +function findTypeChanges(oldSchema, newSchema) { + var schemaChanges = []; + var typesDiff = diff((0, _objectValues.default)(oldSchema.getTypeMap()), (0, _objectValues.default)(newSchema.getTypeMap())); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + for (var _iterator6 = typesDiff.removed[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var oldType = _step6.value; + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: "".concat(oldType.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = typesDiff.persisted[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var _ref4 = _step7.value; + var _oldType = _ref4[0]; + var newType = _ref4[1]; + + if ((0, _definition.isEnumType)(_oldType) && (0, _definition.isEnumType)(newType)) { + schemaChanges.push.apply(schemaChanges, findEnumTypeChanges(_oldType, newType)); + } else if ((0, _definition.isUnionType)(_oldType) && (0, _definition.isUnionType)(newType)) { + schemaChanges.push.apply(schemaChanges, findUnionTypeChanges(_oldType, newType)); + } else if ((0, _definition.isInputObjectType)(_oldType) && (0, _definition.isInputObjectType)(newType)) { + schemaChanges.push.apply(schemaChanges, findInputObjectTypeChanges(_oldType, newType)); + } else if ((0, _definition.isObjectType)(_oldType) && (0, _definition.isObjectType)(newType)) { + schemaChanges.push.apply(schemaChanges, findObjectTypeChanges(_oldType, newType)); + } else if ((0, _definition.isInterfaceType)(_oldType) && (0, _definition.isInterfaceType)(newType)) { + schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType)); + } else if (_oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: "".concat(_oldType.name, " changed from ") + "".concat(typeKindName(_oldType), " to ").concat(typeKindName(newType), ".") + }); + } + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return != null) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + + return schemaChanges; +} + +function findInputObjectTypeChanges(oldType, newType) { + var schemaChanges = []; + var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + + try { + for (var _iterator8 = fieldsDiff.added[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { + var newField = _step8.value; + + if ((0, _definition.isRequiredInputField)(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: "A required field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: "An optional field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if (!_iteratorNormalCompletion8 && _iterator8.return != null) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } + + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + + try { + for (var _iterator9 = fieldsDiff.removed[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { + var oldField = _step9.value; + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + + try { + for (var _iterator10 = fieldsDiff.persisted[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { + var _ref6 = _step10.value; + var _oldField = _ref6[0]; + var _newField = _ref6[1]; + var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(_oldField.name, " changed type from ") + "".concat(String(_oldField.type), " to ").concat(String(_newField.type), ".") + }); + } + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if (!_iteratorNormalCompletion10 && _iterator10.return != null) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + + return schemaChanges; +} + +function findUnionTypeChanges(oldType, newType) { + var schemaChanges = []; + var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + var _iteratorNormalCompletion11 = true; + var _didIteratorError11 = false; + var _iteratorError11 = undefined; + + try { + for (var _iterator11 = possibleTypesDiff.added[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { + var newPossibleType = _step11.value; + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError11 = true; + _iteratorError11 = err; + } finally { + try { + if (!_iteratorNormalCompletion11 && _iterator11.return != null) { + _iterator11.return(); + } + } finally { + if (_didIteratorError11) { + throw _iteratorError11; + } + } + } + + var _iteratorNormalCompletion12 = true; + var _didIteratorError12 = false; + var _iteratorError12 = undefined; + + try { + for (var _iterator12 = possibleTypesDiff.removed[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { + var oldPossibleType = _step12.value; + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError12 = true; + _iteratorError12 = err; + } finally { + try { + if (!_iteratorNormalCompletion12 && _iterator12.return != null) { + _iterator12.return(); + } + } finally { + if (_didIteratorError12) { + throw _iteratorError12; + } + } + } + + return schemaChanges; +} + +function findEnumTypeChanges(oldType, newType) { + var schemaChanges = []; + var valuesDiff = diff(oldType.getValues(), newType.getValues()); + var _iteratorNormalCompletion13 = true; + var _didIteratorError13 = false; + var _iteratorError13 = undefined; + + try { + for (var _iterator13 = valuesDiff.added[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { + var newValue = _step13.value; + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError13 = true; + _iteratorError13 = err; + } finally { + try { + if (!_iteratorNormalCompletion13 && _iterator13.return != null) { + _iterator13.return(); + } + } finally { + if (_didIteratorError13) { + throw _iteratorError13; + } + } + } + + var _iteratorNormalCompletion14 = true; + var _didIteratorError14 = false; + var _iteratorError14 = undefined; + + try { + for (var _iterator14 = valuesDiff.removed[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) { + var oldValue = _step14.value; + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError14 = true; + _iteratorError14 = err; + } finally { + try { + if (!_iteratorNormalCompletion14 && _iterator14.return != null) { + _iterator14.return(); + } + } finally { + if (_didIteratorError14) { + throw _iteratorError14; + } + } + } + + return schemaChanges; +} + +function findObjectTypeChanges(oldType, newType) { + var schemaChanges = findFieldChanges(oldType, newType); + var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + var _iteratorNormalCompletion15 = true; + var _didIteratorError15 = false; + var _iteratorError15 = undefined; + + try { + for (var _iterator15 = interfacesDiff.added[Symbol.iterator](), _step15; !(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done); _iteratorNormalCompletion15 = true) { + var newInterface = _step15.value; + schemaChanges.push({ + type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT, + description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError15 = true; + _iteratorError15 = err; + } finally { + try { + if (!_iteratorNormalCompletion15 && _iterator15.return != null) { + _iterator15.return(); + } + } finally { + if (_didIteratorError15) { + throw _iteratorError15; + } + } + } + + var _iteratorNormalCompletion16 = true; + var _didIteratorError16 = false; + var _iteratorError16 = undefined; + + try { + for (var _iterator16 = interfacesDiff.removed[Symbol.iterator](), _step16; !(_iteratorNormalCompletion16 = (_step16 = _iterator16.next()).done); _iteratorNormalCompletion16 = true) { + var oldInterface = _step16.value; + schemaChanges.push({ + type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT, + description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".") + }); + } + } catch (err) { + _didIteratorError16 = true; + _iteratorError16 = err; + } finally { + try { + if (!_iteratorNormalCompletion16 && _iterator16.return != null) { + _iterator16.return(); + } + } finally { + if (_didIteratorError16) { + throw _iteratorError16; + } + } + } + + return schemaChanges; +} + +function findFieldChanges(oldType, newType) { + var schemaChanges = []; + var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); + var _iteratorNormalCompletion17 = true; + var _didIteratorError17 = false; + var _iteratorError17 = undefined; + + try { + for (var _iterator17 = fieldsDiff.removed[Symbol.iterator](), _step17; !(_iteratorNormalCompletion17 = (_step17 = _iterator17.next()).done); _iteratorNormalCompletion17 = true) { + var oldField = _step17.value; + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError17 = true; + _iteratorError17 = err; + } finally { + try { + if (!_iteratorNormalCompletion17 && _iterator17.return != null) { + _iterator17.return(); + } + } finally { + if (_didIteratorError17) { + throw _iteratorError17; + } + } + } + + var _iteratorNormalCompletion18 = true; + var _didIteratorError18 = false; + var _iteratorError18 = undefined; + + try { + for (var _iterator18 = fieldsDiff.persisted[Symbol.iterator](), _step18; !(_iteratorNormalCompletion18 = (_step18 = _iterator18.next()).done); _iteratorNormalCompletion18 = true) { + var _ref8 = _step18.value; + var _oldField2 = _ref8[0]; + var newField = _ref8[1]; + schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField)); + var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(_oldField2.name, " changed type from ") + "".concat(String(_oldField2.type), " to ").concat(String(newField.type), ".") + }); + } + } + } catch (err) { + _didIteratorError18 = true; + _iteratorError18 = err; + } finally { + try { + if (!_iteratorNormalCompletion18 && _iterator18.return != null) { + _iterator18.return(); + } + } finally { + if (_didIteratorError18) { + throw _iteratorError18; + } + } + } + + return schemaChanges; +} + +function findArgChanges(oldType, oldField, newField) { + var schemaChanges = []; + var argsDiff = diff(oldField.args, newField.args); + var _iteratorNormalCompletion19 = true; + var _didIteratorError19 = false; + var _iteratorError19 = undefined; + + try { + for (var _iterator19 = argsDiff.removed[Symbol.iterator](), _step19; !(_iteratorNormalCompletion19 = (_step19 = _iterator19.next()).done); _iteratorNormalCompletion19 = true) { + var oldArg = _step19.value; + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError19 = true; + _iteratorError19 = err; + } finally { + try { + if (!_iteratorNormalCompletion19 && _iterator19.return != null) { + _iterator19.return(); + } + } finally { + if (_didIteratorError19) { + throw _iteratorError19; + } + } + } + + var _iteratorNormalCompletion20 = true; + var _didIteratorError20 = false; + var _iteratorError20 = undefined; + + try { + for (var _iterator20 = argsDiff.persisted[Symbol.iterator](), _step20; !(_iteratorNormalCompletion20 = (_step20 = _iterator20.next()).done); _iteratorNormalCompletion20 = true) { + var _ref10 = _step20.value; + var _oldArg = _ref10[0]; + var newArg = _ref10[1]; + var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed type from ") + "".concat(String(_oldArg.type), " to ").concat(String(newArg.type), ".") + }); + } else if (_oldArg.defaultValue !== undefined) { + if (newArg.defaultValue === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " defaultValue was removed.") + }); + } else { + var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type); + var newValueStr = stringifyValue(newArg.defaultValue, newArg.type); + + if (oldValueStr !== newValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed defaultValue from ").concat(oldValueStr, " to ").concat(newValueStr, ".") + }); + } + } + } + } + } catch (err) { + _didIteratorError20 = true; + _iteratorError20 = err; + } finally { + try { + if (!_iteratorNormalCompletion20 && _iterator20.return != null) { + _iterator20.return(); + } + } finally { + if (_didIteratorError20) { + throw _iteratorError20; + } + } + } + + var _iteratorNormalCompletion21 = true; + var _didIteratorError21 = false; + var _iteratorError21 = undefined; + + try { + for (var _iterator21 = argsDiff.added[Symbol.iterator](), _step21; !(_iteratorNormalCompletion21 = (_step21 = _iterator21.next()).done); _iteratorNormalCompletion21 = true) { + var _newArg = _step21.value; + + if ((0, _definition.isRequiredArgument)(_newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: "A required arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: "An optional arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError21 = true; + _iteratorError21 = err; + } finally { + try { + if (!_iteratorNormalCompletion21 && _iterator21.return != null) { + _iterator21.return(); + } + } finally { + if (_didIteratorError21) { + throw _iteratorError21; + } + } + } + + return schemaChanges; +} + +function isChangeSafeForObjectOrInterfaceField(oldType, newType) { + if ((0, _definition.isListType)(oldType)) { + return (// if they're both lists, make sure the underlying types are compatible + (0, _definition.isListType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || // moving from nullable to non-null of the same underlying type is safe + (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); + } + + if ((0, _definition.isNonNullType)(oldType)) { + // if they're both non-null, make sure the underlying types are compatible + return (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); + } + + return (// if they're both named types, see if their names are equivalent + (0, _definition.isNamedType)(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe + (0, _definition.isNonNullType)(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); +} + +function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { + if ((0, _definition.isListType)(oldType)) { + // if they're both lists, make sure the underlying types are compatible + return (0, _definition.isListType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); + } + + if ((0, _definition.isNonNullType)(oldType)) { + return (// if they're both non-null, make sure the underlying types are + // compatible + (0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || // moving from non-null to nullable of the same underlying type is safe + !(0, _definition.isNonNullType)(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) + ); + } // if they're both named types, see if their names are equivalent + + + return (0, _definition.isNamedType)(newType) && oldType.name === newType.name; +} + +function typeKindName(type) { + if ((0, _definition.isScalarType)(type)) { + return 'a Scalar type'; + } + + if ((0, _definition.isObjectType)(type)) { + return 'an Object type'; + } + + if ((0, _definition.isInterfaceType)(type)) { + return 'an Interface type'; + } + + if ((0, _definition.isUnionType)(type)) { + return 'a Union type'; + } + + if ((0, _definition.isEnumType)(type)) { + return 'an Enum type'; + } + + if ((0, _definition.isInputObjectType)(type)) { + return 'an Input type'; + } // Not reachable. All possible named types have been considered. + + /* istanbul ignore next */ + + + throw new TypeError("Unexpected type: ".concat((0, _inspect.default)(type), ".")); +} + +function stringifyValue(value, type) { + var ast = (0, _astFromValue.astFromValue)(value, type); + !(ast != null) ? (0, _invariant.default)(0) : void 0; + return (0, _printer.print)(ast); +} + +function diff(oldArray, newArray) { + var added = []; + var removed = []; + var persisted = []; + var oldMap = (0, _keyMap.default)(oldArray, function (_ref11) { + var name = _ref11.name; + return name; + }); + var newMap = (0, _keyMap.default)(newArray, function (_ref12) { + var name = _ref12.name; + return name; + }); + var _iteratorNormalCompletion22 = true; + var _didIteratorError22 = false; + var _iteratorError22 = undefined; + + try { + for (var _iterator22 = oldArray[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) { + var oldItem = _step22.value; + var newItem = newMap[oldItem.name]; + + if (newItem === undefined) { + removed.push(oldItem); + } else { + persisted.push([oldItem, newItem]); + } + } + } catch (err) { + _didIteratorError22 = true; + _iteratorError22 = err; + } finally { + try { + if (!_iteratorNormalCompletion22 && _iterator22.return != null) { + _iterator22.return(); + } + } finally { + if (_didIteratorError22) { + throw _iteratorError22; + } + } + } + + var _iteratorNormalCompletion23 = true; + var _didIteratorError23 = false; + var _iteratorError23 = undefined; + + try { + for (var _iterator23 = newArray[Symbol.iterator](), _step23; !(_iteratorNormalCompletion23 = (_step23 = _iterator23.next()).done); _iteratorNormalCompletion23 = true) { + var _newItem = _step23.value; + + if (oldMap[_newItem.name] === undefined) { + added.push(_newItem); + } + } + } catch (err) { + _didIteratorError23 = true; + _iteratorError23 = err; + } finally { + try { + if (!_iteratorNormalCompletion23 && _iterator23.return != null) { + _iterator23.return(); + } + } finally { + if (_didIteratorError23) { + throw _iteratorError23; + } + } + } + + return { + added: added, + persisted: persisted, + removed: removed + }; +} diff --git a/node_modules/graphql/utilities/findBreakingChanges.js.flow b/node_modules/graphql/utilities/findBreakingChanges.js.flow new file mode 100644 index 000000000..3e3f425cf --- /dev/null +++ b/node_modules/graphql/utilities/findBreakingChanges.js.flow @@ -0,0 +1,552 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import keyMap from '../jsutils/keyMap'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import { print } from '../language/printer'; +import { + type GraphQLField, + type GraphQLType, + type GraphQLInputType, + type GraphQLNamedType, + type GraphQLEnumType, + type GraphQLUnionType, + type GraphQLObjectType, + type GraphQLInterfaceType, + type GraphQLInputObjectType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isNonNullType, + isListType, + isNamedType, + isRequiredArgument, + isRequiredInputField, +} from '../type/definition'; +import { type GraphQLSchema } from '../type/schema'; +import { astFromValue } from './astFromValue'; + +export const BreakingChangeType = Object.freeze({ + TYPE_REMOVED: 'TYPE_REMOVED', + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', + INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT', + FIELD_REMOVED: 'FIELD_REMOVED', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', + ARG_REMOVED: 'ARG_REMOVED', + ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED', +}); + +export const DangerousChangeType = Object.freeze({ + VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT', + ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE', +}); + +export type BreakingChange = { + type: $Keys, + description: string, + ... +}; + +export type DangerousChange = { + type: $Keys, + description: string, + ... +}; + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. + */ +export function findBreakingChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const breakingChanges = findSchemaChanges(oldSchema, newSchema).filter( + change => change.type in BreakingChangeType, + ); + return ((breakingChanges: any): Array); +} + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ +export function findDangerousChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const dangerousChanges = findSchemaChanges(oldSchema, newSchema).filter( + change => change.type in DangerousChangeType, + ); + return ((dangerousChanges: any): Array); +} + +function findSchemaChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + return [ + ...findTypeChanges(oldSchema, newSchema), + ...findDirectiveChanges(oldSchema, newSchema), + ]; +} + +function findDirectiveChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const schemaChanges = []; + + const directivesDiff = diff( + oldSchema.getDirectives(), + newSchema.getDirectives(), + ); + + for (const oldDirective of directivesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: `${oldDirective.name} was removed.`, + }); + } + + for (const [oldDirective, newDirective] of directivesDiff.persisted) { + const argsDiff = diff(oldDirective.args, newDirective.args); + + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.`, + }); + } + } + + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: `${oldArg.name} was removed from ${oldDirective.name}.`, + }); + } + + for (const location of oldDirective.locations) { + if (newDirective.locations.indexOf(location) === -1) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: `${location} was removed from ${oldDirective.name}.`, + }); + } + } + } + + return schemaChanges; +} + +function findTypeChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema, +): Array { + const schemaChanges = []; + + const typesDiff = diff( + objectValues(oldSchema.getTypeMap()), + objectValues(newSchema.getTypeMap()), + ); + + for (const oldType of typesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: `${oldType.name} was removed.`, + }); + } + + for (const [oldType, newType] of typesDiff.persisted) { + if (isEnumType(oldType) && isEnumType(newType)) { + schemaChanges.push(...findEnumTypeChanges(oldType, newType)); + } else if (isUnionType(oldType) && isUnionType(newType)) { + schemaChanges.push(...findUnionTypeChanges(oldType, newType)); + } else if (isInputObjectType(oldType) && isInputObjectType(newType)) { + schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); + } else if (isObjectType(oldType) && isObjectType(newType)) { + schemaChanges.push(...findObjectTypeChanges(oldType, newType)); + } else if (isInterfaceType(oldType) && isInterfaceType(newType)) { + schemaChanges.push(...findFieldChanges(oldType, newType)); + } else if (oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: + `${oldType.name} changed from ` + + `${typeKindName(oldType)} to ${typeKindName(newType)}.`, + }); + } + } + + return schemaChanges; +} + +function findInputObjectTypeChanges( + oldType: GraphQLInputObjectType, + newType: GraphQLInputObjectType, +): Array { + const schemaChanges = []; + const fieldsDiff = diff( + objectValues(oldType.getFields()), + objectValues(newType.getFields()), + ); + + for (const newField of fieldsDiff.added) { + if (isRequiredInputField(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: `A required field ${newField.name} on input type ${oldType.name} was added.`, + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: `An optional field ${newField.name} on input type ${oldType.name} was added.`, + }); + } + } + + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.`, + }); + } + + for (const [oldField, newField] of fieldsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( + oldField.type, + newField.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + } + + return schemaChanges; +} + +function findUnionTypeChanges( + oldType: GraphQLUnionType, + newType: GraphQLUnionType, +): Array { + const schemaChanges = []; + const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + + for (const newPossibleType of possibleTypesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: `${newPossibleType.name} was added to union type ${oldType.name}.`, + }); + } + + for (const oldPossibleType of possibleTypesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: `${oldPossibleType.name} was removed from union type ${oldType.name}.`, + }); + } + + return schemaChanges; +} + +function findEnumTypeChanges( + oldType: GraphQLEnumType, + newType: GraphQLEnumType, +): Array { + const schemaChanges = []; + const valuesDiff = diff(oldType.getValues(), newType.getValues()); + + for (const newValue of valuesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: `${newValue.name} was added to enum type ${oldType.name}.`, + }); + } + + for (const oldValue of valuesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: `${oldValue.name} was removed from enum type ${oldType.name}.`, + }); + } + + return schemaChanges; +} + +function findObjectTypeChanges( + oldType: GraphQLObjectType, + newType: GraphQLObjectType, +): Array { + const schemaChanges = findFieldChanges(oldType, newType); + const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + + for (const newInterface of interfacesDiff.added) { + schemaChanges.push({ + type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT, + description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`, + }); + } + + for (const oldInterface of interfacesDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT, + description: `${oldType.name} no longer implements interface ${oldInterface.name}.`, + }); + } + + return schemaChanges; +} + +function findFieldChanges( + oldType: GraphQLObjectType | GraphQLInterfaceType, + newType: GraphQLObjectType | GraphQLInterfaceType, +): Array { + const schemaChanges = []; + const fieldsDiff = diff( + objectValues(oldType.getFields()), + objectValues(newType.getFields()), + ); + + for (const oldField of fieldsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: `${oldType.name}.${oldField.name} was removed.`, + }); + } + + for (const [oldField, newField] of fieldsDiff.persisted) { + schemaChanges.push(...findArgChanges(oldType, oldField, newField)); + + const isSafe = isChangeSafeForObjectOrInterfaceField( + oldField.type, + newField.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} changed type from ` + + `${String(oldField.type)} to ${String(newField.type)}.`, + }); + } + } + + return schemaChanges; +} + +function findArgChanges( + oldType: GraphQLObjectType | GraphQLInterfaceType, + oldField: GraphQLField<*, *>, + newField: GraphQLField<*, *>, +): Array { + const schemaChanges = []; + const argsDiff = diff(oldField.args, newField.args); + + for (const oldArg of argsDiff.removed) { + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.`, + }); + } + + for (const [oldArg, newArg] of argsDiff.persisted) { + const isSafe = isChangeSafeForInputObjectFieldOrFieldArg( + oldArg.type, + newArg.type, + ); + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: + `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` + + `${String(oldArg.type)} to ${String(newArg.type)}.`, + }); + } else if (oldArg.defaultValue !== undefined) { + if (newArg.defaultValue === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.`, + }); + } else { + const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type); + const newValueStr = stringifyValue(newArg.defaultValue, newArg.type); + + if (oldValueStr !== newValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.`, + }); + } + } + } + } + + for (const newArg of argsDiff.added) { + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`, + }); + } + } + + return schemaChanges; +} + +function isChangeSafeForObjectOrInterfaceField( + oldType: GraphQLType, + newType: GraphQLType, +): boolean { + if (isListType(oldType)) { + return ( + // if they're both lists, make sure the underlying types are compatible + (isListType(newType) && + isChangeSafeForObjectOrInterfaceField( + oldType.ofType, + newType.ofType, + )) || + // moving from nullable to non-null of the same underlying type is safe + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) + ); + } + + if (isNonNullType(oldType)) { + // if they're both non-null, make sure the underlying types are compatible + return ( + isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) + ); + } + + return ( + // if they're both named types, see if their names are equivalent + (isNamedType(newType) && oldType.name === newType.name) || + // moving from nullable to non-null of the same underlying type is safe + (isNonNullType(newType) && + isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType)) + ); +} + +function isChangeSafeForInputObjectFieldOrFieldArg( + oldType: GraphQLType, + newType: GraphQLType, +): boolean { + if (isListType(oldType)) { + // if they're both lists, make sure the underlying types are compatible + return ( + isListType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) + ); + } + + if (isNonNullType(oldType)) { + return ( + // if they're both non-null, make sure the underlying types are + // compatible + (isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg( + oldType.ofType, + newType.ofType, + )) || + // moving from non-null to nullable of the same underlying type is safe + (!isNonNullType(newType) && + isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType)) + ); + } + + // if they're both named types, see if their names are equivalent + return isNamedType(newType) && oldType.name === newType.name; +} + +function typeKindName(type: GraphQLNamedType): string { + if (isScalarType(type)) { + return 'a Scalar type'; + } + if (isObjectType(type)) { + return 'an Object type'; + } + if (isInterfaceType(type)) { + return 'an Interface type'; + } + if (isUnionType(type)) { + return 'a Union type'; + } + if (isEnumType(type)) { + return 'an Enum type'; + } + if (isInputObjectType(type)) { + return 'an Input type'; + } + + // Not reachable. All possible named types have been considered. + /* istanbul ignore next */ + throw new TypeError(`Unexpected type: ${inspect((type: empty))}.`); +} + +function stringifyValue(value: mixed, type: GraphQLInputType): string { + const ast = astFromValue(value, type); + invariant(ast != null); + return print(ast); +} + +function diff( + oldArray: $ReadOnlyArray, + newArray: $ReadOnlyArray, +): {| + added: Array, + removed: Array, + persisted: Array<[T, T]>, +|} { + const added = []; + const removed = []; + const persisted = []; + + const oldMap = keyMap(oldArray, ({ name }) => name); + const newMap = keyMap(newArray, ({ name }) => name); + + for (const oldItem of oldArray) { + const newItem = newMap[oldItem.name]; + if (newItem === undefined) { + removed.push(oldItem); + } else { + persisted.push([oldItem, newItem]); + } + } + + for (const newItem of newArray) { + if (oldMap[newItem.name] === undefined) { + added.push(newItem); + } + } + + return { added, persisted, removed }; +} diff --git a/node_modules/graphql/utilities/findBreakingChanges.mjs b/node_modules/graphql/utilities/findBreakingChanges.mjs new file mode 100644 index 000000000..7f07284da --- /dev/null +++ b/node_modules/graphql/utilities/findBreakingChanges.mjs @@ -0,0 +1,894 @@ +import objectValues from '../polyfills/objectValues'; +import keyMap from '../jsutils/keyMap'; +import inspect from '../jsutils/inspect'; +import invariant from '../jsutils/invariant'; +import { print } from '../language/printer'; +import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNonNullType, isListType, isNamedType, isRequiredArgument, isRequiredInputField } from '../type/definition'; +import { astFromValue } from './astFromValue'; +export var BreakingChangeType = Object.freeze({ + TYPE_REMOVED: 'TYPE_REMOVED', + TYPE_CHANGED_KIND: 'TYPE_CHANGED_KIND', + TYPE_REMOVED_FROM_UNION: 'TYPE_REMOVED_FROM_UNION', + VALUE_REMOVED_FROM_ENUM: 'VALUE_REMOVED_FROM_ENUM', + REQUIRED_INPUT_FIELD_ADDED: 'REQUIRED_INPUT_FIELD_ADDED', + INTERFACE_REMOVED_FROM_OBJECT: 'INTERFACE_REMOVED_FROM_OBJECT', + FIELD_REMOVED: 'FIELD_REMOVED', + FIELD_CHANGED_KIND: 'FIELD_CHANGED_KIND', + REQUIRED_ARG_ADDED: 'REQUIRED_ARG_ADDED', + ARG_REMOVED: 'ARG_REMOVED', + ARG_CHANGED_KIND: 'ARG_CHANGED_KIND', + DIRECTIVE_REMOVED: 'DIRECTIVE_REMOVED', + DIRECTIVE_ARG_REMOVED: 'DIRECTIVE_ARG_REMOVED', + REQUIRED_DIRECTIVE_ARG_ADDED: 'REQUIRED_DIRECTIVE_ARG_ADDED', + DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED' +}); +export var DangerousChangeType = Object.freeze({ + VALUE_ADDED_TO_ENUM: 'VALUE_ADDED_TO_ENUM', + TYPE_ADDED_TO_UNION: 'TYPE_ADDED_TO_UNION', + OPTIONAL_INPUT_FIELD_ADDED: 'OPTIONAL_INPUT_FIELD_ADDED', + OPTIONAL_ARG_ADDED: 'OPTIONAL_ARG_ADDED', + INTERFACE_ADDED_TO_OBJECT: 'INTERFACE_ADDED_TO_OBJECT', + ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE' +}); + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of breaking changes covered by the other functions down below. + */ +export function findBreakingChanges(oldSchema, newSchema) { + var breakingChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { + return change.type in BreakingChangeType; + }); + return breakingChanges; +} +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ + +export function findDangerousChanges(oldSchema, newSchema) { + var dangerousChanges = findSchemaChanges(oldSchema, newSchema).filter(function (change) { + return change.type in DangerousChangeType; + }); + return dangerousChanges; +} + +function findSchemaChanges(oldSchema, newSchema) { + return [].concat(findTypeChanges(oldSchema, newSchema), findDirectiveChanges(oldSchema, newSchema)); +} + +function findDirectiveChanges(oldSchema, newSchema) { + var schemaChanges = []; + var directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives()); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = directivesDiff.removed[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var oldDirective = _step.value; + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_REMOVED, + description: "".concat(oldDirective.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = directivesDiff.persisted[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _ref2 = _step2.value; + var _oldDirective = _ref2[0]; + var newDirective = _ref2[1]; + var argsDiff = diff(_oldDirective.args, newDirective.args); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = argsDiff.added[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var newArg = _step3.value; + + if (isRequiredArgument(newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED, + description: "A required arg ".concat(newArg.name, " on directive ").concat(_oldDirective.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = argsDiff.removed[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var oldArg = _step4.value; + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, + description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".") + }); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return != null) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = _oldDirective.locations[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var location = _step5.value; + + if (newDirective.locations.indexOf(location) === -1) { + schemaChanges.push({ + type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, + description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".") + }); + } + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return != null) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return schemaChanges; +} + +function findTypeChanges(oldSchema, newSchema) { + var schemaChanges = []; + var typesDiff = diff(objectValues(oldSchema.getTypeMap()), objectValues(newSchema.getTypeMap())); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + for (var _iterator6 = typesDiff.removed[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var oldType = _step6.value; + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED, + description: "".concat(oldType.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return != null) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = typesDiff.persisted[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var _ref4 = _step7.value; + var _oldType = _ref4[0]; + var newType = _ref4[1]; + + if (isEnumType(_oldType) && isEnumType(newType)) { + schemaChanges.push.apply(schemaChanges, findEnumTypeChanges(_oldType, newType)); + } else if (isUnionType(_oldType) && isUnionType(newType)) { + schemaChanges.push.apply(schemaChanges, findUnionTypeChanges(_oldType, newType)); + } else if (isInputObjectType(_oldType) && isInputObjectType(newType)) { + schemaChanges.push.apply(schemaChanges, findInputObjectTypeChanges(_oldType, newType)); + } else if (isObjectType(_oldType) && isObjectType(newType)) { + schemaChanges.push.apply(schemaChanges, findObjectTypeChanges(_oldType, newType)); + } else if (isInterfaceType(_oldType) && isInterfaceType(newType)) { + schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType)); + } else if (_oldType.constructor !== newType.constructor) { + schemaChanges.push({ + type: BreakingChangeType.TYPE_CHANGED_KIND, + description: "".concat(_oldType.name, " changed from ") + "".concat(typeKindName(_oldType), " to ").concat(typeKindName(newType), ".") + }); + } + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return != null) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + + return schemaChanges; +} + +function findInputObjectTypeChanges(oldType, newType) { + var schemaChanges = []; + var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields())); + var _iteratorNormalCompletion8 = true; + var _didIteratorError8 = false; + var _iteratorError8 = undefined; + + try { + for (var _iterator8 = fieldsDiff.added[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) { + var newField = _step8.value; + + if (isRequiredInputField(newField)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED, + description: "A required field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED, + description: "An optional field ".concat(newField.name, " on input type ").concat(oldType.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError8 = true; + _iteratorError8 = err; + } finally { + try { + if (!_iteratorNormalCompletion8 && _iterator8.return != null) { + _iterator8.return(); + } + } finally { + if (_didIteratorError8) { + throw _iteratorError8; + } + } + } + + var _iteratorNormalCompletion9 = true; + var _didIteratorError9 = false; + var _iteratorError9 = undefined; + + try { + for (var _iterator9 = fieldsDiff.removed[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) { + var oldField = _step9.value; + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError9 = true; + _iteratorError9 = err; + } finally { + try { + if (!_iteratorNormalCompletion9 && _iterator9.return != null) { + _iterator9.return(); + } + } finally { + if (_didIteratorError9) { + throw _iteratorError9; + } + } + } + + var _iteratorNormalCompletion10 = true; + var _didIteratorError10 = false; + var _iteratorError10 = undefined; + + try { + for (var _iterator10 = fieldsDiff.persisted[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) { + var _ref6 = _step10.value; + var _oldField = _ref6[0]; + var _newField = _ref6[1]; + var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldField.type, _newField.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(_oldField.name, " changed type from ") + "".concat(String(_oldField.type), " to ").concat(String(_newField.type), ".") + }); + } + } + } catch (err) { + _didIteratorError10 = true; + _iteratorError10 = err; + } finally { + try { + if (!_iteratorNormalCompletion10 && _iterator10.return != null) { + _iterator10.return(); + } + } finally { + if (_didIteratorError10) { + throw _iteratorError10; + } + } + } + + return schemaChanges; +} + +function findUnionTypeChanges(oldType, newType) { + var schemaChanges = []; + var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); + var _iteratorNormalCompletion11 = true; + var _didIteratorError11 = false; + var _iteratorError11 = undefined; + + try { + for (var _iterator11 = possibleTypesDiff.added[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) { + var newPossibleType = _step11.value; + schemaChanges.push({ + type: DangerousChangeType.TYPE_ADDED_TO_UNION, + description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError11 = true; + _iteratorError11 = err; + } finally { + try { + if (!_iteratorNormalCompletion11 && _iterator11.return != null) { + _iterator11.return(); + } + } finally { + if (_didIteratorError11) { + throw _iteratorError11; + } + } + } + + var _iteratorNormalCompletion12 = true; + var _didIteratorError12 = false; + var _iteratorError12 = undefined; + + try { + for (var _iterator12 = possibleTypesDiff.removed[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) { + var oldPossibleType = _step12.value; + schemaChanges.push({ + type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, + description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError12 = true; + _iteratorError12 = err; + } finally { + try { + if (!_iteratorNormalCompletion12 && _iterator12.return != null) { + _iterator12.return(); + } + } finally { + if (_didIteratorError12) { + throw _iteratorError12; + } + } + } + + return schemaChanges; +} + +function findEnumTypeChanges(oldType, newType) { + var schemaChanges = []; + var valuesDiff = diff(oldType.getValues(), newType.getValues()); + var _iteratorNormalCompletion13 = true; + var _didIteratorError13 = false; + var _iteratorError13 = undefined; + + try { + for (var _iterator13 = valuesDiff.added[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) { + var newValue = _step13.value; + schemaChanges.push({ + type: DangerousChangeType.VALUE_ADDED_TO_ENUM, + description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError13 = true; + _iteratorError13 = err; + } finally { + try { + if (!_iteratorNormalCompletion13 && _iterator13.return != null) { + _iterator13.return(); + } + } finally { + if (_didIteratorError13) { + throw _iteratorError13; + } + } + } + + var _iteratorNormalCompletion14 = true; + var _didIteratorError14 = false; + var _iteratorError14 = undefined; + + try { + for (var _iterator14 = valuesDiff.removed[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) { + var oldValue = _step14.value; + schemaChanges.push({ + type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, + description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError14 = true; + _iteratorError14 = err; + } finally { + try { + if (!_iteratorNormalCompletion14 && _iterator14.return != null) { + _iterator14.return(); + } + } finally { + if (_didIteratorError14) { + throw _iteratorError14; + } + } + } + + return schemaChanges; +} + +function findObjectTypeChanges(oldType, newType) { + var schemaChanges = findFieldChanges(oldType, newType); + var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); + var _iteratorNormalCompletion15 = true; + var _didIteratorError15 = false; + var _iteratorError15 = undefined; + + try { + for (var _iterator15 = interfacesDiff.added[Symbol.iterator](), _step15; !(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done); _iteratorNormalCompletion15 = true) { + var newInterface = _step15.value; + schemaChanges.push({ + type: DangerousChangeType.INTERFACE_ADDED_TO_OBJECT, + description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".") + }); + } + } catch (err) { + _didIteratorError15 = true; + _iteratorError15 = err; + } finally { + try { + if (!_iteratorNormalCompletion15 && _iterator15.return != null) { + _iterator15.return(); + } + } finally { + if (_didIteratorError15) { + throw _iteratorError15; + } + } + } + + var _iteratorNormalCompletion16 = true; + var _didIteratorError16 = false; + var _iteratorError16 = undefined; + + try { + for (var _iterator16 = interfacesDiff.removed[Symbol.iterator](), _step16; !(_iteratorNormalCompletion16 = (_step16 = _iterator16.next()).done); _iteratorNormalCompletion16 = true) { + var oldInterface = _step16.value; + schemaChanges.push({ + type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT, + description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".") + }); + } + } catch (err) { + _didIteratorError16 = true; + _iteratorError16 = err; + } finally { + try { + if (!_iteratorNormalCompletion16 && _iterator16.return != null) { + _iterator16.return(); + } + } finally { + if (_didIteratorError16) { + throw _iteratorError16; + } + } + } + + return schemaChanges; +} + +function findFieldChanges(oldType, newType) { + var schemaChanges = []; + var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields())); + var _iteratorNormalCompletion17 = true; + var _didIteratorError17 = false; + var _iteratorError17 = undefined; + + try { + for (var _iterator17 = fieldsDiff.removed[Symbol.iterator](), _step17; !(_iteratorNormalCompletion17 = (_step17 = _iterator17.next()).done); _iteratorNormalCompletion17 = true) { + var oldField = _step17.value; + schemaChanges.push({ + type: BreakingChangeType.FIELD_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError17 = true; + _iteratorError17 = err; + } finally { + try { + if (!_iteratorNormalCompletion17 && _iterator17.return != null) { + _iterator17.return(); + } + } finally { + if (_didIteratorError17) { + throw _iteratorError17; + } + } + } + + var _iteratorNormalCompletion18 = true; + var _didIteratorError18 = false; + var _iteratorError18 = undefined; + + try { + for (var _iterator18 = fieldsDiff.persisted[Symbol.iterator](), _step18; !(_iteratorNormalCompletion18 = (_step18 = _iterator18.next()).done); _iteratorNormalCompletion18 = true) { + var _ref8 = _step18.value; + var _oldField2 = _ref8[0]; + var newField = _ref8[1]; + schemaChanges.push.apply(schemaChanges, findArgChanges(oldType, _oldField2, newField)); + var isSafe = isChangeSafeForObjectOrInterfaceField(_oldField2.type, newField.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.FIELD_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(_oldField2.name, " changed type from ") + "".concat(String(_oldField2.type), " to ").concat(String(newField.type), ".") + }); + } + } + } catch (err) { + _didIteratorError18 = true; + _iteratorError18 = err; + } finally { + try { + if (!_iteratorNormalCompletion18 && _iterator18.return != null) { + _iterator18.return(); + } + } finally { + if (_didIteratorError18) { + throw _iteratorError18; + } + } + } + + return schemaChanges; +} + +function findArgChanges(oldType, oldField, newField) { + var schemaChanges = []; + var argsDiff = diff(oldField.args, newField.args); + var _iteratorNormalCompletion19 = true; + var _didIteratorError19 = false; + var _iteratorError19 = undefined; + + try { + for (var _iterator19 = argsDiff.removed[Symbol.iterator](), _step19; !(_iteratorNormalCompletion19 = (_step19 = _iterator19.next()).done); _iteratorNormalCompletion19 = true) { + var oldArg = _step19.value; + schemaChanges.push({ + type: BreakingChangeType.ARG_REMOVED, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.") + }); + } + } catch (err) { + _didIteratorError19 = true; + _iteratorError19 = err; + } finally { + try { + if (!_iteratorNormalCompletion19 && _iterator19.return != null) { + _iterator19.return(); + } + } finally { + if (_didIteratorError19) { + throw _iteratorError19; + } + } + } + + var _iteratorNormalCompletion20 = true; + var _didIteratorError20 = false; + var _iteratorError20 = undefined; + + try { + for (var _iterator20 = argsDiff.persisted[Symbol.iterator](), _step20; !(_iteratorNormalCompletion20 = (_step20 = _iterator20.next()).done); _iteratorNormalCompletion20 = true) { + var _ref10 = _step20.value; + var _oldArg = _ref10[0]; + var newArg = _ref10[1]; + var isSafe = isChangeSafeForInputObjectFieldOrFieldArg(_oldArg.type, newArg.type); + + if (!isSafe) { + schemaChanges.push({ + type: BreakingChangeType.ARG_CHANGED_KIND, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed type from ") + "".concat(String(_oldArg.type), " to ").concat(String(newArg.type), ".") + }); + } else if (_oldArg.defaultValue !== undefined) { + if (newArg.defaultValue === undefined) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " defaultValue was removed.") + }); + } else { + var oldValueStr = stringifyValue(_oldArg.defaultValue, _oldArg.type); + var newValueStr = stringifyValue(newArg.defaultValue, newArg.type); + + if (oldValueStr !== newValueStr) { + schemaChanges.push({ + type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, + description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(_oldArg.name, " has changed defaultValue from ").concat(oldValueStr, " to ").concat(newValueStr, ".") + }); + } + } + } + } + } catch (err) { + _didIteratorError20 = true; + _iteratorError20 = err; + } finally { + try { + if (!_iteratorNormalCompletion20 && _iterator20.return != null) { + _iterator20.return(); + } + } finally { + if (_didIteratorError20) { + throw _iteratorError20; + } + } + } + + var _iteratorNormalCompletion21 = true; + var _didIteratorError21 = false; + var _iteratorError21 = undefined; + + try { + for (var _iterator21 = argsDiff.added[Symbol.iterator](), _step21; !(_iteratorNormalCompletion21 = (_step21 = _iterator21.next()).done); _iteratorNormalCompletion21 = true) { + var _newArg = _step21.value; + + if (isRequiredArgument(_newArg)) { + schemaChanges.push({ + type: BreakingChangeType.REQUIRED_ARG_ADDED, + description: "A required arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") + }); + } else { + schemaChanges.push({ + type: DangerousChangeType.OPTIONAL_ARG_ADDED, + description: "An optional arg ".concat(_newArg.name, " on ").concat(oldType.name, ".").concat(oldField.name, " was added.") + }); + } + } + } catch (err) { + _didIteratorError21 = true; + _iteratorError21 = err; + } finally { + try { + if (!_iteratorNormalCompletion21 && _iterator21.return != null) { + _iterator21.return(); + } + } finally { + if (_didIteratorError21) { + throw _iteratorError21; + } + } + } + + return schemaChanges; +} + +function isChangeSafeForObjectOrInterfaceField(oldType, newType) { + if (isListType(oldType)) { + return (// if they're both lists, make sure the underlying types are compatible + isListType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || // moving from nullable to non-null of the same underlying type is safe + isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); + } + + if (isNonNullType(oldType)) { + // if they're both non-null, make sure the underlying types are compatible + return isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); + } + + return (// if they're both named types, see if their names are equivalent + isNamedType(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe + isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) + ); +} + +function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { + if (isListType(oldType)) { + // if they're both lists, make sure the underlying types are compatible + return isListType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); + } + + if (isNonNullType(oldType)) { + return (// if they're both non-null, make sure the underlying types are + // compatible + isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || // moving from non-null to nullable of the same underlying type is safe + !isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) + ); + } // if they're both named types, see if their names are equivalent + + + return isNamedType(newType) && oldType.name === newType.name; +} + +function typeKindName(type) { + if (isScalarType(type)) { + return 'a Scalar type'; + } + + if (isObjectType(type)) { + return 'an Object type'; + } + + if (isInterfaceType(type)) { + return 'an Interface type'; + } + + if (isUnionType(type)) { + return 'a Union type'; + } + + if (isEnumType(type)) { + return 'an Enum type'; + } + + if (isInputObjectType(type)) { + return 'an Input type'; + } // Not reachable. All possible named types have been considered. + + /* istanbul ignore next */ + + + throw new TypeError("Unexpected type: ".concat(inspect(type), ".")); +} + +function stringifyValue(value, type) { + var ast = astFromValue(value, type); + !(ast != null) ? invariant(0) : void 0; + return print(ast); +} + +function diff(oldArray, newArray) { + var added = []; + var removed = []; + var persisted = []; + var oldMap = keyMap(oldArray, function (_ref11) { + var name = _ref11.name; + return name; + }); + var newMap = keyMap(newArray, function (_ref12) { + var name = _ref12.name; + return name; + }); + var _iteratorNormalCompletion22 = true; + var _didIteratorError22 = false; + var _iteratorError22 = undefined; + + try { + for (var _iterator22 = oldArray[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) { + var oldItem = _step22.value; + var newItem = newMap[oldItem.name]; + + if (newItem === undefined) { + removed.push(oldItem); + } else { + persisted.push([oldItem, newItem]); + } + } + } catch (err) { + _didIteratorError22 = true; + _iteratorError22 = err; + } finally { + try { + if (!_iteratorNormalCompletion22 && _iterator22.return != null) { + _iterator22.return(); + } + } finally { + if (_didIteratorError22) { + throw _iteratorError22; + } + } + } + + var _iteratorNormalCompletion23 = true; + var _didIteratorError23 = false; + var _iteratorError23 = undefined; + + try { + for (var _iterator23 = newArray[Symbol.iterator](), _step23; !(_iteratorNormalCompletion23 = (_step23 = _iterator23.next()).done); _iteratorNormalCompletion23 = true) { + var _newItem = _step23.value; + + if (oldMap[_newItem.name] === undefined) { + added.push(_newItem); + } + } + } catch (err) { + _didIteratorError23 = true; + _iteratorError23 = err; + } finally { + try { + if (!_iteratorNormalCompletion23 && _iterator23.return != null) { + _iterator23.return(); + } + } finally { + if (_didIteratorError23) { + throw _iteratorError23; + } + } + } + + return { + added: added, + persisted: persisted, + removed: removed + }; +} diff --git a/node_modules/graphql/utilities/findDeprecatedUsages.js b/node_modules/graphql/utilities/findDeprecatedUsages.js new file mode 100644 index 000000000..b8a3c31c2 --- /dev/null +++ b/node_modules/graphql/utilities/findDeprecatedUsages.js @@ -0,0 +1,51 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findDeprecatedUsages = findDeprecatedUsages; + +var _GraphQLError = require("../error/GraphQLError"); + +var _visitor = require("../language/visitor"); + +var _definition = require("../type/definition"); + +var _TypeInfo = require("./TypeInfo"); + +/** + * A validation rule which reports deprecated usages. + * + * Returns a list of GraphQLError instances describing each deprecated use. + */ +function findDeprecatedUsages(schema, ast) { + var errors = []; + var typeInfo = new _TypeInfo.TypeInfo(schema); + (0, _visitor.visit)(ast, (0, _visitor.visitWithTypeInfo)(typeInfo, { + Field: function Field(node) { + var fieldDef = typeInfo.getFieldDef(); + + if (fieldDef && fieldDef.isDeprecated) { + var parentType = typeInfo.getParentType(); + + if (parentType) { + var reason = fieldDef.deprecationReason; + errors.push(new _GraphQLError.GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); + } + } + }, + EnumValue: function EnumValue(node) { + var enumVal = typeInfo.getEnumValue(); + + if (enumVal && enumVal.isDeprecated) { + var type = (0, _definition.getNamedType)(typeInfo.getInputType()); + + if (type) { + var reason = enumVal.deprecationReason; + errors.push(new _GraphQLError.GraphQLError("The enum value ".concat(type.name, ".").concat(enumVal.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); + } + } + } + })); + return errors; +} diff --git a/node_modules/graphql/utilities/findDeprecatedUsages.js.flow b/node_modules/graphql/utilities/findDeprecatedUsages.js.flow new file mode 100644 index 000000000..7be101eae --- /dev/null +++ b/node_modules/graphql/utilities/findDeprecatedUsages.js.flow @@ -0,0 +1,61 @@ +// @flow strict + +import { GraphQLError } from '../error/GraphQLError'; +import { visit, visitWithTypeInfo } from '../language/visitor'; +import { type DocumentNode } from '../language/ast'; +import { getNamedType } from '../type/definition'; +import { type GraphQLSchema } from '../type/schema'; +import { TypeInfo } from './TypeInfo'; + +/** + * A validation rule which reports deprecated usages. + * + * Returns a list of GraphQLError instances describing each deprecated use. + */ +export function findDeprecatedUsages( + schema: GraphQLSchema, + ast: DocumentNode, +): Array { + const errors = []; + const typeInfo = new TypeInfo(schema); + + visit( + ast, + visitWithTypeInfo(typeInfo, { + Field(node) { + const fieldDef = typeInfo.getFieldDef(); + if (fieldDef && fieldDef.isDeprecated) { + const parentType = typeInfo.getParentType(); + if (parentType) { + const reason = fieldDef.deprecationReason; + errors.push( + new GraphQLError( + `The field ${parentType.name}.${fieldDef.name} is deprecated.` + + (reason ? ' ' + reason : ''), + node, + ), + ); + } + } + }, + EnumValue(node) { + const enumVal = typeInfo.getEnumValue(); + if (enumVal && enumVal.isDeprecated) { + const type = getNamedType(typeInfo.getInputType()); + if (type) { + const reason = enumVal.deprecationReason; + errors.push( + new GraphQLError( + `The enum value ${type.name}.${enumVal.name} is deprecated.` + + (reason ? ' ' + reason : ''), + node, + ), + ); + } + } + }, + }), + ); + + return errors; +} diff --git a/node_modules/graphql/utilities/findDeprecatedUsages.mjs b/node_modules/graphql/utilities/findDeprecatedUsages.mjs new file mode 100644 index 000000000..d3c819e0e --- /dev/null +++ b/node_modules/graphql/utilities/findDeprecatedUsages.mjs @@ -0,0 +1,41 @@ +import { GraphQLError } from '../error/GraphQLError'; +import { visit, visitWithTypeInfo } from '../language/visitor'; +import { getNamedType } from '../type/definition'; +import { TypeInfo } from './TypeInfo'; +/** + * A validation rule which reports deprecated usages. + * + * Returns a list of GraphQLError instances describing each deprecated use. + */ + +export function findDeprecatedUsages(schema, ast) { + var errors = []; + var typeInfo = new TypeInfo(schema); + visit(ast, visitWithTypeInfo(typeInfo, { + Field: function Field(node) { + var fieldDef = typeInfo.getFieldDef(); + + if (fieldDef && fieldDef.isDeprecated) { + var parentType = typeInfo.getParentType(); + + if (parentType) { + var reason = fieldDef.deprecationReason; + errors.push(new GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); + } + } + }, + EnumValue: function EnumValue(node) { + var enumVal = typeInfo.getEnumValue(); + + if (enumVal && enumVal.isDeprecated) { + var type = getNamedType(typeInfo.getInputType()); + + if (type) { + var reason = enumVal.deprecationReason; + errors.push(new GraphQLError("The enum value ".concat(type.name, ".").concat(enumVal.name, " is deprecated.") + (reason ? ' ' + reason : ''), node)); + } + } + } + })); + return errors; +} diff --git a/node_modules/graphql/utilities/getOperationAST.js b/node_modules/graphql/utilities/getOperationAST.js new file mode 100644 index 000000000..020d1d4a4 --- /dev/null +++ b/node_modules/graphql/utilities/getOperationAST.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getOperationAST = getOperationAST; + +var _kinds = require("../language/kinds"); + +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + */ +function getOperationAST(documentAST, operationName) { + var operation = null; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var definition = _step.value; + + if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) { + if (!operationName) { + // If no operation name was provided, only return an Operation if there + // is one defined in the document. Upon encountering the second, return + // null. + if (operation) { + return null; + } + + operation = definition; + } else if (definition.name && definition.name.value === operationName) { + return definition; + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return operation; +} diff --git a/node_modules/graphql/utilities/getOperationAST.js.flow b/node_modules/graphql/utilities/getOperationAST.js.flow new file mode 100644 index 000000000..5cb9986eb --- /dev/null +++ b/node_modules/graphql/utilities/getOperationAST.js.flow @@ -0,0 +1,35 @@ +// @flow strict + +import { Kind } from '../language/kinds'; +import { + type DocumentNode, + type OperationDefinitionNode, +} from '../language/ast'; + +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + */ +export function getOperationAST( + documentAST: DocumentNode, + operationName: ?string, +): ?OperationDefinitionNode { + let operation = null; + for (const definition of documentAST.definitions) { + if (definition.kind === Kind.OPERATION_DEFINITION) { + if (!operationName) { + // If no operation name was provided, only return an Operation if there + // is one defined in the document. Upon encountering the second, return + // null. + if (operation) { + return null; + } + operation = definition; + } else if (definition.name && definition.name.value === operationName) { + return definition; + } + } + } + return operation; +} diff --git a/node_modules/graphql/utilities/getOperationAST.mjs b/node_modules/graphql/utilities/getOperationAST.mjs new file mode 100644 index 000000000..066691b03 --- /dev/null +++ b/node_modules/graphql/utilities/getOperationAST.mjs @@ -0,0 +1,49 @@ +import { Kind } from '../language/kinds'; + +/** + * Returns an operation AST given a document AST and optionally an operation + * name. If a name is not provided, an operation is only returned if only one is + * provided in the document. + */ +export function getOperationAST(documentAST, operationName) { + var operation = null; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var definition = _step.value; + + if (definition.kind === Kind.OPERATION_DEFINITION) { + if (!operationName) { + // If no operation name was provided, only return an Operation if there + // is one defined in the document. Upon encountering the second, return + // null. + if (operation) { + return null; + } + + operation = definition; + } else if (definition.name && definition.name.value === operationName) { + return definition; + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return operation; +} diff --git a/node_modules/graphql/utilities/getOperationRootType.js b/node_modules/graphql/utilities/getOperationRootType.js new file mode 100644 index 000000000..8e7ca1bbc --- /dev/null +++ b/node_modules/graphql/utilities/getOperationRootType.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getOperationRootType = getOperationRootType; + +var _GraphQLError = require("../error/GraphQLError"); + +/** + * Extracts the root type of the operation from the schema. + */ +function getOperationRootType(schema, operation) { + if (operation.operation === 'query') { + var queryType = schema.getQueryType(); + + if (!queryType) { + throw new _GraphQLError.GraphQLError('Schema does not define the required query root type.', operation); + } + + return queryType; + } + + if (operation.operation === 'mutation') { + var mutationType = schema.getMutationType(); + + if (!mutationType) { + throw new _GraphQLError.GraphQLError('Schema is not configured for mutations.', operation); + } + + return mutationType; + } + + if (operation.operation === 'subscription') { + var subscriptionType = schema.getSubscriptionType(); + + if (!subscriptionType) { + throw new _GraphQLError.GraphQLError('Schema is not configured for subscriptions.', operation); + } + + return subscriptionType; + } + + throw new _GraphQLError.GraphQLError('Can only have query, mutation and subscription operations.', operation); +} diff --git a/node_modules/graphql/utilities/getOperationRootType.js.flow b/node_modules/graphql/utilities/getOperationRootType.js.flow new file mode 100644 index 000000000..9ac9c0313 --- /dev/null +++ b/node_modules/graphql/utilities/getOperationRootType.js.flow @@ -0,0 +1,55 @@ +// @flow strict + +import { GraphQLError } from '../error/GraphQLError'; +import { + type OperationDefinitionNode, + type OperationTypeDefinitionNode, +} from '../language/ast'; +import { type GraphQLSchema } from '../type/schema'; +import { type GraphQLObjectType } from '../type/definition'; + +/** + * Extracts the root type of the operation from the schema. + */ +export function getOperationRootType( + schema: GraphQLSchema, + operation: OperationDefinitionNode | OperationTypeDefinitionNode, +): GraphQLObjectType { + if (operation.operation === 'query') { + const queryType = schema.getQueryType(); + if (!queryType) { + throw new GraphQLError( + 'Schema does not define the required query root type.', + operation, + ); + } + return queryType; + } + + if (operation.operation === 'mutation') { + const mutationType = schema.getMutationType(); + if (!mutationType) { + throw new GraphQLError( + 'Schema is not configured for mutations.', + operation, + ); + } + return mutationType; + } + + if (operation.operation === 'subscription') { + const subscriptionType = schema.getSubscriptionType(); + if (!subscriptionType) { + throw new GraphQLError( + 'Schema is not configured for subscriptions.', + operation, + ); + } + return subscriptionType; + } + + throw new GraphQLError( + 'Can only have query, mutation and subscription operations.', + operation, + ); +} diff --git a/node_modules/graphql/utilities/getOperationRootType.mjs b/node_modules/graphql/utilities/getOperationRootType.mjs new file mode 100644 index 000000000..c3cb4e86d --- /dev/null +++ b/node_modules/graphql/utilities/getOperationRootType.mjs @@ -0,0 +1,38 @@ +import { GraphQLError } from '../error/GraphQLError'; + +/** + * Extracts the root type of the operation from the schema. + */ +export function getOperationRootType(schema, operation) { + if (operation.operation === 'query') { + var queryType = schema.getQueryType(); + + if (!queryType) { + throw new GraphQLError('Schema does not define the required query root type.', operation); + } + + return queryType; + } + + if (operation.operation === 'mutation') { + var mutationType = schema.getMutationType(); + + if (!mutationType) { + throw new GraphQLError('Schema is not configured for mutations.', operation); + } + + return mutationType; + } + + if (operation.operation === 'subscription') { + var subscriptionType = schema.getSubscriptionType(); + + if (!subscriptionType) { + throw new GraphQLError('Schema is not configured for subscriptions.', operation); + } + + return subscriptionType; + } + + throw new GraphQLError('Can only have query, mutation and subscription operations.', operation); +} diff --git a/node_modules/graphql/utilities/index.js b/node_modules/graphql/utilities/index.js new file mode 100644 index 000000000..7ec402a77 --- /dev/null +++ b/node_modules/graphql/utilities/index.js @@ -0,0 +1,263 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "getIntrospectionQuery", { + enumerable: true, + get: function get() { + return _introspectionQuery.getIntrospectionQuery; + } +}); +Object.defineProperty(exports, "introspectionQuery", { + enumerable: true, + get: function get() { + return _introspectionQuery.introspectionQuery; + } +}); +Object.defineProperty(exports, "getOperationAST", { + enumerable: true, + get: function get() { + return _getOperationAST.getOperationAST; + } +}); +Object.defineProperty(exports, "getOperationRootType", { + enumerable: true, + get: function get() { + return _getOperationRootType.getOperationRootType; + } +}); +Object.defineProperty(exports, "introspectionFromSchema", { + enumerable: true, + get: function get() { + return _introspectionFromSchema.introspectionFromSchema; + } +}); +Object.defineProperty(exports, "buildClientSchema", { + enumerable: true, + get: function get() { + return _buildClientSchema.buildClientSchema; + } +}); +Object.defineProperty(exports, "buildASTSchema", { + enumerable: true, + get: function get() { + return _buildASTSchema.buildASTSchema; + } +}); +Object.defineProperty(exports, "buildSchema", { + enumerable: true, + get: function get() { + return _buildASTSchema.buildSchema; + } +}); +Object.defineProperty(exports, "getDescription", { + enumerable: true, + get: function get() { + return _buildASTSchema.getDescription; + } +}); +Object.defineProperty(exports, "extendSchema", { + enumerable: true, + get: function get() { + return _extendSchema.extendSchema; + } +}); +Object.defineProperty(exports, "lexicographicSortSchema", { + enumerable: true, + get: function get() { + return _lexicographicSortSchema.lexicographicSortSchema; + } +}); +Object.defineProperty(exports, "printSchema", { + enumerable: true, + get: function get() { + return _schemaPrinter.printSchema; + } +}); +Object.defineProperty(exports, "printType", { + enumerable: true, + get: function get() { + return _schemaPrinter.printType; + } +}); +Object.defineProperty(exports, "printIntrospectionSchema", { + enumerable: true, + get: function get() { + return _schemaPrinter.printIntrospectionSchema; + } +}); +Object.defineProperty(exports, "typeFromAST", { + enumerable: true, + get: function get() { + return _typeFromAST.typeFromAST; + } +}); +Object.defineProperty(exports, "valueFromAST", { + enumerable: true, + get: function get() { + return _valueFromAST.valueFromAST; + } +}); +Object.defineProperty(exports, "valueFromASTUntyped", { + enumerable: true, + get: function get() { + return _valueFromASTUntyped.valueFromASTUntyped; + } +}); +Object.defineProperty(exports, "astFromValue", { + enumerable: true, + get: function get() { + return _astFromValue.astFromValue; + } +}); +Object.defineProperty(exports, "TypeInfo", { + enumerable: true, + get: function get() { + return _TypeInfo.TypeInfo; + } +}); +Object.defineProperty(exports, "coerceValue", { + enumerable: true, + get: function get() { + return _coerceValue.coerceValue; + } +}); +Object.defineProperty(exports, "isValidJSValue", { + enumerable: true, + get: function get() { + return _isValidJSValue.isValidJSValue; + } +}); +Object.defineProperty(exports, "isValidLiteralValue", { + enumerable: true, + get: function get() { + return _isValidLiteralValue.isValidLiteralValue; + } +}); +Object.defineProperty(exports, "concatAST", { + enumerable: true, + get: function get() { + return _concatAST.concatAST; + } +}); +Object.defineProperty(exports, "separateOperations", { + enumerable: true, + get: function get() { + return _separateOperations.separateOperations; + } +}); +Object.defineProperty(exports, "stripIgnoredCharacters", { + enumerable: true, + get: function get() { + return _stripIgnoredCharacters.stripIgnoredCharacters; + } +}); +Object.defineProperty(exports, "isEqualType", { + enumerable: true, + get: function get() { + return _typeComparators.isEqualType; + } +}); +Object.defineProperty(exports, "isTypeSubTypeOf", { + enumerable: true, + get: function get() { + return _typeComparators.isTypeSubTypeOf; + } +}); +Object.defineProperty(exports, "doTypesOverlap", { + enumerable: true, + get: function get() { + return _typeComparators.doTypesOverlap; + } +}); +Object.defineProperty(exports, "assertValidName", { + enumerable: true, + get: function get() { + return _assertValidName.assertValidName; + } +}); +Object.defineProperty(exports, "isValidNameError", { + enumerable: true, + get: function get() { + return _assertValidName.isValidNameError; + } +}); +Object.defineProperty(exports, "BreakingChangeType", { + enumerable: true, + get: function get() { + return _findBreakingChanges.BreakingChangeType; + } +}); +Object.defineProperty(exports, "DangerousChangeType", { + enumerable: true, + get: function get() { + return _findBreakingChanges.DangerousChangeType; + } +}); +Object.defineProperty(exports, "findBreakingChanges", { + enumerable: true, + get: function get() { + return _findBreakingChanges.findBreakingChanges; + } +}); +Object.defineProperty(exports, "findDangerousChanges", { + enumerable: true, + get: function get() { + return _findBreakingChanges.findDangerousChanges; + } +}); +Object.defineProperty(exports, "findDeprecatedUsages", { + enumerable: true, + get: function get() { + return _findDeprecatedUsages.findDeprecatedUsages; + } +}); + +var _introspectionQuery = require("./introspectionQuery"); + +var _getOperationAST = require("./getOperationAST"); + +var _getOperationRootType = require("./getOperationRootType"); + +var _introspectionFromSchema = require("./introspectionFromSchema"); + +var _buildClientSchema = require("./buildClientSchema"); + +var _buildASTSchema = require("./buildASTSchema"); + +var _extendSchema = require("./extendSchema"); + +var _lexicographicSortSchema = require("./lexicographicSortSchema"); + +var _schemaPrinter = require("./schemaPrinter"); + +var _typeFromAST = require("./typeFromAST"); + +var _valueFromAST = require("./valueFromAST"); + +var _valueFromASTUntyped = require("./valueFromASTUntyped"); + +var _astFromValue = require("./astFromValue"); + +var _TypeInfo = require("./TypeInfo"); + +var _coerceValue = require("./coerceValue"); + +var _isValidJSValue = require("./isValidJSValue"); + +var _isValidLiteralValue = require("./isValidLiteralValue"); + +var _concatAST = require("./concatAST"); + +var _separateOperations = require("./separateOperations"); + +var _stripIgnoredCharacters = require("./stripIgnoredCharacters"); + +var _typeComparators = require("./typeComparators"); + +var _assertValidName = require("./assertValidName"); + +var _findBreakingChanges = require("./findBreakingChanges"); + +var _findDeprecatedUsages = require("./findDeprecatedUsages"); diff --git a/node_modules/graphql/utilities/index.js.flow b/node_modules/graphql/utilities/index.js.flow new file mode 100644 index 000000000..636c98dad --- /dev/null +++ b/node_modules/graphql/utilities/index.js.flow @@ -0,0 +1,127 @@ +// @flow strict + +// The GraphQL query recommended for a full schema introspection. +export { + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // @deprecated, use getIntrospectionQuery() - will be removed in v15. + introspectionQuery, +} from './introspectionQuery'; + +export type { + IntrospectionOptions, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, + IntrospectionEnumType, + IntrospectionInputObjectType, + IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, + IntrospectionNamedTypeRef, + IntrospectionListTypeRef, + IntrospectionNonNullTypeRef, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, +} from './introspectionQuery'; + +// Gets the target Operation from a Document. +export { getOperationAST } from './getOperationAST'; + +// Gets the Type for the target Operation AST. +export { getOperationRootType } from './getOperationRootType'; + +// Convert a GraphQLSchema to an IntrospectionQuery. +export { introspectionFromSchema } from './introspectionFromSchema'; + +// Build a GraphQLSchema from an introspection result. +export { buildClientSchema } from './buildClientSchema'; + +// Build a GraphQLSchema from GraphQL Schema language. +export { + buildASTSchema, + buildSchema, + // @deprecated: Get the description from a schema AST node and supports legacy + // syntax for specifying descriptions - will be removed in v16. + getDescription, +} from './buildASTSchema'; +export type { BuildSchemaOptions } from './buildASTSchema'; + +// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. +export { extendSchema } from './extendSchema'; + +// Sort a GraphQLSchema. +export { lexicographicSortSchema } from './lexicographicSortSchema'; + +// Print a GraphQLSchema to GraphQL Schema language. +export { + printSchema, + printType, + printIntrospectionSchema, +} from './schemaPrinter'; + +// Create a GraphQLType from a GraphQL language AST. +export { typeFromAST } from './typeFromAST'; + +// Create a JavaScript value from a GraphQL language AST with a type. +export { valueFromAST } from './valueFromAST'; + +// Create a JavaScript value from a GraphQL language AST without a type. +export { valueFromASTUntyped } from './valueFromASTUntyped'; + +// Create a GraphQL language AST from a JavaScript value. +export { astFromValue } from './astFromValue'; + +// A helper to use within recursive-descent visitors which need to be aware of +// the GraphQL type system. +export { TypeInfo } from './TypeInfo'; + +// Coerces a JavaScript value to a GraphQL type, or produces errors. +export { coerceValue } from './coerceValue'; + +// @deprecated use coerceValue - will be removed in v15. +export { isValidJSValue } from './isValidJSValue'; + +// @deprecated use validation - will be removed in v15 +export { isValidLiteralValue } from './isValidLiteralValue'; + +// Concatenates multiple AST together. +export { concatAST } from './concatAST'; + +// Separates an AST into an AST per Operation. +export { separateOperations } from './separateOperations'; + +// Strips characters that are not significant to the validity or execution +// of a GraphQL document. +export { stripIgnoredCharacters } from './stripIgnoredCharacters'; + +// Comparators for types +export { + isEqualType, + isTypeSubTypeOf, + doTypesOverlap, +} from './typeComparators'; + +// Asserts that a string is a valid GraphQL name +export { assertValidName, isValidNameError } from './assertValidName'; + +// Compares two GraphQLSchemas and detects breaking changes. +export { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, +} from './findBreakingChanges'; +export type { BreakingChange, DangerousChange } from './findBreakingChanges'; + +// Report all deprecated usage within a GraphQL document. +export { findDeprecatedUsages } from './findDeprecatedUsages'; diff --git a/node_modules/graphql/utilities/index.mjs b/node_modules/graphql/utilities/index.mjs new file mode 100644 index 000000000..efc9347d1 --- /dev/null +++ b/node_modules/graphql/utilities/index.mjs @@ -0,0 +1,55 @@ +// The GraphQL query recommended for a full schema introspection. +export { // Produce the GraphQL query recommended for a full schema introspection. +// Accepts optional IntrospectionOptions. +getIntrospectionQuery, // @deprecated, use getIntrospectionQuery() - will be removed in v15. +introspectionQuery } from './introspectionQuery'; +// Gets the target Operation from a Document. +export { getOperationAST } from './getOperationAST'; // Gets the Type for the target Operation AST. + +export { getOperationRootType } from './getOperationRootType'; // Convert a GraphQLSchema to an IntrospectionQuery. + +export { introspectionFromSchema } from './introspectionFromSchema'; // Build a GraphQLSchema from an introspection result. + +export { buildClientSchema } from './buildClientSchema'; // Build a GraphQLSchema from GraphQL Schema language. + +export { buildASTSchema, buildSchema, // @deprecated: Get the description from a schema AST node and supports legacy +// syntax for specifying descriptions - will be removed in v16. +getDescription } from './buildASTSchema'; +// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. +export { extendSchema } from './extendSchema'; // Sort a GraphQLSchema. + +export { lexicographicSortSchema } from './lexicographicSortSchema'; // Print a GraphQLSchema to GraphQL Schema language. + +export { printSchema, printType, printIntrospectionSchema } from './schemaPrinter'; // Create a GraphQLType from a GraphQL language AST. + +export { typeFromAST } from './typeFromAST'; // Create a JavaScript value from a GraphQL language AST with a type. + +export { valueFromAST } from './valueFromAST'; // Create a JavaScript value from a GraphQL language AST without a type. + +export { valueFromASTUntyped } from './valueFromASTUntyped'; // Create a GraphQL language AST from a JavaScript value. + +export { astFromValue } from './astFromValue'; // A helper to use within recursive-descent visitors which need to be aware of +// the GraphQL type system. + +export { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors. + +export { coerceValue } from './coerceValue'; // @deprecated use coerceValue - will be removed in v15. + +export { isValidJSValue } from './isValidJSValue'; // @deprecated use validation - will be removed in v15 + +export { isValidLiteralValue } from './isValidLiteralValue'; // Concatenates multiple AST together. + +export { concatAST } from './concatAST'; // Separates an AST into an AST per Operation. + +export { separateOperations } from './separateOperations'; // Strips characters that are not significant to the validity or execution +// of a GraphQL document. + +export { stripIgnoredCharacters } from './stripIgnoredCharacters'; // Comparators for types + +export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from './typeComparators'; // Asserts that a string is a valid GraphQL name + +export { assertValidName, isValidNameError } from './assertValidName'; // Compares two GraphQLSchemas and detects breaking changes. + +export { BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges } from './findBreakingChanges'; +// Report all deprecated usage within a GraphQL document. +export { findDeprecatedUsages } from './findDeprecatedUsages'; diff --git a/node_modules/graphql/utilities/introspectionFromSchema.js b/node_modules/graphql/utilities/introspectionFromSchema.js new file mode 100644 index 000000000..a3b64bfc3 --- /dev/null +++ b/node_modules/graphql/utilities/introspectionFromSchema.js @@ -0,0 +1,34 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.introspectionFromSchema = introspectionFromSchema; + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _isPromise = _interopRequireDefault(require("../jsutils/isPromise")); + +var _execute = require("../execution/execute"); + +var _parser = require("../language/parser"); + +var _introspectionQuery = require("./introspectionQuery"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +function introspectionFromSchema(schema, options) { + var queryAST = (0, _parser.parse)((0, _introspectionQuery.getIntrospectionQuery)(options)); + var result = (0, _execute.execute)(schema, queryAST); + !(!(0, _isPromise.default)(result) && !result.errors && result.data) ? (0, _invariant.default)(0) : void 0; + return result.data; +} diff --git a/node_modules/graphql/utilities/introspectionFromSchema.js.flow b/node_modules/graphql/utilities/introspectionFromSchema.js.flow new file mode 100644 index 000000000..c67ec78b0 --- /dev/null +++ b/node_modules/graphql/utilities/introspectionFromSchema.js.flow @@ -0,0 +1,31 @@ +// @flow strict + +import invariant from '../jsutils/invariant'; +import isPromise from '../jsutils/isPromise'; +import { type GraphQLSchema } from '../type/schema'; +import { execute } from '../execution/execute'; +import { parse } from '../language/parser'; +import { + type IntrospectionQuery, + type IntrospectionOptions, + getIntrospectionQuery, +} from './introspectionQuery'; + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +export function introspectionFromSchema( + schema: GraphQLSchema, + options?: IntrospectionOptions, +): IntrospectionQuery { + const queryAST = parse(getIntrospectionQuery(options)); + const result = execute(schema, queryAST); + invariant(!isPromise(result) && !result.errors && result.data); + return (result.data: any); +} diff --git a/node_modules/graphql/utilities/introspectionFromSchema.mjs b/node_modules/graphql/utilities/introspectionFromSchema.mjs new file mode 100644 index 000000000..c0f17d0a7 --- /dev/null +++ b/node_modules/graphql/utilities/introspectionFromSchema.mjs @@ -0,0 +1,21 @@ +import invariant from '../jsutils/invariant'; +import isPromise from '../jsutils/isPromise'; +import { execute } from '../execution/execute'; +import { parse } from '../language/parser'; +import { getIntrospectionQuery } from './introspectionQuery'; +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ + +export function introspectionFromSchema(schema, options) { + var queryAST = parse(getIntrospectionQuery(options)); + var result = execute(schema, queryAST); + !(!isPromise(result) && !result.errors && result.data) ? invariant(0) : void 0; + return result.data; +} diff --git a/node_modules/graphql/utilities/introspectionQuery.js b/node_modules/graphql/utilities/introspectionQuery.js new file mode 100644 index 000000000..a39622dab --- /dev/null +++ b/node_modules/graphql/utilities/introspectionQuery.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getIntrospectionQuery = getIntrospectionQuery; +exports.introspectionQuery = void 0; + +function getIntrospectionQuery(options) { + var descriptions = !(options && options.descriptions === false); + return "\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ".concat(descriptions ? 'description' : '', "\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(descriptions ? 'description' : '', "\n fields(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(descriptions ? 'description' : '', "\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n "); +} +/** + * Deprecated, call getIntrospectionQuery directly. + * + * This function will be removed in v15 + */ + + +var introspectionQuery = getIntrospectionQuery(); +exports.introspectionQuery = introspectionQuery; diff --git a/node_modules/graphql/utilities/introspectionQuery.js.flow b/node_modules/graphql/utilities/introspectionQuery.js.flow new file mode 100644 index 000000000..ca55e8a1f --- /dev/null +++ b/node_modules/graphql/utilities/introspectionQuery.js.flow @@ -0,0 +1,278 @@ +// @flow strict + +import { type DirectiveLocationEnum } from '../language/directiveLocation'; + +export type IntrospectionOptions = {| + // Whether to include descriptions in the introspection result. + // Default: true + descriptions: boolean, +|}; + +export function getIntrospectionQuery(options?: IntrospectionOptions): string { + const descriptions = !(options && options.descriptions === false); + return ` + query IntrospectionQuery { + __schema { + queryType { name } + mutationType { name } + subscriptionType { name } + types { + ...FullType + } + directives { + name + ${descriptions ? 'description' : ''} + locations + args { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${descriptions ? 'description' : ''} + fields(includeDeprecated: true) { + name + ${descriptions ? 'description' : ''} + args { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${descriptions ? 'description' : ''} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${descriptions ? 'description' : ''} + type { ...TypeRef } + defaultValue + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + `; +} + +/** + * Deprecated, call getIntrospectionQuery directly. + * + * This function will be removed in v15 + */ +export const introspectionQuery = getIntrospectionQuery(); + +export type IntrospectionQuery = {| + +__schema: IntrospectionSchema, +|}; + +export type IntrospectionSchema = {| + +queryType: IntrospectionNamedTypeRef, + +mutationType: ?IntrospectionNamedTypeRef, + +subscriptionType: ?IntrospectionNamedTypeRef, + +types: $ReadOnlyArray, + +directives: $ReadOnlyArray, +|}; + +export type IntrospectionType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType + | IntrospectionInputObjectType; + +export type IntrospectionOutputType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType; + +export type IntrospectionInputType = + | IntrospectionScalarType + | IntrospectionEnumType + | IntrospectionInputObjectType; + +export type IntrospectionScalarType = { + +kind: 'SCALAR', + +name: string, + +description?: ?string, + ... +}; + +export type IntrospectionObjectType = { + +kind: 'OBJECT', + +name: string, + +description?: ?string, + +fields: $ReadOnlyArray, + +interfaces: $ReadOnlyArray< + IntrospectionNamedTypeRef, + >, + ... +}; + +export type IntrospectionInterfaceType = { + +kind: 'INTERFACE', + +name: string, + +description?: ?string, + +fields: $ReadOnlyArray, + +possibleTypes: $ReadOnlyArray< + IntrospectionNamedTypeRef, + >, + ... +}; + +export type IntrospectionUnionType = { + +kind: 'UNION', + +name: string, + +description?: ?string, + +possibleTypes: $ReadOnlyArray< + IntrospectionNamedTypeRef, + >, + ... +}; + +export type IntrospectionEnumType = { + +kind: 'ENUM', + +name: string, + +description?: ?string, + +enumValues: $ReadOnlyArray, + ... +}; + +export type IntrospectionInputObjectType = { + +kind: 'INPUT_OBJECT', + +name: string, + +description?: ?string, + +inputFields: $ReadOnlyArray, + ... +}; + +export type IntrospectionListTypeRef< + T: IntrospectionTypeRef = IntrospectionTypeRef, +> = { + +kind: 'LIST', + +ofType: T, + ... +}; + +export type IntrospectionNonNullTypeRef< + T: IntrospectionTypeRef = IntrospectionTypeRef, +> = { + +kind: 'NON_NULL', + +ofType: T, + ... +}; + +export type IntrospectionTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef, + >; + +export type IntrospectionOutputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef, + >; + +export type IntrospectionInputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef< + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef, + >; + +export type IntrospectionNamedTypeRef< + T: IntrospectionType = IntrospectionType, +> = { + +kind: $PropertyType, + +name: string, + ... +}; + +export type IntrospectionField = {| + +name: string, + +description?: ?string, + +args: $ReadOnlyArray, + +type: IntrospectionOutputTypeRef, + +isDeprecated: boolean, + +deprecationReason: ?string, +|}; + +export type IntrospectionInputValue = {| + +name: string, + +description?: ?string, + +type: IntrospectionInputTypeRef, + +defaultValue: ?string, +|}; + +export type IntrospectionEnumValue = {| + +name: string, + +description?: ?string, + +isDeprecated: boolean, + +deprecationReason: ?string, +|}; + +export type IntrospectionDirective = {| + +name: string, + +description?: ?string, + +locations: $ReadOnlyArray, + +args: $ReadOnlyArray, +|}; diff --git a/node_modules/graphql/utilities/introspectionQuery.mjs b/node_modules/graphql/utilities/introspectionQuery.mjs new file mode 100644 index 000000000..7105f6b84 --- /dev/null +++ b/node_modules/graphql/utilities/introspectionQuery.mjs @@ -0,0 +1,11 @@ +export function getIntrospectionQuery(options) { + var descriptions = !(options && options.descriptions === false); + return "\n query IntrospectionQuery {\n __schema {\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ".concat(descriptions ? 'description' : '', "\n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(descriptions ? 'description' : '', "\n fields(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(descriptions ? 'description' : '', "\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(descriptions ? 'description' : '', "\n type { ...TypeRef }\n defaultValue\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n "); +} +/** + * Deprecated, call getIntrospectionQuery directly. + * + * This function will be removed in v15 + */ + +export var introspectionQuery = getIntrospectionQuery(); diff --git a/node_modules/graphql/utilities/isValidJSValue.js b/node_modules/graphql/utilities/isValidJSValue.js new file mode 100644 index 000000000..0f474bef1 --- /dev/null +++ b/node_modules/graphql/utilities/isValidJSValue.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isValidJSValue = isValidJSValue; + +var _coerceValue = require("./coerceValue"); + +/* istanbul ignore file */ + +/** + * Deprecated. Use coerceValue() directly for richer information. + * + * This function will be removed in v15 + */ +function isValidJSValue(value, type) { + var errors = (0, _coerceValue.coerceValue)(value, type).errors; + return errors ? errors.map(function (error) { + return error.message; + }) : []; +} diff --git a/node_modules/graphql/utilities/isValidJSValue.js.flow b/node_modules/graphql/utilities/isValidJSValue.js.flow new file mode 100644 index 000000000..5d0a84bf3 --- /dev/null +++ b/node_modules/graphql/utilities/isValidJSValue.js.flow @@ -0,0 +1,18 @@ +// @flow strict + +/* istanbul ignore file */ +import { coerceValue } from './coerceValue'; +import { type GraphQLInputType } from '../type/definition'; + +/** + * Deprecated. Use coerceValue() directly for richer information. + * + * This function will be removed in v15 + */ +export function isValidJSValue( + value: mixed, + type: GraphQLInputType, +): Array { + const errors = coerceValue(value, type).errors; + return errors ? errors.map(error => error.message) : []; +} diff --git a/node_modules/graphql/utilities/isValidJSValue.mjs b/node_modules/graphql/utilities/isValidJSValue.mjs new file mode 100644 index 000000000..7695cf627 --- /dev/null +++ b/node_modules/graphql/utilities/isValidJSValue.mjs @@ -0,0 +1,14 @@ +/* istanbul ignore file */ +import { coerceValue } from './coerceValue'; + +/** + * Deprecated. Use coerceValue() directly for richer information. + * + * This function will be removed in v15 + */ +export function isValidJSValue(value, type) { + var errors = coerceValue(value, type).errors; + return errors ? errors.map(function (error) { + return error.message; + }) : []; +} diff --git a/node_modules/graphql/utilities/isValidLiteralValue.js b/node_modules/graphql/utilities/isValidLiteralValue.js new file mode 100644 index 000000000..36187bd2d --- /dev/null +++ b/node_modules/graphql/utilities/isValidLiteralValue.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isValidLiteralValue = isValidLiteralValue; + +var _TypeInfo = require("./TypeInfo"); + +var _kinds = require("../language/kinds"); + +var _visitor = require("../language/visitor"); + +var _schema = require("../type/schema"); + +var _ValuesOfCorrectType = require("../validation/rules/ValuesOfCorrectType"); + +var _ValidationContext = require("../validation/ValidationContext"); + +/** + * Utility which determines if a value literal node is valid for an input type. + * + * Deprecated. Rely on validation for documents containing literal values. + * + * This function will be removed in v15 + */ +function isValidLiteralValue(type, valueNode) { + var emptySchema = new _schema.GraphQLSchema({}); + var emptyDoc = { + kind: _kinds.Kind.DOCUMENT, + definitions: [] + }; + var typeInfo = new _TypeInfo.TypeInfo(emptySchema, undefined, type); + var context = new _ValidationContext.ValidationContext(emptySchema, emptyDoc, typeInfo); + var visitor = (0, _ValuesOfCorrectType.ValuesOfCorrectType)(context); + (0, _visitor.visit)(valueNode, (0, _visitor.visitWithTypeInfo)(typeInfo, visitor)); + return context.getErrors(); +} diff --git a/node_modules/graphql/utilities/isValidLiteralValue.js.flow b/node_modules/graphql/utilities/isValidLiteralValue.js.flow new file mode 100644 index 000000000..24cdefd00 --- /dev/null +++ b/node_modules/graphql/utilities/isValidLiteralValue.js.flow @@ -0,0 +1,31 @@ +// @flow strict + +import { TypeInfo } from './TypeInfo'; +import { type GraphQLError } from '../error/GraphQLError'; +import { type ValueNode } from '../language/ast'; +import { Kind } from '../language/kinds'; +import { visit, visitWithTypeInfo } from '../language/visitor'; +import { type GraphQLInputType } from '../type/definition'; +import { GraphQLSchema } from '../type/schema'; +import { ValuesOfCorrectType } from '../validation/rules/ValuesOfCorrectType'; +import { ValidationContext } from '../validation/ValidationContext'; + +/** + * Utility which determines if a value literal node is valid for an input type. + * + * Deprecated. Rely on validation for documents containing literal values. + * + * This function will be removed in v15 + */ +export function isValidLiteralValue( + type: GraphQLInputType, + valueNode: ValueNode, +): $ReadOnlyArray { + const emptySchema = new GraphQLSchema({}); + const emptyDoc = { kind: Kind.DOCUMENT, definitions: [] }; + const typeInfo = new TypeInfo(emptySchema, undefined, type); + const context = new ValidationContext(emptySchema, emptyDoc, typeInfo); + const visitor = ValuesOfCorrectType(context); + visit(valueNode, visitWithTypeInfo(typeInfo, visitor)); + return context.getErrors(); +} diff --git a/node_modules/graphql/utilities/isValidLiteralValue.mjs b/node_modules/graphql/utilities/isValidLiteralValue.mjs new file mode 100644 index 000000000..497961e90 --- /dev/null +++ b/node_modules/graphql/utilities/isValidLiteralValue.mjs @@ -0,0 +1,26 @@ +import { TypeInfo } from './TypeInfo'; +import { Kind } from '../language/kinds'; +import { visit, visitWithTypeInfo } from '../language/visitor'; +import { GraphQLSchema } from '../type/schema'; +import { ValuesOfCorrectType } from '../validation/rules/ValuesOfCorrectType'; +import { ValidationContext } from '../validation/ValidationContext'; +/** + * Utility which determines if a value literal node is valid for an input type. + * + * Deprecated. Rely on validation for documents containing literal values. + * + * This function will be removed in v15 + */ + +export function isValidLiteralValue(type, valueNode) { + var emptySchema = new GraphQLSchema({}); + var emptyDoc = { + kind: Kind.DOCUMENT, + definitions: [] + }; + var typeInfo = new TypeInfo(emptySchema, undefined, type); + var context = new ValidationContext(emptySchema, emptyDoc, typeInfo); + var visitor = ValuesOfCorrectType(context); + visit(valueNode, visitWithTypeInfo(typeInfo, visitor)); + return context.getErrors(); +} diff --git a/node_modules/graphql/utilities/lexicographicSortSchema.js b/node_modules/graphql/utilities/lexicographicSortSchema.js new file mode 100644 index 000000000..e02713abe --- /dev/null +++ b/node_modules/graphql/utilities/lexicographicSortSchema.js @@ -0,0 +1,180 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lexicographicSortSchema = lexicographicSortSchema; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _schema = require("../type/schema"); + +var _directives = require("../type/directives"); + +var _definition = require("../type/definition"); + +var _introspection = require("../type/introspection"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * Sort GraphQLSchema. + */ +function lexicographicSortSchema(schema) { + var schemaConfig = schema.toConfig(); + var typeMap = (0, _keyValMap.default)(sortByName(schemaConfig.types), function (type) { + return type.name; + }, sortNamedType); + return new _schema.GraphQLSchema(_objectSpread({}, schemaConfig, { + types: (0, _objectValues.default)(typeMap), + directives: sortByName(schemaConfig.directives).map(sortDirective), + query: replaceMaybeType(schemaConfig.query), + mutation: replaceMaybeType(schemaConfig.mutation), + subscription: replaceMaybeType(schemaConfig.subscription) + })); + + function replaceType(type) { + if ((0, _definition.isListType)(type)) { + return new _definition.GraphQLList(replaceType(type.ofType)); + } else if ((0, _definition.isNonNullType)(type)) { + return new _definition.GraphQLNonNull(replaceType(type.ofType)); + } + + return replaceNamedType(type); + } + + function replaceNamedType(type) { + return typeMap[type.name]; + } + + function replaceMaybeType(maybeType) { + return maybeType && replaceNamedType(maybeType); + } + + function sortDirective(directive) { + var config = directive.toConfig(); + return new _directives.GraphQLDirective(_objectSpread({}, config, { + locations: sortBy(config.locations, function (x) { + return x; + }), + args: sortArgs(config.args) + })); + } + + function sortArgs(args) { + return sortObjMap(args, function (arg) { + return _objectSpread({}, arg, { + type: replaceType(arg.type) + }); + }); + } + + function sortFields(fieldsMap) { + return sortObjMap(fieldsMap, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type), + args: sortArgs(field.args) + }); + }); + } + + function sortInputFields(fieldsMap) { + return sortObjMap(fieldsMap, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type) + }); + }); + } + + function sortTypes(arr) { + return sortByName(arr).map(replaceNamedType); + } + + function sortNamedType(type) { + if ((0, _definition.isScalarType)(type) || (0, _introspection.isIntrospectionType)(type)) { + return type; + } else if ((0, _definition.isObjectType)(type)) { + var config = type.toConfig(); + return new _definition.GraphQLObjectType(_objectSpread({}, config, { + interfaces: function interfaces() { + return sortTypes(config.interfaces); + }, + fields: function fields() { + return sortFields(config.fields); + } + })); + } else if ((0, _definition.isInterfaceType)(type)) { + var _config = type.toConfig(); + + return new _definition.GraphQLInterfaceType(_objectSpread({}, _config, { + fields: function fields() { + return sortFields(_config.fields); + } + })); + } else if ((0, _definition.isUnionType)(type)) { + var _config2 = type.toConfig(); + + return new _definition.GraphQLUnionType(_objectSpread({}, _config2, { + types: function types() { + return sortTypes(_config2.types); + } + })); + } else if ((0, _definition.isEnumType)(type)) { + var _config3 = type.toConfig(); + + return new _definition.GraphQLEnumType(_objectSpread({}, _config3, { + values: sortObjMap(_config3.values) + })); + } else if ((0, _definition.isInputObjectType)(type)) { + var _config4 = type.toConfig(); + + return new _definition.GraphQLInputObjectType(_objectSpread({}, _config4, { + fields: function fields() { + return sortInputFields(_config4.fields); + } + })); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); + } +} + +function sortObjMap(map, sortValueFn) { + var sortedMap = Object.create(null); + var sortedKeys = sortBy(Object.keys(map), function (x) { + return x; + }); + + for (var _i = 0, _sortedKeys = sortedKeys; _i < _sortedKeys.length; _i++) { + var key = _sortedKeys[_i]; + var value = map[key]; + sortedMap[key] = sortValueFn ? sortValueFn(value) : value; + } + + return sortedMap; +} + +function sortByName(array) { + return sortBy(array, function (obj) { + return obj.name; + }); +} + +function sortBy(array, mapToKey) { + return array.slice().sort(function (obj1, obj2) { + var key1 = mapToKey(obj1); + var key2 = mapToKey(obj2); + return key1.localeCompare(key2); + }); +} diff --git a/node_modules/graphql/utilities/lexicographicSortSchema.js.flow b/node_modules/graphql/utilities/lexicographicSortSchema.js.flow new file mode 100644 index 000000000..cf6675e84 --- /dev/null +++ b/node_modules/graphql/utilities/lexicographicSortSchema.js.flow @@ -0,0 +1,165 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import keyValMap from '../jsutils/keyValMap'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { GraphQLSchema } from '../type/schema'; +import { GraphQLDirective } from '../type/directives'; +import { + type GraphQLNamedType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + isListType, + isNonNullType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, +} from '../type/definition'; +import { isIntrospectionType } from '../type/introspection'; + +/** + * Sort GraphQLSchema. + */ +export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema { + const schemaConfig = schema.toConfig(); + const typeMap = keyValMap( + sortByName(schemaConfig.types), + type => type.name, + sortNamedType, + ); + + return new GraphQLSchema({ + ...schemaConfig, + types: objectValues(typeMap), + directives: sortByName(schemaConfig.directives).map(sortDirective), + query: replaceMaybeType(schemaConfig.query), + mutation: replaceMaybeType(schemaConfig.mutation), + subscription: replaceMaybeType(schemaConfig.subscription), + }); + + function replaceType(type) { + if (isListType(type)) { + return new GraphQLList(replaceType(type.ofType)); + } else if (isNonNullType(type)) { + return new GraphQLNonNull(replaceType(type.ofType)); + } + return replaceNamedType(type); + } + + function replaceNamedType(type: T): T { + return ((typeMap[type.name]: any): T); + } + + function replaceMaybeType(maybeType) { + return maybeType && replaceNamedType(maybeType); + } + + function sortDirective(directive) { + const config = directive.toConfig(); + return new GraphQLDirective({ + ...config, + locations: sortBy(config.locations, x => x), + args: sortArgs(config.args), + }); + } + + function sortArgs(args) { + return sortObjMap(args, arg => ({ + ...arg, + type: replaceType(arg.type), + })); + } + + function sortFields(fieldsMap) { + return sortObjMap(fieldsMap, field => ({ + ...field, + type: replaceType(field.type), + args: sortArgs(field.args), + })); + } + + function sortInputFields(fieldsMap) { + return sortObjMap(fieldsMap, field => ({ + ...field, + type: replaceType(field.type), + })); + } + + function sortTypes(arr: $ReadOnlyArray): Array { + return sortByName(arr).map(replaceNamedType); + } + + function sortNamedType(type) { + if (isScalarType(type) || isIntrospectionType(type)) { + return type; + } else if (isObjectType(type)) { + const config = type.toConfig(); + return new GraphQLObjectType({ + ...config, + interfaces: () => sortTypes(config.interfaces), + fields: () => sortFields(config.fields), + }); + } else if (isInterfaceType(type)) { + const config = type.toConfig(); + return new GraphQLInterfaceType({ + ...config, + fields: () => sortFields(config.fields), + }); + } else if (isUnionType(type)) { + const config = type.toConfig(); + return new GraphQLUnionType({ + ...config, + types: () => sortTypes(config.types), + }); + } else if (isEnumType(type)) { + const config = type.toConfig(); + return new GraphQLEnumType({ + ...config, + values: sortObjMap(config.values), + }); + } else if (isInputObjectType(type)) { + const config = type.toConfig(); + return new GraphQLInputObjectType({ + ...config, + fields: () => sortInputFields(config.fields), + }); + } + + // Not reachable. All possible types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected type: "${inspect((type: empty))}".`); + } +} + +function sortObjMap(map: ObjMap, sortValueFn?: T => R): ObjMap { + const sortedMap = Object.create(null); + const sortedKeys = sortBy(Object.keys(map), x => x); + for (const key of sortedKeys) { + const value = map[key]; + sortedMap[key] = sortValueFn ? sortValueFn(value) : value; + } + return sortedMap; +} + +function sortByName( + array: $ReadOnlyArray, +): Array { + return sortBy(array, obj => obj.name); +} + +function sortBy(array: $ReadOnlyArray, mapToKey: T => string): Array { + return array.slice().sort((obj1, obj2) => { + const key1 = mapToKey(obj1); + const key2 = mapToKey(obj2); + return key1.localeCompare(key2); + }); +} diff --git a/node_modules/graphql/utilities/lexicographicSortSchema.mjs b/node_modules/graphql/utilities/lexicographicSortSchema.mjs new file mode 100644 index 000000000..7f989c9b2 --- /dev/null +++ b/node_modules/graphql/utilities/lexicographicSortSchema.mjs @@ -0,0 +1,165 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import keyValMap from '../jsutils/keyValMap'; +import { GraphQLSchema } from '../type/schema'; +import { GraphQLDirective } from '../type/directives'; +import { GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, isListType, isNonNullType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from '../type/definition'; +import { isIntrospectionType } from '../type/introspection'; +/** + * Sort GraphQLSchema. + */ + +export function lexicographicSortSchema(schema) { + var schemaConfig = schema.toConfig(); + var typeMap = keyValMap(sortByName(schemaConfig.types), function (type) { + return type.name; + }, sortNamedType); + return new GraphQLSchema(_objectSpread({}, schemaConfig, { + types: objectValues(typeMap), + directives: sortByName(schemaConfig.directives).map(sortDirective), + query: replaceMaybeType(schemaConfig.query), + mutation: replaceMaybeType(schemaConfig.mutation), + subscription: replaceMaybeType(schemaConfig.subscription) + })); + + function replaceType(type) { + if (isListType(type)) { + return new GraphQLList(replaceType(type.ofType)); + } else if (isNonNullType(type)) { + return new GraphQLNonNull(replaceType(type.ofType)); + } + + return replaceNamedType(type); + } + + function replaceNamedType(type) { + return typeMap[type.name]; + } + + function replaceMaybeType(maybeType) { + return maybeType && replaceNamedType(maybeType); + } + + function sortDirective(directive) { + var config = directive.toConfig(); + return new GraphQLDirective(_objectSpread({}, config, { + locations: sortBy(config.locations, function (x) { + return x; + }), + args: sortArgs(config.args) + })); + } + + function sortArgs(args) { + return sortObjMap(args, function (arg) { + return _objectSpread({}, arg, { + type: replaceType(arg.type) + }); + }); + } + + function sortFields(fieldsMap) { + return sortObjMap(fieldsMap, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type), + args: sortArgs(field.args) + }); + }); + } + + function sortInputFields(fieldsMap) { + return sortObjMap(fieldsMap, function (field) { + return _objectSpread({}, field, { + type: replaceType(field.type) + }); + }); + } + + function sortTypes(arr) { + return sortByName(arr).map(replaceNamedType); + } + + function sortNamedType(type) { + if (isScalarType(type) || isIntrospectionType(type)) { + return type; + } else if (isObjectType(type)) { + var config = type.toConfig(); + return new GraphQLObjectType(_objectSpread({}, config, { + interfaces: function interfaces() { + return sortTypes(config.interfaces); + }, + fields: function fields() { + return sortFields(config.fields); + } + })); + } else if (isInterfaceType(type)) { + var _config = type.toConfig(); + + return new GraphQLInterfaceType(_objectSpread({}, _config, { + fields: function fields() { + return sortFields(_config.fields); + } + })); + } else if (isUnionType(type)) { + var _config2 = type.toConfig(); + + return new GraphQLUnionType(_objectSpread({}, _config2, { + types: function types() { + return sortTypes(_config2.types); + } + })); + } else if (isEnumType(type)) { + var _config3 = type.toConfig(); + + return new GraphQLEnumType(_objectSpread({}, _config3, { + values: sortObjMap(_config3.values) + })); + } else if (isInputObjectType(type)) { + var _config4 = type.toConfig(); + + return new GraphQLInputObjectType(_objectSpread({}, _config4, { + fields: function fields() { + return sortInputFields(_config4.fields); + } + })); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat(inspect(type), "\".")); + } +} + +function sortObjMap(map, sortValueFn) { + var sortedMap = Object.create(null); + var sortedKeys = sortBy(Object.keys(map), function (x) { + return x; + }); + + for (var _i = 0, _sortedKeys = sortedKeys; _i < _sortedKeys.length; _i++) { + var key = _sortedKeys[_i]; + var value = map[key]; + sortedMap[key] = sortValueFn ? sortValueFn(value) : value; + } + + return sortedMap; +} + +function sortByName(array) { + return sortBy(array, function (obj) { + return obj.name; + }); +} + +function sortBy(array, mapToKey) { + return array.slice().sort(function (obj1, obj2) { + var key1 = mapToKey(obj1); + var key2 = mapToKey(obj2); + return key1.localeCompare(key2); + }); +} diff --git a/node_modules/graphql/utilities/schemaPrinter.js b/node_modules/graphql/utilities/schemaPrinter.js new file mode 100644 index 000000000..eff9474cd --- /dev/null +++ b/node_modules/graphql/utilities/schemaPrinter.js @@ -0,0 +1,327 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.printSchema = printSchema; +exports.printIntrospectionSchema = printIntrospectionSchema; +exports.printType = printType; + +var _flatMap = _interopRequireDefault(require("../polyfills/flatMap")); + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _astFromValue = require("../utilities/astFromValue"); + +var _printer = require("../language/printer"); + +var _blockString = require("../language/blockString"); + +var _definition = require("../type/definition"); + +var _scalars = require("../type/scalars"); + +var _directives = require("../type/directives"); + +var _introspection = require("../type/introspection"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +function printSchema(schema, options) { + return printFilteredSchema(schema, function (n) { + return !(0, _directives.isSpecifiedDirective)(n); + }, isDefinedType, options); +} + +function printIntrospectionSchema(schema, options) { + return printFilteredSchema(schema, _directives.isSpecifiedDirective, _introspection.isIntrospectionType, options); +} + +function isDefinedType(type) { + return !(0, _scalars.isSpecifiedScalarType)(type) && !(0, _introspection.isIntrospectionType)(type); +} + +function printFilteredSchema(schema, directiveFilter, typeFilter, options) { + var directives = schema.getDirectives().filter(directiveFilter); + var typeMap = schema.getTypeMap(); + var types = (0, _objectValues.default)(typeMap).sort(function (type1, type2) { + return type1.name.localeCompare(type2.name); + }).filter(typeFilter); + return [printSchemaDefinition(schema)].concat(directives.map(function (directive) { + return printDirective(directive, options); + }), types.map(function (type) { + return printType(type, options); + })).filter(Boolean).join('\n\n') + '\n'; +} + +function printSchemaDefinition(schema) { + if (isSchemaOfCommonNames(schema)) { + return; + } + + var operationTypes = []; + var queryType = schema.getQueryType(); + + if (queryType) { + operationTypes.push(" query: ".concat(queryType.name)); + } + + var mutationType = schema.getMutationType(); + + if (mutationType) { + operationTypes.push(" mutation: ".concat(mutationType.name)); + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType) { + operationTypes.push(" subscription: ".concat(subscriptionType.name)); + } + + return "schema {\n".concat(operationTypes.join('\n'), "\n}"); +} +/** + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * schema { + * query: Query + * mutation: Mutation + * } + * + * When using this naming convention, the schema description can be omitted. + */ + + +function isSchemaOfCommonNames(schema) { + var queryType = schema.getQueryType(); + + if (queryType && queryType.name !== 'Query') { + return false; + } + + var mutationType = schema.getMutationType(); + + if (mutationType && mutationType.name !== 'Mutation') { + return false; + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType && subscriptionType.name !== 'Subscription') { + return false; + } + + return true; +} + +function printType(type, options) { + if ((0, _definition.isScalarType)(type)) { + return printScalar(type, options); + } else if ((0, _definition.isObjectType)(type)) { + return printObject(type, options); + } else if ((0, _definition.isInterfaceType)(type)) { + return printInterface(type, options); + } else if ((0, _definition.isUnionType)(type)) { + return printUnion(type, options); + } else if ((0, _definition.isEnumType)(type)) { + return printEnum(type, options); + } else if ((0, _definition.isInputObjectType)(type)) { + return printInputObject(type, options); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); +} + +function printScalar(type, options) { + return printDescription(options, type) + "scalar ".concat(type.name); +} + +function printObject(type, options) { + var interfaces = type.getInterfaces(); + var implementedInterfaces = interfaces.length ? ' implements ' + interfaces.map(function (i) { + return i.name; + }).join(' & ') : ''; + return printDescription(options, type) + "type ".concat(type.name).concat(implementedInterfaces) + printFields(options, type); +} + +function printInterface(type, options) { + return printDescription(options, type) + "interface ".concat(type.name) + printFields(options, type); +} + +function printUnion(type, options) { + var types = type.getTypes(); + var possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(options, type) + 'union ' + type.name + possibleTypes; +} + +function printEnum(type, options) { + var values = type.getValues().map(function (value, i) { + return printDescription(options, value, ' ', !i) + ' ' + value.name + printDeprecated(value); + }); + return printDescription(options, type) + "enum ".concat(type.name) + printBlock(values); +} + +function printInputObject(type, options) { + var fields = (0, _objectValues.default)(type.getFields()).map(function (f, i) { + return printDescription(options, f, ' ', !i) + ' ' + printInputValue(f); + }); + return printDescription(options, type) + "input ".concat(type.name) + printBlock(fields); +} + +function printFields(options, type) { + var fields = (0, _objectValues.default)(type.getFields()).map(function (f, i) { + return printDescription(options, f, ' ', !i) + ' ' + f.name + printArgs(options, f.args, ' ') + ': ' + String(f.type) + printDeprecated(f); + }); + return printBlock(fields); +} + +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} + +function printArgs(options, args) { + var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + + if (args.length === 0) { + return ''; + } // If every arg does not have a description, print them on one line. + + + if (args.every(function (arg) { + return !arg.description; + })) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + + return '(\n' + args.map(function (arg, i) { + return printDescription(options, arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg); + }).join('\n') + '\n' + indentation + ')'; +} + +function printInputValue(arg) { + var defaultAST = (0, _astFromValue.astFromValue)(arg.defaultValue, arg.type); + var argDecl = arg.name + ': ' + String(arg.type); + + if (defaultAST) { + argDecl += " = ".concat((0, _printer.print)(defaultAST)); + } + + return argDecl; +} + +function printDirective(directive, options) { + return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); +} + +function printDeprecated(fieldOrEnumVal) { + if (!fieldOrEnumVal.isDeprecated) { + return ''; + } + + var reason = fieldOrEnumVal.deprecationReason; + var reasonAST = (0, _astFromValue.astFromValue)(reason, _scalars.GraphQLString); + + if (reasonAST && reason !== '' && reason !== _directives.DEFAULT_DEPRECATION_REASON) { + return ' @deprecated(reason: ' + (0, _printer.print)(reasonAST) + ')'; + } + + return ' @deprecated'; +} + +function printDescription(options, def) { + var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var firstInBlock = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + + if (!def.description) { + return ''; + } + + var lines = descriptionLines(def.description, 120 - indentation.length); + + if (options && options.commentDescriptions) { + return printDescriptionWithComments(lines, indentation, firstInBlock); + } + + var text = lines.join('\n'); + var preferMultipleLines = text.length > 70; + var blockString = (0, _blockString.printBlockString)(text, '', preferMultipleLines); + var prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; + return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; +} + +function printDescriptionWithComments(lines, indentation, firstInBlock) { + var description = indentation && !firstInBlock ? '\n' : ''; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var line = _step.value; + + if (line === '') { + description += indentation + '#\n'; + } else { + description += indentation + '# ' + line + '\n'; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return description; +} + +function descriptionLines(description, maxLen) { + var rawLines = description.split('\n'); + return (0, _flatMap.default)(rawLines, function (line) { + if (line.length < maxLen + 5) { + return line; + } // For > 120 character long lines, cut at space boundaries into sublines + // of ~80 chars. + + + return breakLine(line, maxLen); + }); +} + +function breakLine(line, maxLen) { + var parts = line.split(new RegExp("((?: |^).{15,".concat(maxLen - 40, "}(?= |$))"))); + + if (parts.length < 4) { + return [line]; + } + + var sublines = [parts[0] + parts[1] + parts[2]]; + + for (var i = 3; i < parts.length; i += 2) { + sublines.push(parts[i].slice(1) + parts[i + 1]); + } + + return sublines; +} diff --git a/node_modules/graphql/utilities/schemaPrinter.js.flow b/node_modules/graphql/utilities/schemaPrinter.js.flow new file mode 100644 index 000000000..634712ea8 --- /dev/null +++ b/node_modules/graphql/utilities/schemaPrinter.js.flow @@ -0,0 +1,368 @@ +// @flow strict + +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import { astFromValue } from '../utilities/astFromValue'; +import { print } from '../language/printer'; +import { printBlockString } from '../language/blockString'; +import { type GraphQLSchema } from '../type/schema'; +import { + type GraphQLNamedType, + type GraphQLScalarType, + type GraphQLEnumType, + type GraphQLObjectType, + type GraphQLInterfaceType, + type GraphQLUnionType, + type GraphQLInputObjectType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, +} from '../type/definition'; +import { GraphQLString, isSpecifiedScalarType } from '../type/scalars'; +import { + GraphQLDirective, + DEFAULT_DEPRECATION_REASON, + isSpecifiedDirective, +} from '../type/directives'; +import { isIntrospectionType } from '../type/introspection'; + +type Options = {| + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * This option is provided to ease adoption and will be removed in v16. + * + * Default: false + */ + commentDescriptions?: boolean, +|}; + +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function printSchema(schema: GraphQLSchema, options?: Options): string { + return printFilteredSchema( + schema, + n => !isSpecifiedDirective(n), + isDefinedType, + options, + ); +} + +export function printIntrospectionSchema( + schema: GraphQLSchema, + options?: Options, +): string { + return printFilteredSchema( + schema, + isSpecifiedDirective, + isIntrospectionType, + options, + ); +} + +function isDefinedType(type: GraphQLNamedType): boolean { + return !isSpecifiedScalarType(type) && !isIntrospectionType(type); +} + +function printFilteredSchema( + schema: GraphQLSchema, + directiveFilter: (type: GraphQLDirective) => boolean, + typeFilter: (type: GraphQLNamedType) => boolean, + options, +): string { + const directives = schema.getDirectives().filter(directiveFilter); + const typeMap = schema.getTypeMap(); + const types = objectValues(typeMap) + .sort((type1, type2) => type1.name.localeCompare(type2.name)) + .filter(typeFilter); + + return ( + [printSchemaDefinition(schema)] + .concat( + directives.map(directive => printDirective(directive, options)), + types.map(type => printType(type, options)), + ) + .filter(Boolean) + .join('\n\n') + '\n' + ); +} + +function printSchemaDefinition(schema: GraphQLSchema): ?string { + if (isSchemaOfCommonNames(schema)) { + return; + } + + const operationTypes = []; + + const queryType = schema.getQueryType(); + if (queryType) { + operationTypes.push(` query: ${queryType.name}`); + } + + const mutationType = schema.getMutationType(); + if (mutationType) { + operationTypes.push(` mutation: ${mutationType.name}`); + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType) { + operationTypes.push(` subscription: ${subscriptionType.name}`); + } + + return `schema {\n${operationTypes.join('\n')}\n}`; +} + +/** + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * schema { + * query: Query + * mutation: Mutation + * } + * + * When using this naming convention, the schema description can be omitted. + */ +function isSchemaOfCommonNames(schema: GraphQLSchema): boolean { + const queryType = schema.getQueryType(); + if (queryType && queryType.name !== 'Query') { + return false; + } + + const mutationType = schema.getMutationType(); + if (mutationType && mutationType.name !== 'Mutation') { + return false; + } + + const subscriptionType = schema.getSubscriptionType(); + if (subscriptionType && subscriptionType.name !== 'Subscription') { + return false; + } + + return true; +} + +export function printType(type: GraphQLNamedType, options?: Options): string { + if (isScalarType(type)) { + return printScalar(type, options); + } else if (isObjectType(type)) { + return printObject(type, options); + } else if (isInterfaceType(type)) { + return printInterface(type, options); + } else if (isUnionType(type)) { + return printUnion(type, options); + } else if (isEnumType(type)) { + return printEnum(type, options); + } else if (isInputObjectType(type)) { + return printInputObject(type, options); + } + + // Not reachable. All possible types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected type: "${inspect((type: empty))}".`); +} + +function printScalar(type: GraphQLScalarType, options): string { + return printDescription(options, type) + `scalar ${type.name}`; +} + +function printObject(type: GraphQLObjectType, options): string { + const interfaces = type.getInterfaces(); + const implementedInterfaces = interfaces.length + ? ' implements ' + interfaces.map(i => i.name).join(' & ') + : ''; + return ( + printDescription(options, type) + + `type ${type.name}${implementedInterfaces}` + + printFields(options, type) + ); +} + +function printInterface(type: GraphQLInterfaceType, options): string { + return ( + printDescription(options, type) + + `interface ${type.name}` + + printFields(options, type) + ); +} + +function printUnion(type: GraphQLUnionType, options): string { + const types = type.getTypes(); + const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(options, type) + 'union ' + type.name + possibleTypes; +} + +function printEnum(type: GraphQLEnumType, options): string { + const values = type + .getValues() + .map( + (value, i) => + printDescription(options, value, ' ', !i) + + ' ' + + value.name + + printDeprecated(value), + ); + + return ( + printDescription(options, type) + `enum ${type.name}` + printBlock(values) + ); +} + +function printInputObject(type: GraphQLInputObjectType, options): string { + const fields = objectValues(type.getFields()).map( + (f, i) => + printDescription(options, f, ' ', !i) + ' ' + printInputValue(f), + ); + return ( + printDescription(options, type) + `input ${type.name}` + printBlock(fields) + ); +} + +function printFields(options, type) { + const fields = objectValues(type.getFields()).map( + (f, i) => + printDescription(options, f, ' ', !i) + + ' ' + + f.name + + printArgs(options, f.args, ' ') + + ': ' + + String(f.type) + + printDeprecated(f), + ); + return printBlock(fields); +} + +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} + +function printArgs(options, args, indentation = '') { + if (args.length === 0) { + return ''; + } + + // If every arg does not have a description, print them on one line. + if (args.every(arg => !arg.description)) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + + return ( + '(\n' + + args + .map( + (arg, i) => + printDescription(options, arg, ' ' + indentation, !i) + + ' ' + + indentation + + printInputValue(arg), + ) + .join('\n') + + '\n' + + indentation + + ')' + ); +} + +function printInputValue(arg) { + const defaultAST = astFromValue(arg.defaultValue, arg.type); + let argDecl = arg.name + ': ' + String(arg.type); + if (defaultAST) { + argDecl += ` = ${print(defaultAST)}`; + } + return argDecl; +} + +function printDirective(directive, options) { + return ( + printDescription(options, directive) + + 'directive @' + + directive.name + + printArgs(options, directive.args) + + (directive.isRepeatable ? ' repeatable' : '') + + ' on ' + + directive.locations.join(' | ') + ); +} + +function printDeprecated(fieldOrEnumVal) { + if (!fieldOrEnumVal.isDeprecated) { + return ''; + } + const reason = fieldOrEnumVal.deprecationReason; + const reasonAST = astFromValue(reason, GraphQLString); + if (reasonAST && reason !== '' && reason !== DEFAULT_DEPRECATION_REASON) { + return ' @deprecated(reason: ' + print(reasonAST) + ')'; + } + return ' @deprecated'; +} + +function printDescription( + options, + def, + indentation = '', + firstInBlock = true, +): string { + if (!def.description) { + return ''; + } + + const lines = descriptionLines(def.description, 120 - indentation.length); + if (options && options.commentDescriptions) { + return printDescriptionWithComments(lines, indentation, firstInBlock); + } + + const text = lines.join('\n'); + const preferMultipleLines = text.length > 70; + const blockString = printBlockString(text, '', preferMultipleLines); + const prefix = + indentation && !firstInBlock ? '\n' + indentation : indentation; + + return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; +} + +function printDescriptionWithComments(lines, indentation, firstInBlock) { + let description = indentation && !firstInBlock ? '\n' : ''; + for (const line of lines) { + if (line === '') { + description += indentation + '#\n'; + } else { + description += indentation + '# ' + line + '\n'; + } + } + return description; +} + +function descriptionLines(description: string, maxLen: number): Array { + const rawLines = description.split('\n'); + return flatMap(rawLines, line => { + if (line.length < maxLen + 5) { + return line; + } + // For > 120 character long lines, cut at space boundaries into sublines + // of ~80 chars. + return breakLine(line, maxLen); + }); +} + +function breakLine(line: string, maxLen: number): Array { + const parts = line.split(new RegExp(`((?: |^).{15,${maxLen - 40}}(?= |$))`)); + if (parts.length < 4) { + return [line]; + } + const sublines = [parts[0] + parts[1] + parts[2]]; + for (let i = 3; i < parts.length; i += 2) { + sublines.push(parts[i].slice(1) + parts[i + 1]); + } + return sublines; +} diff --git a/node_modules/graphql/utilities/schemaPrinter.mjs b/node_modules/graphql/utilities/schemaPrinter.mjs new file mode 100644 index 000000000..f516a5845 --- /dev/null +++ b/node_modules/graphql/utilities/schemaPrinter.mjs @@ -0,0 +1,306 @@ +import flatMap from '../polyfills/flatMap'; +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import { astFromValue } from '../utilities/astFromValue'; +import { print } from '../language/printer'; +import { printBlockString } from '../language/blockString'; +import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from '../type/definition'; +import { GraphQLString, isSpecifiedScalarType } from '../type/scalars'; +import { GraphQLDirective, DEFAULT_DEPRECATION_REASON, isSpecifiedDirective } from '../type/directives'; +import { isIntrospectionType } from '../type/introspection'; + +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function printSchema(schema, options) { + return printFilteredSchema(schema, function (n) { + return !isSpecifiedDirective(n); + }, isDefinedType, options); +} +export function printIntrospectionSchema(schema, options) { + return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType, options); +} + +function isDefinedType(type) { + return !isSpecifiedScalarType(type) && !isIntrospectionType(type); +} + +function printFilteredSchema(schema, directiveFilter, typeFilter, options) { + var directives = schema.getDirectives().filter(directiveFilter); + var typeMap = schema.getTypeMap(); + var types = objectValues(typeMap).sort(function (type1, type2) { + return type1.name.localeCompare(type2.name); + }).filter(typeFilter); + return [printSchemaDefinition(schema)].concat(directives.map(function (directive) { + return printDirective(directive, options); + }), types.map(function (type) { + return printType(type, options); + })).filter(Boolean).join('\n\n') + '\n'; +} + +function printSchemaDefinition(schema) { + if (isSchemaOfCommonNames(schema)) { + return; + } + + var operationTypes = []; + var queryType = schema.getQueryType(); + + if (queryType) { + operationTypes.push(" query: ".concat(queryType.name)); + } + + var mutationType = schema.getMutationType(); + + if (mutationType) { + operationTypes.push(" mutation: ".concat(mutationType.name)); + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType) { + operationTypes.push(" subscription: ".concat(subscriptionType.name)); + } + + return "schema {\n".concat(operationTypes.join('\n'), "\n}"); +} +/** + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * schema { + * query: Query + * mutation: Mutation + * } + * + * When using this naming convention, the schema description can be omitted. + */ + + +function isSchemaOfCommonNames(schema) { + var queryType = schema.getQueryType(); + + if (queryType && queryType.name !== 'Query') { + return false; + } + + var mutationType = schema.getMutationType(); + + if (mutationType && mutationType.name !== 'Mutation') { + return false; + } + + var subscriptionType = schema.getSubscriptionType(); + + if (subscriptionType && subscriptionType.name !== 'Subscription') { + return false; + } + + return true; +} + +export function printType(type, options) { + if (isScalarType(type)) { + return printScalar(type, options); + } else if (isObjectType(type)) { + return printObject(type, options); + } else if (isInterfaceType(type)) { + return printInterface(type, options); + } else if (isUnionType(type)) { + return printUnion(type, options); + } else if (isEnumType(type)) { + return printEnum(type, options); + } else if (isInputObjectType(type)) { + return printInputObject(type, options); + } // Not reachable. All possible types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type: \"".concat(inspect(type), "\".")); +} + +function printScalar(type, options) { + return printDescription(options, type) + "scalar ".concat(type.name); +} + +function printObject(type, options) { + var interfaces = type.getInterfaces(); + var implementedInterfaces = interfaces.length ? ' implements ' + interfaces.map(function (i) { + return i.name; + }).join(' & ') : ''; + return printDescription(options, type) + "type ".concat(type.name).concat(implementedInterfaces) + printFields(options, type); +} + +function printInterface(type, options) { + return printDescription(options, type) + "interface ".concat(type.name) + printFields(options, type); +} + +function printUnion(type, options) { + var types = type.getTypes(); + var possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; + return printDescription(options, type) + 'union ' + type.name + possibleTypes; +} + +function printEnum(type, options) { + var values = type.getValues().map(function (value, i) { + return printDescription(options, value, ' ', !i) + ' ' + value.name + printDeprecated(value); + }); + return printDescription(options, type) + "enum ".concat(type.name) + printBlock(values); +} + +function printInputObject(type, options) { + var fields = objectValues(type.getFields()).map(function (f, i) { + return printDescription(options, f, ' ', !i) + ' ' + printInputValue(f); + }); + return printDescription(options, type) + "input ".concat(type.name) + printBlock(fields); +} + +function printFields(options, type) { + var fields = objectValues(type.getFields()).map(function (f, i) { + return printDescription(options, f, ' ', !i) + ' ' + f.name + printArgs(options, f.args, ' ') + ': ' + String(f.type) + printDeprecated(f); + }); + return printBlock(fields); +} + +function printBlock(items) { + return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; +} + +function printArgs(options, args) { + var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + + if (args.length === 0) { + return ''; + } // If every arg does not have a description, print them on one line. + + + if (args.every(function (arg) { + return !arg.description; + })) { + return '(' + args.map(printInputValue).join(', ') + ')'; + } + + return '(\n' + args.map(function (arg, i) { + return printDescription(options, arg, ' ' + indentation, !i) + ' ' + indentation + printInputValue(arg); + }).join('\n') + '\n' + indentation + ')'; +} + +function printInputValue(arg) { + var defaultAST = astFromValue(arg.defaultValue, arg.type); + var argDecl = arg.name + ': ' + String(arg.type); + + if (defaultAST) { + argDecl += " = ".concat(print(defaultAST)); + } + + return argDecl; +} + +function printDirective(directive, options) { + return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); +} + +function printDeprecated(fieldOrEnumVal) { + if (!fieldOrEnumVal.isDeprecated) { + return ''; + } + + var reason = fieldOrEnumVal.deprecationReason; + var reasonAST = astFromValue(reason, GraphQLString); + + if (reasonAST && reason !== '' && reason !== DEFAULT_DEPRECATION_REASON) { + return ' @deprecated(reason: ' + print(reasonAST) + ')'; + } + + return ' @deprecated'; +} + +function printDescription(options, def) { + var indentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + var firstInBlock = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + + if (!def.description) { + return ''; + } + + var lines = descriptionLines(def.description, 120 - indentation.length); + + if (options && options.commentDescriptions) { + return printDescriptionWithComments(lines, indentation, firstInBlock); + } + + var text = lines.join('\n'); + var preferMultipleLines = text.length > 70; + var blockString = printBlockString(text, '', preferMultipleLines); + var prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; + return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; +} + +function printDescriptionWithComments(lines, indentation, firstInBlock) { + var description = indentation && !firstInBlock ? '\n' : ''; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var line = _step.value; + + if (line === '') { + description += indentation + '#\n'; + } else { + description += indentation + '# ' + line + '\n'; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return description; +} + +function descriptionLines(description, maxLen) { + var rawLines = description.split('\n'); + return flatMap(rawLines, function (line) { + if (line.length < maxLen + 5) { + return line; + } // For > 120 character long lines, cut at space boundaries into sublines + // of ~80 chars. + + + return breakLine(line, maxLen); + }); +} + +function breakLine(line, maxLen) { + var parts = line.split(new RegExp("((?: |^).{15,".concat(maxLen - 40, "}(?= |$))"))); + + if (parts.length < 4) { + return [line]; + } + + var sublines = [parts[0] + parts[1] + parts[2]]; + + for (var i = 3; i < parts.length; i += 2) { + sublines.push(parts[i].slice(1) + parts[i + 1]); + } + + return sublines; +} diff --git a/node_modules/graphql/utilities/separateOperations.js b/node_modules/graphql/utilities/separateOperations.js new file mode 100644 index 000000000..d57841056 --- /dev/null +++ b/node_modules/graphql/utilities/separateOperations.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.separateOperations = separateOperations; + +var _visitor = require("../language/visitor"); + +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +function separateOperations(documentAST) { + var operations = []; + var fragments = Object.create(null); + var positions = new Map(); + var depGraph = Object.create(null); + var fromName; + var idx = 0; // Populate metadata and build a dependency graph. + + (0, _visitor.visit)(documentAST, { + OperationDefinition: function OperationDefinition(node) { + fromName = opName(node); + operations.push(node); + positions.set(node, idx++); + }, + FragmentDefinition: function FragmentDefinition(node) { + fromName = node.name.value; + fragments[fromName] = node; + positions.set(node, idx++); + }, + FragmentSpread: function FragmentSpread(node) { + var toName = node.name.value; + (depGraph[fromName] || (depGraph[fromName] = Object.create(null)))[toName] = true; + } + }); // For each operation, produce a new synthesized AST which includes only what + // is necessary for completing that operation. + + var separatedDocumentASTs = Object.create(null); + + for (var _i = 0, _operations = operations; _i < _operations.length; _i++) { + var operation = _operations[_i]; + var operationName = opName(operation); + var dependencies = Object.create(null); + collectTransitiveDependencies(dependencies, depGraph, operationName); // The list of definition nodes to be included for this operation, sorted + // to retain the same order as the original document. + + var definitions = [operation]; + + for (var _i2 = 0, _Object$keys = Object.keys(dependencies); _i2 < _Object$keys.length; _i2++) { + var name = _Object$keys[_i2]; + definitions.push(fragments[name]); + } + + definitions.sort(function (n1, n2) { + return (positions.get(n1) || 0) - (positions.get(n2) || 0); + }); + separatedDocumentASTs[operationName] = { + kind: 'Document', + definitions: definitions + }; + } + + return separatedDocumentASTs; +} + +// Provides the empty string for anonymous operations. +function opName(operation) { + return operation.name ? operation.name.value : ''; +} // From a dependency graph, collects a list of transitive dependencies by +// recursing through a dependency graph. + + +function collectTransitiveDependencies(collected, depGraph, fromName) { + var immediateDeps = depGraph[fromName]; + + if (immediateDeps) { + for (var _i3 = 0, _Object$keys2 = Object.keys(immediateDeps); _i3 < _Object$keys2.length; _i3++) { + var toName = _Object$keys2[_i3]; + + if (!collected[toName]) { + collected[toName] = true; + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} diff --git a/node_modules/graphql/utilities/separateOperations.js.flow b/node_modules/graphql/utilities/separateOperations.js.flow new file mode 100644 index 000000000..8961396a1 --- /dev/null +++ b/node_modules/graphql/utilities/separateOperations.js.flow @@ -0,0 +1,96 @@ +// @flow strict + +import { visit } from '../language/visitor'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { + type DocumentNode, + type OperationDefinitionNode, +} from '../language/ast'; + +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations( + documentAST: DocumentNode, +): ObjMap { + const operations = []; + const fragments = Object.create(null); + const positions = new Map(); + const depGraph: DepGraph = Object.create(null); + let fromName; + let idx = 0; + + // Populate metadata and build a dependency graph. + visit(documentAST, { + OperationDefinition(node) { + fromName = opName(node); + operations.push(node); + positions.set(node, idx++); + }, + FragmentDefinition(node) { + fromName = node.name.value; + fragments[fromName] = node; + positions.set(node, idx++); + }, + FragmentSpread(node) { + const toName = node.name.value; + (depGraph[fromName] || (depGraph[fromName] = Object.create(null)))[ + toName + ] = true; + }, + }); + + // For each operation, produce a new synthesized AST which includes only what + // is necessary for completing that operation. + const separatedDocumentASTs = Object.create(null); + for (const operation of operations) { + const operationName = opName(operation); + const dependencies = Object.create(null); + collectTransitiveDependencies(dependencies, depGraph, operationName); + + // The list of definition nodes to be included for this operation, sorted + // to retain the same order as the original document. + const definitions = [operation]; + for (const name of Object.keys(dependencies)) { + definitions.push(fragments[name]); + } + definitions.sort( + (n1, n2) => (positions.get(n1) || 0) - (positions.get(n2) || 0), + ); + + separatedDocumentASTs[operationName] = { + kind: 'Document', + definitions, + }; + } + + return separatedDocumentASTs; +} + +type DepGraph = ObjMap>; + +// Provides the empty string for anonymous operations. +function opName(operation: OperationDefinitionNode): string { + return operation.name ? operation.name.value : ''; +} + +// From a dependency graph, collects a list of transitive dependencies by +// recursing through a dependency graph. +function collectTransitiveDependencies( + collected: ObjMap, + depGraph: DepGraph, + fromName: string, +): void { + const immediateDeps = depGraph[fromName]; + if (immediateDeps) { + for (const toName of Object.keys(immediateDeps)) { + if (!collected[toName]) { + collected[toName] = true; + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} diff --git a/node_modules/graphql/utilities/separateOperations.mjs b/node_modules/graphql/utilities/separateOperations.mjs new file mode 100644 index 000000000..d48fc6826 --- /dev/null +++ b/node_modules/graphql/utilities/separateOperations.mjs @@ -0,0 +1,83 @@ +import { visit } from '../language/visitor'; + +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations(documentAST) { + var operations = []; + var fragments = Object.create(null); + var positions = new Map(); + var depGraph = Object.create(null); + var fromName; + var idx = 0; // Populate metadata and build a dependency graph. + + visit(documentAST, { + OperationDefinition: function OperationDefinition(node) { + fromName = opName(node); + operations.push(node); + positions.set(node, idx++); + }, + FragmentDefinition: function FragmentDefinition(node) { + fromName = node.name.value; + fragments[fromName] = node; + positions.set(node, idx++); + }, + FragmentSpread: function FragmentSpread(node) { + var toName = node.name.value; + (depGraph[fromName] || (depGraph[fromName] = Object.create(null)))[toName] = true; + } + }); // For each operation, produce a new synthesized AST which includes only what + // is necessary for completing that operation. + + var separatedDocumentASTs = Object.create(null); + + for (var _i = 0, _operations = operations; _i < _operations.length; _i++) { + var operation = _operations[_i]; + var operationName = opName(operation); + var dependencies = Object.create(null); + collectTransitiveDependencies(dependencies, depGraph, operationName); // The list of definition nodes to be included for this operation, sorted + // to retain the same order as the original document. + + var definitions = [operation]; + + for (var _i2 = 0, _Object$keys = Object.keys(dependencies); _i2 < _Object$keys.length; _i2++) { + var name = _Object$keys[_i2]; + definitions.push(fragments[name]); + } + + definitions.sort(function (n1, n2) { + return (positions.get(n1) || 0) - (positions.get(n2) || 0); + }); + separatedDocumentASTs[operationName] = { + kind: 'Document', + definitions: definitions + }; + } + + return separatedDocumentASTs; +} + +// Provides the empty string for anonymous operations. +function opName(operation) { + return operation.name ? operation.name.value : ''; +} // From a dependency graph, collects a list of transitive dependencies by +// recursing through a dependency graph. + + +function collectTransitiveDependencies(collected, depGraph, fromName) { + var immediateDeps = depGraph[fromName]; + + if (immediateDeps) { + for (var _i3 = 0, _Object$keys2 = Object.keys(immediateDeps); _i3 < _Object$keys2.length; _i3++) { + var toName = _Object$keys2[_i3]; + + if (!collected[toName]) { + collected[toName] = true; + collectTransitiveDependencies(collected, depGraph, toName); + } + } + } +} diff --git a/node_modules/graphql/utilities/stripIgnoredCharacters.js b/node_modules/graphql/utilities/stripIgnoredCharacters.js new file mode 100644 index 000000000..61c7ef395 --- /dev/null +++ b/node_modules/graphql/utilities/stripIgnoredCharacters.js @@ -0,0 +1,133 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stripIgnoredCharacters = stripIgnoredCharacters; + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _source = require("../language/source"); + +var _tokenKind = require("../language/tokenKind"); + +var _lexer = require("../language/lexer"); + +var _blockString = require("../language/blockString"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * + * Query example: + * + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * + * Becomes: + * + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * + * SDL example: + * + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * + * Becomes: + * + * """Type description""" type Foo{"""Field description""" bar:String} + */ +function stripIgnoredCharacters(source) { + var sourceObj = typeof source === 'string' ? new _source.Source(source) : source; + + if (!(sourceObj instanceof _source.Source)) { + throw new TypeError("Must provide string or Source. Received: ".concat((0, _inspect.default)(sourceObj))); + } + + var body = sourceObj.body; + var lexer = (0, _lexer.createLexer)(sourceObj); + var strippedBody = ''; + var wasLastAddedTokenNonPunctuator = false; + + while (lexer.advance().kind !== _tokenKind.TokenKind.EOF) { + var currentToken = lexer.token; + var tokenKind = currentToken.kind; + /** + * Every two non-punctuator tokens should have space between them. + * Also prevent case of non-punctuator token following by spread resulting + * in invalid token (e.g. `1...` is invalid Float token). + */ + + var isNonPunctuator = !(0, _lexer.isPunctuatorToken)(currentToken); + + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === _tokenKind.TokenKind.SPREAD) { + strippedBody += ' '; + } + } + + var tokenBody = body.slice(currentToken.start, currentToken.end); + + if (tokenKind === _tokenKind.TokenKind.BLOCK_STRING) { + strippedBody += dedentBlockString(tokenBody); + } else { + strippedBody += tokenBody; + } + + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + + return strippedBody; +} + +function dedentBlockString(blockStr) { + // skip leading and trailing triple quotations + var rawStr = blockStr.slice(3, -3); + var body = (0, _blockString.dedentBlockStringValue)(rawStr); + var lines = body.split(/\r\n|[\n\r]/g); + + if ((0, _blockString.getBlockStringIndentation)(lines) > 0) { + body = '\n' + body; + } + + var lastChar = body[body.length - 1]; + var hasTrailingQuote = lastChar === '"' && body.slice(-4) !== '\\"""'; + + if (hasTrailingQuote || lastChar === '\\') { + body += '\n'; + } + + return '"""' + body + '"""'; +} diff --git a/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow b/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow new file mode 100644 index 000000000..a5be9337b --- /dev/null +++ b/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow @@ -0,0 +1,123 @@ +// @flow strict + +import inspect from '../jsutils/inspect'; +import { Source } from '../language/source'; +import { TokenKind } from '../language/tokenKind'; +import { createLexer, isPunctuatorToken } from '../language/lexer'; +import { + dedentBlockStringValue, + getBlockStringIndentation, +} from '../language/blockString'; + +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * + * Query example: + * + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * + * Becomes: + * + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * + * SDL example: + * + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * + * Becomes: + * + * """Type description""" type Foo{"""Field description""" bar:String} + */ +export function stripIgnoredCharacters(source: string | Source): string { + const sourceObj = typeof source === 'string' ? new Source(source) : source; + if (!(sourceObj instanceof Source)) { + throw new TypeError( + `Must provide string or Source. Received: ${inspect(sourceObj)}`, + ); + } + + const body = sourceObj.body; + const lexer = createLexer(sourceObj); + let strippedBody = ''; + + let wasLastAddedTokenNonPunctuator = false; + while (lexer.advance().kind !== TokenKind.EOF) { + const currentToken = lexer.token; + const tokenKind = currentToken.kind; + + /** + * Every two non-punctuator tokens should have space between them. + * Also prevent case of non-punctuator token following by spread resulting + * in invalid token (e.g. `1...` is invalid Float token). + */ + const isNonPunctuator = !isPunctuatorToken(currentToken); + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) { + strippedBody += ' '; + } + } + + const tokenBody = body.slice(currentToken.start, currentToken.end); + if (tokenKind === TokenKind.BLOCK_STRING) { + strippedBody += dedentBlockString(tokenBody); + } else { + strippedBody += tokenBody; + } + + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + + return strippedBody; +} + +function dedentBlockString(blockStr) { + // skip leading and trailing triple quotations + const rawStr = blockStr.slice(3, -3); + let body = dedentBlockStringValue(rawStr); + + const lines = body.split(/\r\n|[\n\r]/g); + if (getBlockStringIndentation(lines) > 0) { + body = '\n' + body; + } + + const lastChar = body[body.length - 1]; + const hasTrailingQuote = lastChar === '"' && body.slice(-4) !== '\\"""'; + if (hasTrailingQuote || lastChar === '\\') { + body += '\n'; + } + + return '"""' + body + '"""'; +} diff --git a/node_modules/graphql/utilities/stripIgnoredCharacters.mjs b/node_modules/graphql/utilities/stripIgnoredCharacters.mjs new file mode 100644 index 000000000..e3e18300e --- /dev/null +++ b/node_modules/graphql/utilities/stripIgnoredCharacters.mjs @@ -0,0 +1,120 @@ +import inspect from '../jsutils/inspect'; +import { Source } from '../language/source'; +import { TokenKind } from '../language/tokenKind'; +import { createLexer, isPunctuatorToken } from '../language/lexer'; +import { dedentBlockStringValue, getBlockStringIndentation } from '../language/blockString'; +/** + * Strips characters that are not significant to the validity or execution + * of a GraphQL document: + * - UnicodeBOM + * - WhiteSpace + * - LineTerminator + * - Comment + * - Comma + * - BlockString indentation + * + * Note: It is required to have a delimiter character between neighboring + * non-punctuator tokens and this function always uses single space as delimiter. + * + * It is guaranteed that both input and output documents if parsed would result + * in the exact same AST except for nodes location. + * + * Warning: It is guaranteed that this function will always produce stable results. + * However, it's not guaranteed that it will stay the same between different + * releases due to bugfixes or changes in the GraphQL specification. + * + * Query example: + * + * query SomeQuery($foo: String!, $bar: String) { + * someField(foo: $foo, bar: $bar) { + * a + * b { + * c + * d + * } + * } + * } + * + * Becomes: + * + * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}} + * + * SDL example: + * + * """ + * Type description + * """ + * type Foo { + * """ + * Field description + * """ + * bar: String + * } + * + * Becomes: + * + * """Type description""" type Foo{"""Field description""" bar:String} + */ + +export function stripIgnoredCharacters(source) { + var sourceObj = typeof source === 'string' ? new Source(source) : source; + + if (!(sourceObj instanceof Source)) { + throw new TypeError("Must provide string or Source. Received: ".concat(inspect(sourceObj))); + } + + var body = sourceObj.body; + var lexer = createLexer(sourceObj); + var strippedBody = ''; + var wasLastAddedTokenNonPunctuator = false; + + while (lexer.advance().kind !== TokenKind.EOF) { + var currentToken = lexer.token; + var tokenKind = currentToken.kind; + /** + * Every two non-punctuator tokens should have space between them. + * Also prevent case of non-punctuator token following by spread resulting + * in invalid token (e.g. `1...` is invalid Float token). + */ + + var isNonPunctuator = !isPunctuatorToken(currentToken); + + if (wasLastAddedTokenNonPunctuator) { + if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) { + strippedBody += ' '; + } + } + + var tokenBody = body.slice(currentToken.start, currentToken.end); + + if (tokenKind === TokenKind.BLOCK_STRING) { + strippedBody += dedentBlockString(tokenBody); + } else { + strippedBody += tokenBody; + } + + wasLastAddedTokenNonPunctuator = isNonPunctuator; + } + + return strippedBody; +} + +function dedentBlockString(blockStr) { + // skip leading and trailing triple quotations + var rawStr = blockStr.slice(3, -3); + var body = dedentBlockStringValue(rawStr); + var lines = body.split(/\r\n|[\n\r]/g); + + if (getBlockStringIndentation(lines) > 0) { + body = '\n' + body; + } + + var lastChar = body[body.length - 1]; + var hasTrailingQuote = lastChar === '"' && body.slice(-4) !== '\\"""'; + + if (hasTrailingQuote || lastChar === '\\') { + body += '\n'; + } + + return '"""' + body + '"""'; +} diff --git a/node_modules/graphql/utilities/typeComparators.js b/node_modules/graphql/utilities/typeComparators.js new file mode 100644 index 000000000..53a73655b --- /dev/null +++ b/node_modules/graphql/utilities/typeComparators.js @@ -0,0 +1,120 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isEqualType = isEqualType; +exports.isTypeSubTypeOf = isTypeSubTypeOf; +exports.doTypesOverlap = doTypesOverlap; + +var _definition = require("../type/definition"); + +/** + * Provided two types, return true if the types are equal (invariant). + */ +function isEqualType(typeA, typeB) { + // Equivalent types are equal. + if (typeA === typeB) { + return true; + } // If either type is non-null, the other must also be non-null. + + + if ((0, _definition.isNonNullType)(typeA) && (0, _definition.isNonNullType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // If either type is a list, the other must also be a list. + + + if ((0, _definition.isListType)(typeA) && (0, _definition.isListType)(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // Otherwise the types are not equal. + + + return false; +} +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + */ + + +function isTypeSubTypeOf(schema, maybeSubType, superType) { + // Equivalent type is a valid subtype + if (maybeSubType === superType) { + return true; + } // If superType is non-null, maybeSubType must also be non-null. + + + if ((0, _definition.isNonNullType)(superType)) { + if ((0, _definition.isNonNullType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + + return false; + } + + if ((0, _definition.isNonNullType)(maybeSubType)) { + // If superType is nullable, maybeSubType may be non-null or nullable. + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } // If superType type is a list, maybeSubType type must also be a list. + + + if ((0, _definition.isListType)(superType)) { + if ((0, _definition.isListType)(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + + return false; + } + + if ((0, _definition.isListType)(maybeSubType)) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } // If superType type is an abstract type, maybeSubType type may be a currently + // possible object type. + + + if ((0, _definition.isAbstractType)(superType) && (0, _definition.isObjectType)(maybeSubType) && schema.isPossibleType(superType, maybeSubType)) { + return true; + } // Otherwise, the child type is not a valid subtype of the parent type. + + + return false; +} +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + */ + + +function doTypesOverlap(schema, typeA, typeB) { + // Equivalent types overlap + if (typeA === typeB) { + return true; + } + + if ((0, _definition.isAbstractType)(typeA)) { + if ((0, _definition.isAbstractType)(typeB)) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + return schema.getPossibleTypes(typeA).some(function (type) { + return schema.isPossibleType(typeB, type); + }); + } // Determine if the latter type is a possible concrete type of the former. + + + return schema.isPossibleType(typeA, typeB); + } + + if ((0, _definition.isAbstractType)(typeB)) { + // Determine if the former type is a possible concrete type of the latter. + return schema.isPossibleType(typeB, typeA); + } // Otherwise the types do not overlap. + + + return false; +} diff --git a/node_modules/graphql/utilities/typeComparators.js.flow b/node_modules/graphql/utilities/typeComparators.js.flow new file mode 100644 index 000000000..cab64d1e3 --- /dev/null +++ b/node_modules/graphql/utilities/typeComparators.js.flow @@ -0,0 +1,126 @@ +// @flow strict + +import { + type GraphQLType, + type GraphQLCompositeType, + isObjectType, + isListType, + isNonNullType, + isAbstractType, +} from '../type/definition'; +import { type GraphQLSchema } from '../type/schema'; + +/** + * Provided two types, return true if the types are equal (invariant). + */ +export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean { + // Equivalent types are equal. + if (typeA === typeB) { + return true; + } + + // If either type is non-null, the other must also be non-null. + if (isNonNullType(typeA) && isNonNullType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + + // If either type is a list, the other must also be a list. + if (isListType(typeA) && isListType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } + + // Otherwise the types are not equal. + return false; +} + +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + */ +export function isTypeSubTypeOf( + schema: GraphQLSchema, + maybeSubType: GraphQLType, + superType: GraphQLType, +): boolean { + // Equivalent type is a valid subtype + if (maybeSubType === superType) { + return true; + } + + // If superType is non-null, maybeSubType must also be non-null. + if (isNonNullType(superType)) { + if (isNonNullType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isNonNullType(maybeSubType)) { + // If superType is nullable, maybeSubType may be non-null or nullable. + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } + + // If superType type is a list, maybeSubType type must also be a list. + if (isListType(superType)) { + if (isListType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + return false; + } + if (isListType(maybeSubType)) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } + + // If superType type is an abstract type, maybeSubType type may be a currently + // possible object type. + if ( + isAbstractType(superType) && + isObjectType(maybeSubType) && + schema.isPossibleType(superType, maybeSubType) + ) { + return true; + } + + // Otherwise, the child type is not a valid subtype of the parent type. + return false; +} + +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + */ +export function doTypesOverlap( + schema: GraphQLSchema, + typeA: GraphQLCompositeType, + typeB: GraphQLCompositeType, +): boolean { + // Equivalent types overlap + if (typeA === typeB) { + return true; + } + + if (isAbstractType(typeA)) { + if (isAbstractType(typeB)) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + return schema + .getPossibleTypes(typeA) + .some(type => schema.isPossibleType(typeB, type)); + } + // Determine if the latter type is a possible concrete type of the former. + return schema.isPossibleType(typeA, typeB); + } + + if (isAbstractType(typeB)) { + // Determine if the former type is a possible concrete type of the latter. + return schema.isPossibleType(typeB, typeA); + } + + // Otherwise the types do not overlap. + return false; +} diff --git a/node_modules/graphql/utilities/typeComparators.mjs b/node_modules/graphql/utilities/typeComparators.mjs new file mode 100644 index 000000000..db61f51d7 --- /dev/null +++ b/node_modules/graphql/utilities/typeComparators.mjs @@ -0,0 +1,109 @@ +import { isObjectType, isListType, isNonNullType, isAbstractType } from '../type/definition'; + +/** + * Provided two types, return true if the types are equal (invariant). + */ +export function isEqualType(typeA, typeB) { + // Equivalent types are equal. + if (typeA === typeB) { + return true; + } // If either type is non-null, the other must also be non-null. + + + if (isNonNullType(typeA) && isNonNullType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // If either type is a list, the other must also be a list. + + + if (isListType(typeA) && isListType(typeB)) { + return isEqualType(typeA.ofType, typeB.ofType); + } // Otherwise the types are not equal. + + + return false; +} +/** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + */ + +export function isTypeSubTypeOf(schema, maybeSubType, superType) { + // Equivalent type is a valid subtype + if (maybeSubType === superType) { + return true; + } // If superType is non-null, maybeSubType must also be non-null. + + + if (isNonNullType(superType)) { + if (isNonNullType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + + return false; + } + + if (isNonNullType(maybeSubType)) { + // If superType is nullable, maybeSubType may be non-null or nullable. + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); + } // If superType type is a list, maybeSubType type must also be a list. + + + if (isListType(superType)) { + if (isListType(maybeSubType)) { + return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); + } + + return false; + } + + if (isListType(maybeSubType)) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } // If superType type is an abstract type, maybeSubType type may be a currently + // possible object type. + + + if (isAbstractType(superType) && isObjectType(maybeSubType) && schema.isPossibleType(superType, maybeSubType)) { + return true; + } // Otherwise, the child type is not a valid subtype of the parent type. + + + return false; +} +/** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + */ + +export function doTypesOverlap(schema, typeA, typeB) { + // Equivalent types overlap + if (typeA === typeB) { + return true; + } + + if (isAbstractType(typeA)) { + if (isAbstractType(typeB)) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + return schema.getPossibleTypes(typeA).some(function (type) { + return schema.isPossibleType(typeB, type); + }); + } // Determine if the latter type is a possible concrete type of the former. + + + return schema.isPossibleType(typeA, typeB); + } + + if (isAbstractType(typeB)) { + // Determine if the former type is a possible concrete type of the latter. + return schema.isPossibleType(typeB, typeA); + } // Otherwise the types do not overlap. + + + return false; +} diff --git a/node_modules/graphql/utilities/typeFromAST.js b/node_modules/graphql/utilities/typeFromAST.js new file mode 100644 index 000000000..0bd0ed43d --- /dev/null +++ b/node_modules/graphql/utilities/typeFromAST.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeFromAST = typeFromAST; + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _kinds = require("../language/kinds"); + +var _definition = require("../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function typeFromAST(schema, typeNode) { + /* eslint-enable no-redeclare */ + var innerType; + + if (typeNode.kind === _kinds.Kind.LIST_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && (0, _definition.GraphQLList)(innerType); + } + + if (typeNode.kind === _kinds.Kind.NON_NULL_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && (0, _definition.GraphQLNonNull)(innerType); + } + + if (typeNode.kind === _kinds.Kind.NAMED_TYPE) { + return schema.getType(typeNode.name.value); + } // Not reachable. All possible type nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type node: \"".concat((0, _inspect.default)(typeNode), "\".")); +} diff --git a/node_modules/graphql/utilities/typeFromAST.js.flow b/node_modules/graphql/utilities/typeFromAST.js.flow new file mode 100644 index 000000000..76dd137f0 --- /dev/null +++ b/node_modules/graphql/utilities/typeFromAST.js.flow @@ -0,0 +1,55 @@ +// @flow strict + +import inspect from '../jsutils/inspect'; +import { Kind } from '../language/kinds'; +import { + type NamedTypeNode, + type ListTypeNode, + type NonNullTypeNode, +} from '../language/ast'; +import { + type GraphQLNamedType, + GraphQLList, + GraphQLNonNull, +} from '../type/definition'; +import { type GraphQLSchema } from '../type/schema'; + +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + */ +/* eslint-disable no-redeclare */ +declare function typeFromAST( + schema: GraphQLSchema, + typeNode: NamedTypeNode, +): GraphQLNamedType | void; +declare function typeFromAST( + schema: GraphQLSchema, + typeNode: ListTypeNode, +): GraphQLList | void; +declare function typeFromAST( + schema: GraphQLSchema, + typeNode: NonNullTypeNode, +): GraphQLNonNull | void; +export function typeFromAST(schema, typeNode) { + /* eslint-enable no-redeclare */ + let innerType; + if (typeNode.kind === Kind.LIST_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && GraphQLList(innerType); + } + if (typeNode.kind === Kind.NON_NULL_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && GraphQLNonNull(innerType); + } + if (typeNode.kind === Kind.NAMED_TYPE) { + return schema.getType(typeNode.name.value); + } + + // Not reachable. All possible type nodes have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected type node: "${inspect((typeNode: empty))}".`); +} diff --git a/node_modules/graphql/utilities/typeFromAST.mjs b/node_modules/graphql/utilities/typeFromAST.mjs new file mode 100644 index 000000000..825e59efe --- /dev/null +++ b/node_modules/graphql/utilities/typeFromAST.mjs @@ -0,0 +1,26 @@ +import inspect from '../jsutils/inspect'; +import { Kind } from '../language/kinds'; +import { GraphQLList, GraphQLNonNull } from '../type/definition'; +export function typeFromAST(schema, typeNode) { + /* eslint-enable no-redeclare */ + var innerType; + + if (typeNode.kind === Kind.LIST_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && GraphQLList(innerType); + } + + if (typeNode.kind === Kind.NON_NULL_TYPE) { + innerType = typeFromAST(schema, typeNode.type); + return innerType && GraphQLNonNull(innerType); + } + + if (typeNode.kind === Kind.NAMED_TYPE) { + return schema.getType(typeNode.name.value); + } // Not reachable. All possible type nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected type node: \"".concat(inspect(typeNode), "\".")); +} diff --git a/node_modules/graphql/utilities/valueFromAST.js b/node_modules/graphql/utilities/valueFromAST.js new file mode 100644 index 000000000..58412b2fb --- /dev/null +++ b/node_modules/graphql/utilities/valueFromAST.js @@ -0,0 +1,237 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.valueFromAST = valueFromAST; + +var _objectValues = _interopRequireDefault(require("../polyfills/objectValues")); + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _keyMap = _interopRequireDefault(require("../jsutils/keyMap")); + +var _isInvalid = _interopRequireDefault(require("../jsutils/isInvalid")); + +var _kinds = require("../language/kinds"); + +var _definition = require("../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ +function valueFromAST(valueNode, type, variables) { + if (!valueNode) { + // When there is no node, then there is also no value. + // Importantly, this is different from returning the value null. + return; + } + + if ((0, _definition.isNonNullType)(type)) { + if (valueNode.kind === _kinds.Kind.NULL) { + return; // Invalid: intentionally return no value. + } + + return valueFromAST(valueNode, type.ofType, variables); + } + + if (valueNode.kind === _kinds.Kind.NULL) { + // This is explicitly returning the value null. + return null; + } + + if (valueNode.kind === _kinds.Kind.VARIABLE) { + var variableName = valueNode.name.value; + + if (!variables || (0, _isInvalid.default)(variables[variableName])) { + // No valid return value. + return; + } + + var variableValue = variables[variableName]; + + if (variableValue === null && (0, _definition.isNonNullType)(type)) { + return; // Invalid: intentionally return no value. + } // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + + + return variableValue; + } + + if ((0, _definition.isListType)(type)) { + var itemType = type.ofType; + + if (valueNode.kind === _kinds.Kind.LIST) { + var coercedValues = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = valueNode.values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var itemNode = _step.value; + + if (isMissingVariable(itemNode, variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if ((0, _definition.isNonNullType)(itemType)) { + return; // Invalid: intentionally return no value. + } + + coercedValues.push(null); + } else { + var itemValue = valueFromAST(itemNode, itemType, variables); + + if ((0, _isInvalid.default)(itemValue)) { + return; // Invalid: intentionally return no value. + } + + coercedValues.push(itemValue); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return coercedValues; + } + + var coercedValue = valueFromAST(valueNode, itemType, variables); + + if ((0, _isInvalid.default)(coercedValue)) { + return; // Invalid: intentionally return no value. + } + + return [coercedValue]; + } + + if ((0, _definition.isInputObjectType)(type)) { + if (valueNode.kind !== _kinds.Kind.OBJECT) { + return; // Invalid: intentionally return no value. + } + + var coercedObj = Object.create(null); + var fieldNodes = (0, _keyMap.default)(valueNode.fields, function (field) { + return field.name.value; + }); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = (0, _objectValues.default)(type.getFields())[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var field = _step2.value; + var fieldNode = fieldNodes[field.name]; + + if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } else if ((0, _definition.isNonNullType)(field.type)) { + return; // Invalid: intentionally return no value. + } + + continue; + } + + var fieldValue = valueFromAST(fieldNode.value, field.type, variables); + + if ((0, _isInvalid.default)(fieldValue)) { + return; // Invalid: intentionally return no value. + } + + coercedObj[field.name] = fieldValue; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return coercedObj; + } + + if ((0, _definition.isEnumType)(type)) { + if (valueNode.kind !== _kinds.Kind.ENUM) { + return; // Invalid: intentionally return no value. + } + + var enumValue = type.getValue(valueNode.value); + + if (!enumValue) { + return; // Invalid: intentionally return no value. + } + + return enumValue.value; + } + + if ((0, _definition.isScalarType)(type)) { + // Scalars fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + var result; + + try { + result = type.parseLiteral(valueNode, variables); + } catch (_error) { + return; // Invalid: intentionally return no value. + } + + if ((0, _isInvalid.default)(result)) { + return; // Invalid: intentionally return no value. + } + + return result; + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat((0, _inspect.default)(type), "\".")); +} // Returns true if the provided valueNode is a variable which is not defined +// in the set of variables. + + +function isMissingVariable(valueNode, variables) { + return valueNode.kind === _kinds.Kind.VARIABLE && (!variables || (0, _isInvalid.default)(variables[valueNode.name.value])); +} diff --git a/node_modules/graphql/utilities/valueFromAST.js.flow b/node_modules/graphql/utilities/valueFromAST.js.flow new file mode 100644 index 000000000..f2c2fb476 --- /dev/null +++ b/node_modules/graphql/utilities/valueFromAST.js.flow @@ -0,0 +1,171 @@ +// @flow strict + +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import keyMap from '../jsutils/keyMap'; +import isInvalid from '../jsutils/isInvalid'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { Kind } from '../language/kinds'; +import { + type GraphQLInputType, + isScalarType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, +} from '../type/definition'; +import { type ValueNode } from '../language/ast'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ +export function valueFromAST( + valueNode: ?ValueNode, + type: GraphQLInputType, + variables?: ?ObjMap, +): mixed | void { + if (!valueNode) { + // When there is no node, then there is also no value. + // Importantly, this is different from returning the value null. + return; + } + + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + return; // Invalid: intentionally return no value. + } + return valueFromAST(valueNode, type.ofType, variables); + } + + if (valueNode.kind === Kind.NULL) { + // This is explicitly returning the value null. + return null; + } + + if (valueNode.kind === Kind.VARIABLE) { + const variableName = valueNode.name.value; + if (!variables || isInvalid(variables[variableName])) { + // No valid return value. + return; + } + const variableValue = variables[variableName]; + if (variableValue === null && isNonNullType(type)) { + return; // Invalid: intentionally return no value. + } + // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + return variableValue; + } + + if (isListType(type)) { + const itemType = type.ofType; + if (valueNode.kind === Kind.LIST) { + const coercedValues = []; + for (const itemNode of valueNode.values) { + if (isMissingVariable(itemNode, variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if (isNonNullType(itemType)) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(null); + } else { + const itemValue = valueFromAST(itemNode, itemType, variables); + if (isInvalid(itemValue)) { + return; // Invalid: intentionally return no value. + } + coercedValues.push(itemValue); + } + } + return coercedValues; + } + const coercedValue = valueFromAST(valueNode, itemType, variables); + if (isInvalid(coercedValue)) { + return; // Invalid: intentionally return no value. + } + return [coercedValue]; + } + + if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + return; // Invalid: intentionally return no value. + } + const coercedObj = Object.create(null); + const fieldNodes = keyMap(valueNode.fields, field => field.name.value); + for (const field of objectValues(type.getFields())) { + const fieldNode = fieldNodes[field.name]; + if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + return; // Invalid: intentionally return no value. + } + continue; + } + const fieldValue = valueFromAST(fieldNode.value, field.type, variables); + if (isInvalid(fieldValue)) { + return; // Invalid: intentionally return no value. + } + coercedObj[field.name] = fieldValue; + } + return coercedObj; + } + + if (isEnumType(type)) { + if (valueNode.kind !== Kind.ENUM) { + return; // Invalid: intentionally return no value. + } + const enumValue = type.getValue(valueNode.value); + if (!enumValue) { + return; // Invalid: intentionally return no value. + } + return enumValue.value; + } + + if (isScalarType(type)) { + // Scalars fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + let result; + try { + result = type.parseLiteral(valueNode, variables); + } catch (_error) { + return; // Invalid: intentionally return no value. + } + if (isInvalid(result)) { + return; // Invalid: intentionally return no value. + } + return result; + } + + // Not reachable. All possible input types have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected input type: "${inspect((type: empty))}".`); +} + +// Returns true if the provided valueNode is a variable which is not defined +// in the set of variables. +function isMissingVariable(valueNode, variables) { + return ( + valueNode.kind === Kind.VARIABLE && + (!variables || isInvalid(variables[valueNode.name.value])) + ); +} diff --git a/node_modules/graphql/utilities/valueFromAST.mjs b/node_modules/graphql/utilities/valueFromAST.mjs new file mode 100644 index 000000000..941e02581 --- /dev/null +++ b/node_modules/graphql/utilities/valueFromAST.mjs @@ -0,0 +1,222 @@ +import objectValues from '../polyfills/objectValues'; +import inspect from '../jsutils/inspect'; +import keyMap from '../jsutils/keyMap'; +import isInvalid from '../jsutils/isInvalid'; +import { Kind } from '../language/kinds'; +import { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType } from '../type/definition'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ +export function valueFromAST(valueNode, type, variables) { + if (!valueNode) { + // When there is no node, then there is also no value. + // Importantly, this is different from returning the value null. + return; + } + + if (isNonNullType(type)) { + if (valueNode.kind === Kind.NULL) { + return; // Invalid: intentionally return no value. + } + + return valueFromAST(valueNode, type.ofType, variables); + } + + if (valueNode.kind === Kind.NULL) { + // This is explicitly returning the value null. + return null; + } + + if (valueNode.kind === Kind.VARIABLE) { + var variableName = valueNode.name.value; + + if (!variables || isInvalid(variables[variableName])) { + // No valid return value. + return; + } + + var variableValue = variables[variableName]; + + if (variableValue === null && isNonNullType(type)) { + return; // Invalid: intentionally return no value. + } // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + + + return variableValue; + } + + if (isListType(type)) { + var itemType = type.ofType; + + if (valueNode.kind === Kind.LIST) { + var coercedValues = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = valueNode.values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var itemNode = _step.value; + + if (isMissingVariable(itemNode, variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if (isNonNullType(itemType)) { + return; // Invalid: intentionally return no value. + } + + coercedValues.push(null); + } else { + var itemValue = valueFromAST(itemNode, itemType, variables); + + if (isInvalid(itemValue)) { + return; // Invalid: intentionally return no value. + } + + coercedValues.push(itemValue); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return coercedValues; + } + + var coercedValue = valueFromAST(valueNode, itemType, variables); + + if (isInvalid(coercedValue)) { + return; // Invalid: intentionally return no value. + } + + return [coercedValue]; + } + + if (isInputObjectType(type)) { + if (valueNode.kind !== Kind.OBJECT) { + return; // Invalid: intentionally return no value. + } + + var coercedObj = Object.create(null); + var fieldNodes = keyMap(valueNode.fields, function (field) { + return field.name.value; + }); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = objectValues(type.getFields())[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var field = _step2.value; + var fieldNode = fieldNodes[field.name]; + + if (!fieldNode || isMissingVariable(fieldNode.value, variables)) { + if (field.defaultValue !== undefined) { + coercedObj[field.name] = field.defaultValue; + } else if (isNonNullType(field.type)) { + return; // Invalid: intentionally return no value. + } + + continue; + } + + var fieldValue = valueFromAST(fieldNode.value, field.type, variables); + + if (isInvalid(fieldValue)) { + return; // Invalid: intentionally return no value. + } + + coercedObj[field.name] = fieldValue; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return coercedObj; + } + + if (isEnumType(type)) { + if (valueNode.kind !== Kind.ENUM) { + return; // Invalid: intentionally return no value. + } + + var enumValue = type.getValue(valueNode.value); + + if (!enumValue) { + return; // Invalid: intentionally return no value. + } + + return enumValue.value; + } + + if (isScalarType(type)) { + // Scalars fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + var result; + + try { + result = type.parseLiteral(valueNode, variables); + } catch (_error) { + return; // Invalid: intentionally return no value. + } + + if (isInvalid(result)) { + return; // Invalid: intentionally return no value. + } + + return result; + } // Not reachable. All possible input types have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected input type: \"".concat(inspect(type), "\".")); +} // Returns true if the provided valueNode is a variable which is not defined +// in the set of variables. + +function isMissingVariable(valueNode, variables) { + return valueNode.kind === Kind.VARIABLE && (!variables || isInvalid(variables[valueNode.name.value])); +} diff --git a/node_modules/graphql/utilities/valueFromASTUntyped.js b/node_modules/graphql/utilities/valueFromASTUntyped.js new file mode 100644 index 000000000..1bdd50570 --- /dev/null +++ b/node_modules/graphql/utilities/valueFromASTUntyped.js @@ -0,0 +1,73 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.valueFromASTUntyped = valueFromASTUntyped; + +var _inspect = _interopRequireDefault(require("../jsutils/inspect")); + +var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap")); + +var _isInvalid = _interopRequireDefault(require("../jsutils/isInvalid")); + +var _kinds = require("../language/kinds"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +function valueFromASTUntyped(valueNode, variables) { + switch (valueNode.kind) { + case _kinds.Kind.NULL: + return null; + + case _kinds.Kind.INT: + return parseInt(valueNode.value, 10); + + case _kinds.Kind.FLOAT: + return parseFloat(valueNode.value); + + case _kinds.Kind.STRING: + case _kinds.Kind.ENUM: + case _kinds.Kind.BOOLEAN: + return valueNode.value; + + case _kinds.Kind.LIST: + return valueNode.values.map(function (node) { + return valueFromASTUntyped(node, variables); + }); + + case _kinds.Kind.OBJECT: + return (0, _keyValMap.default)(valueNode.fields, function (field) { + return field.name.value; + }, function (field) { + return valueFromASTUntyped(field.value, variables); + }); + + case _kinds.Kind.VARIABLE: + { + var variableName = valueNode.name.value; + return variables && !(0, _isInvalid.default)(variables[variableName]) ? variables[variableName] : undefined; + } + } // Not reachable. All possible value nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected value node: \"".concat((0, _inspect.default)(valueNode), "\".")); +} diff --git a/node_modules/graphql/utilities/valueFromASTUntyped.js.flow b/node_modules/graphql/utilities/valueFromASTUntyped.js.flow new file mode 100644 index 000000000..d57583b26 --- /dev/null +++ b/node_modules/graphql/utilities/valueFromASTUntyped.js.flow @@ -0,0 +1,60 @@ +// @flow strict + +import inspect from '../jsutils/inspect'; +import keyValMap from '../jsutils/keyValMap'; +import isInvalid from '../jsutils/isInvalid'; +import { type ObjMap } from '../jsutils/ObjMap'; +import { Kind } from '../language/kinds'; +import { type ValueNode } from '../language/ast'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped( + valueNode: ValueNode, + variables?: ?ObjMap, +): mixed { + switch (valueNode.kind) { + case Kind.NULL: + return null; + case Kind.INT: + return parseInt(valueNode.value, 10); + case Kind.FLOAT: + return parseFloat(valueNode.value); + case Kind.STRING: + case Kind.ENUM: + case Kind.BOOLEAN: + return valueNode.value; + case Kind.LIST: + return valueNode.values.map(node => valueFromASTUntyped(node, variables)); + case Kind.OBJECT: + return keyValMap( + valueNode.fields, + field => field.name.value, + field => valueFromASTUntyped(field.value, variables), + ); + case Kind.VARIABLE: { + const variableName = valueNode.name.value; + return variables && !isInvalid(variables[variableName]) + ? variables[variableName] + : undefined; + } + } + + // Not reachable. All possible value nodes have been considered. + /* istanbul ignore next */ + throw new Error(`Unexpected value node: "${inspect((valueNode: empty))}".`); +} diff --git a/node_modules/graphql/utilities/valueFromASTUntyped.mjs b/node_modules/graphql/utilities/valueFromASTUntyped.mjs new file mode 100644 index 000000000..00722d59b --- /dev/null +++ b/node_modules/graphql/utilities/valueFromASTUntyped.mjs @@ -0,0 +1,61 @@ +import inspect from '../jsutils/inspect'; +import keyValMap from '../jsutils/keyValMap'; +import isInvalid from '../jsutils/isInvalid'; +import { Kind } from '../language/kinds'; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped(valueNode, variables) { + switch (valueNode.kind) { + case Kind.NULL: + return null; + + case Kind.INT: + return parseInt(valueNode.value, 10); + + case Kind.FLOAT: + return parseFloat(valueNode.value); + + case Kind.STRING: + case Kind.ENUM: + case Kind.BOOLEAN: + return valueNode.value; + + case Kind.LIST: + return valueNode.values.map(function (node) { + return valueFromASTUntyped(node, variables); + }); + + case Kind.OBJECT: + return keyValMap(valueNode.fields, function (field) { + return field.name.value; + }, function (field) { + return valueFromASTUntyped(field.value, variables); + }); + + case Kind.VARIABLE: + { + var variableName = valueNode.name.value; + return variables && !isInvalid(variables[variableName]) ? variables[variableName] : undefined; + } + } // Not reachable. All possible value nodes have been considered. + + /* istanbul ignore next */ + + + throw new Error("Unexpected value node: \"".concat(inspect(valueNode), "\".")); +} diff --git a/node_modules/graphql/validation/ValidationContext.js b/node_modules/graphql/validation/ValidationContext.js new file mode 100644 index 000000000..f76e63baf --- /dev/null +++ b/node_modules/graphql/validation/ValidationContext.js @@ -0,0 +1,301 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; + +var _visitor = require("../language/visitor"); + +var _kinds = require("../language/kinds"); + +var _TypeInfo = require("../utilities/TypeInfo"); + +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +var ASTValidationContext = +/*#__PURE__*/ +function () { + function ASTValidationContext(ast) { + this._ast = ast; + this._errors = []; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + } + + var _proto = ASTValidationContext.prototype; + + _proto.reportError = function reportError(error) { + this._errors.push(error); + }; + + _proto.getErrors = function getErrors() { + return this._errors; + }; + + _proto.getDocument = function getDocument() { + return this._ast; + }; + + _proto.getFragment = function getFragment(name) { + var fragments = this._fragments; + + if (!fragments) { + this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) { + if (statement.kind === _kinds.Kind.FRAGMENT_DEFINITION) { + frags[statement.name.value] = statement; + } + + return frags; + }, Object.create(null)); + } + + return fragments[name]; + }; + + _proto.getFragmentSpreads = function getFragmentSpreads(node) { + var spreads = this._fragmentSpreads.get(node); + + if (!spreads) { + spreads = []; + var setsToVisit = [node]; + + while (setsToVisit.length !== 0) { + var set = setsToVisit.pop(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = set.selections[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var selection = _step.value; + + if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + this._fragmentSpreads.set(node, spreads); + } + + return spreads; + }; + + _proto.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) { + var fragments = this._recursivelyReferencedFragments.get(operation); + + if (!fragments) { + fragments = []; + var collectedNames = Object.create(null); + var nodesToVisit = [operation.selectionSet]; + + while (nodesToVisit.length !== 0) { + var node = nodesToVisit.pop(); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.getFragmentSpreads(node)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var spread = _step2.value; + var fragName = spread.name.value; + + if (collectedNames[fragName] !== true) { + collectedNames[fragName] = true; + var fragment = this.getFragment(fragName); + + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + this._recursivelyReferencedFragments.set(operation, fragments); + } + + return fragments; + }; + + return ASTValidationContext; +}(); + +exports.ASTValidationContext = ASTValidationContext; + +var SDLValidationContext = +/*#__PURE__*/ +function (_ASTValidationContext) { + _inheritsLoose(SDLValidationContext, _ASTValidationContext); + + function SDLValidationContext(ast, schema) { + var _this; + + _this = _ASTValidationContext.call(this, ast) || this; + _this._schema = schema; + return _this; + } + + var _proto2 = SDLValidationContext.prototype; + + _proto2.getSchema = function getSchema() { + return this._schema; + }; + + return SDLValidationContext; +}(ASTValidationContext); + +exports.SDLValidationContext = SDLValidationContext; + +var ValidationContext = +/*#__PURE__*/ +function (_ASTValidationContext2) { + _inheritsLoose(ValidationContext, _ASTValidationContext2); + + function ValidationContext(schema, ast, typeInfo) { + var _this2; + + _this2 = _ASTValidationContext2.call(this, ast) || this; + _this2._schema = schema; + _this2._typeInfo = typeInfo; + _this2._variableUsages = new Map(); + _this2._recursiveVariableUsages = new Map(); + return _this2; + } + + var _proto3 = ValidationContext.prototype; + + _proto3.getSchema = function getSchema() { + return this._schema; + }; + + _proto3.getVariableUsages = function getVariableUsages(node) { + var usages = this._variableUsages.get(node); + + if (!usages) { + var newUsages = []; + var typeInfo = new _TypeInfo.TypeInfo(this._schema); + (0, _visitor.visit)(node, (0, _visitor.visitWithTypeInfo)(typeInfo, { + VariableDefinition: function VariableDefinition() { + return false; + }, + Variable: function Variable(variable) { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + defaultValue: typeInfo.getDefaultValue() + }); + } + })); + usages = newUsages; + + this._variableUsages.set(node, usages); + } + + return usages; + }; + + _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) { + var usages = this._recursiveVariableUsages.get(operation); + + if (!usages) { + usages = this.getVariableUsages(operation); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var frag = _step3.value; + usages = usages.concat(this.getVariableUsages(frag)); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + this._recursiveVariableUsages.set(operation, usages); + } + + return usages; + }; + + _proto3.getType = function getType() { + return this._typeInfo.getType(); + }; + + _proto3.getParentType = function getParentType() { + return this._typeInfo.getParentType(); + }; + + _proto3.getInputType = function getInputType() { + return this._typeInfo.getInputType(); + }; + + _proto3.getParentInputType = function getParentInputType() { + return this._typeInfo.getParentInputType(); + }; + + _proto3.getFieldDef = function getFieldDef() { + return this._typeInfo.getFieldDef(); + }; + + _proto3.getDirective = function getDirective() { + return this._typeInfo.getDirective(); + }; + + _proto3.getArgument = function getArgument() { + return this._typeInfo.getArgument(); + }; + + return ValidationContext; +}(ASTValidationContext); + +exports.ValidationContext = ValidationContext; diff --git a/node_modules/graphql/validation/ValidationContext.js.flow b/node_modules/graphql/validation/ValidationContext.js.flow new file mode 100644 index 000000000..a993d4033 --- /dev/null +++ b/node_modules/graphql/validation/ValidationContext.js.flow @@ -0,0 +1,243 @@ +// @flow strict + +import { type ObjMap } from '../jsutils/ObjMap'; +import { type GraphQLError } from '../error/GraphQLError'; +import { type ASTVisitor, visit, visitWithTypeInfo } from '../language/visitor'; +import { Kind } from '../language/kinds'; +import { + type DocumentNode, + type OperationDefinitionNode, + type VariableNode, + type SelectionSetNode, + type FragmentSpreadNode, + type FragmentDefinitionNode, +} from '../language/ast'; +import { type GraphQLSchema } from '../type/schema'; +import { + type GraphQLInputType, + type GraphQLOutputType, + type GraphQLCompositeType, + type GraphQLField, + type GraphQLArgument, +} from '../type/definition'; +import { type GraphQLDirective } from '../type/directives'; +import { TypeInfo } from '../utilities/TypeInfo'; + +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +type VariableUsage = {| + +node: VariableNode, + +type: ?GraphQLInputType, + +defaultValue: ?mixed, +|}; + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export class ASTValidationContext { + _ast: DocumentNode; + _errors: Array; + _fragments: ?ObjMap; + _fragmentSpreads: Map>; + _recursivelyReferencedFragments: Map< + OperationDefinitionNode, + $ReadOnlyArray, + >; + + constructor(ast: DocumentNode): void { + this._ast = ast; + this._errors = []; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + } + + reportError(error: GraphQLError): void { + this._errors.push(error); + } + + getErrors(): $ReadOnlyArray { + return this._errors; + } + + getDocument(): DocumentNode { + return this._ast; + } + + getFragment(name: string): ?FragmentDefinitionNode { + let fragments = this._fragments; + if (!fragments) { + this._fragments = fragments = this.getDocument().definitions.reduce( + (frags, statement) => { + if (statement.kind === Kind.FRAGMENT_DEFINITION) { + frags[statement.name.value] = statement; + } + return frags; + }, + Object.create(null), + ); + } + return fragments[name]; + } + + getFragmentSpreads( + node: SelectionSetNode, + ): $ReadOnlyArray { + let spreads = this._fragmentSpreads.get(node); + if (!spreads) { + spreads = []; + const setsToVisit: Array = [node]; + while (setsToVisit.length !== 0) { + const set = setsToVisit.pop(); + for (const selection of set.selections) { + if (selection.kind === Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } + this._fragmentSpreads.set(node, spreads); + } + return spreads; + } + + getRecursivelyReferencedFragments( + operation: OperationDefinitionNode, + ): $ReadOnlyArray { + let fragments = this._recursivelyReferencedFragments.get(operation); + if (!fragments) { + fragments = []; + const collectedNames = Object.create(null); + const nodesToVisit: Array = [operation.selectionSet]; + while (nodesToVisit.length !== 0) { + const node = nodesToVisit.pop(); + for (const spread of this.getFragmentSpreads(node)) { + const fragName = spread.name.value; + if (collectedNames[fragName] !== true) { + collectedNames[fragName] = true; + const fragment = this.getFragment(fragName); + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } + this._recursivelyReferencedFragments.set(operation, fragments); + } + return fragments; + } +} + +export type ASTValidationRule = ASTValidationContext => ASTVisitor; + +export class SDLValidationContext extends ASTValidationContext { + _schema: ?GraphQLSchema; + + constructor(ast: DocumentNode, schema?: ?GraphQLSchema): void { + super(ast); + this._schema = schema; + } + + getSchema(): ?GraphQLSchema { + return this._schema; + } +} + +export type SDLValidationRule = SDLValidationContext => ASTVisitor; + +export class ValidationContext extends ASTValidationContext { + _schema: GraphQLSchema; + _typeInfo: TypeInfo; + _variableUsages: Map>; + _recursiveVariableUsages: Map< + OperationDefinitionNode, + $ReadOnlyArray, + >; + + constructor( + schema: GraphQLSchema, + ast: DocumentNode, + typeInfo: TypeInfo, + ): void { + super(ast); + this._schema = schema; + this._typeInfo = typeInfo; + this._variableUsages = new Map(); + this._recursiveVariableUsages = new Map(); + } + + getSchema(): GraphQLSchema { + return this._schema; + } + + getVariableUsages(node: NodeWithSelectionSet): $ReadOnlyArray { + let usages = this._variableUsages.get(node); + if (!usages) { + const newUsages = []; + const typeInfo = new TypeInfo(this._schema); + visit( + node, + visitWithTypeInfo(typeInfo, { + VariableDefinition: () => false, + Variable(variable) { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + defaultValue: typeInfo.getDefaultValue(), + }); + }, + }), + ); + usages = newUsages; + this._variableUsages.set(node, usages); + } + return usages; + } + + getRecursiveVariableUsages( + operation: OperationDefinitionNode, + ): $ReadOnlyArray { + let usages = this._recursiveVariableUsages.get(operation); + if (!usages) { + usages = this.getVariableUsages(operation); + for (const frag of this.getRecursivelyReferencedFragments(operation)) { + usages = usages.concat(this.getVariableUsages(frag)); + } + this._recursiveVariableUsages.set(operation, usages); + } + return usages; + } + + getType(): ?GraphQLOutputType { + return this._typeInfo.getType(); + } + + getParentType(): ?GraphQLCompositeType { + return this._typeInfo.getParentType(); + } + + getInputType(): ?GraphQLInputType { + return this._typeInfo.getInputType(); + } + + getParentInputType(): ?GraphQLInputType { + return this._typeInfo.getParentInputType(); + } + + getFieldDef(): ?GraphQLField<*, *> { + return this._typeInfo.getFieldDef(); + } + + getDirective(): ?GraphQLDirective { + return this._typeInfo.getDirective(); + } + + getArgument(): ?GraphQLArgument { + return this._typeInfo.getArgument(); + } +} + +export type ValidationRule = ValidationContext => ASTVisitor; diff --git a/node_modules/graphql/validation/ValidationContext.mjs b/node_modules/graphql/validation/ValidationContext.mjs new file mode 100644 index 000000000..c414613e0 --- /dev/null +++ b/node_modules/graphql/validation/ValidationContext.mjs @@ -0,0 +1,284 @@ +function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } + +import { visit, visitWithTypeInfo } from '../language/visitor'; +import { Kind } from '../language/kinds'; +import { TypeInfo } from '../utilities/TypeInfo'; + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export var ASTValidationContext = +/*#__PURE__*/ +function () { + function ASTValidationContext(ast) { + this._ast = ast; + this._errors = []; + this._fragments = undefined; + this._fragmentSpreads = new Map(); + this._recursivelyReferencedFragments = new Map(); + } + + var _proto = ASTValidationContext.prototype; + + _proto.reportError = function reportError(error) { + this._errors.push(error); + }; + + _proto.getErrors = function getErrors() { + return this._errors; + }; + + _proto.getDocument = function getDocument() { + return this._ast; + }; + + _proto.getFragment = function getFragment(name) { + var fragments = this._fragments; + + if (!fragments) { + this._fragments = fragments = this.getDocument().definitions.reduce(function (frags, statement) { + if (statement.kind === Kind.FRAGMENT_DEFINITION) { + frags[statement.name.value] = statement; + } + + return frags; + }, Object.create(null)); + } + + return fragments[name]; + }; + + _proto.getFragmentSpreads = function getFragmentSpreads(node) { + var spreads = this._fragmentSpreads.get(node); + + if (!spreads) { + spreads = []; + var setsToVisit = [node]; + + while (setsToVisit.length !== 0) { + var set = setsToVisit.pop(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = set.selections[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var selection = _step.value; + + if (selection.kind === Kind.FRAGMENT_SPREAD) { + spreads.push(selection); + } else if (selection.selectionSet) { + setsToVisit.push(selection.selectionSet); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + this._fragmentSpreads.set(node, spreads); + } + + return spreads; + }; + + _proto.getRecursivelyReferencedFragments = function getRecursivelyReferencedFragments(operation) { + var fragments = this._recursivelyReferencedFragments.get(operation); + + if (!fragments) { + fragments = []; + var collectedNames = Object.create(null); + var nodesToVisit = [operation.selectionSet]; + + while (nodesToVisit.length !== 0) { + var node = nodesToVisit.pop(); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.getFragmentSpreads(node)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var spread = _step2.value; + var fragName = spread.name.value; + + if (collectedNames[fragName] !== true) { + collectedNames[fragName] = true; + var fragment = this.getFragment(fragName); + + if (fragment) { + fragments.push(fragment); + nodesToVisit.push(fragment.selectionSet); + } + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + this._recursivelyReferencedFragments.set(operation, fragments); + } + + return fragments; + }; + + return ASTValidationContext; +}(); +export var SDLValidationContext = +/*#__PURE__*/ +function (_ASTValidationContext) { + _inheritsLoose(SDLValidationContext, _ASTValidationContext); + + function SDLValidationContext(ast, schema) { + var _this; + + _this = _ASTValidationContext.call(this, ast) || this; + _this._schema = schema; + return _this; + } + + var _proto2 = SDLValidationContext.prototype; + + _proto2.getSchema = function getSchema() { + return this._schema; + }; + + return SDLValidationContext; +}(ASTValidationContext); +export var ValidationContext = +/*#__PURE__*/ +function (_ASTValidationContext2) { + _inheritsLoose(ValidationContext, _ASTValidationContext2); + + function ValidationContext(schema, ast, typeInfo) { + var _this2; + + _this2 = _ASTValidationContext2.call(this, ast) || this; + _this2._schema = schema; + _this2._typeInfo = typeInfo; + _this2._variableUsages = new Map(); + _this2._recursiveVariableUsages = new Map(); + return _this2; + } + + var _proto3 = ValidationContext.prototype; + + _proto3.getSchema = function getSchema() { + return this._schema; + }; + + _proto3.getVariableUsages = function getVariableUsages(node) { + var usages = this._variableUsages.get(node); + + if (!usages) { + var newUsages = []; + var typeInfo = new TypeInfo(this._schema); + visit(node, visitWithTypeInfo(typeInfo, { + VariableDefinition: function VariableDefinition() { + return false; + }, + Variable: function Variable(variable) { + newUsages.push({ + node: variable, + type: typeInfo.getInputType(), + defaultValue: typeInfo.getDefaultValue() + }); + } + })); + usages = newUsages; + + this._variableUsages.set(node, usages); + } + + return usages; + }; + + _proto3.getRecursiveVariableUsages = function getRecursiveVariableUsages(operation) { + var usages = this._recursiveVariableUsages.get(operation); + + if (!usages) { + usages = this.getVariableUsages(operation); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var frag = _step3.value; + usages = usages.concat(this.getVariableUsages(frag)); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + this._recursiveVariableUsages.set(operation, usages); + } + + return usages; + }; + + _proto3.getType = function getType() { + return this._typeInfo.getType(); + }; + + _proto3.getParentType = function getParentType() { + return this._typeInfo.getParentType(); + }; + + _proto3.getInputType = function getInputType() { + return this._typeInfo.getInputType(); + }; + + _proto3.getParentInputType = function getParentInputType() { + return this._typeInfo.getParentInputType(); + }; + + _proto3.getFieldDef = function getFieldDef() { + return this._typeInfo.getFieldDef(); + }; + + _proto3.getDirective = function getDirective() { + return this._typeInfo.getDirective(); + }; + + _proto3.getArgument = function getArgument() { + return this._typeInfo.getArgument(); + }; + + return ValidationContext; +}(ASTValidationContext); diff --git a/node_modules/graphql/validation/index.js b/node_modules/graphql/validation/index.js new file mode 100644 index 000000000..a44c6c799 --- /dev/null +++ b/node_modules/graphql/validation/index.js @@ -0,0 +1,229 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function get() { + return _validate.validate; + } +}); +Object.defineProperty(exports, "ValidationContext", { + enumerable: true, + get: function get() { + return _ValidationContext.ValidationContext; + } +}); +Object.defineProperty(exports, "specifiedRules", { + enumerable: true, + get: function get() { + return _specifiedRules.specifiedRules; + } +}); +Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { + enumerable: true, + get: function get() { + return _FieldsOnCorrectType.FieldsOnCorrectType; + } +}); +Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { + enumerable: true, + get: function get() { + return _FragmentsOnCompositeTypes.FragmentsOnCompositeTypes; + } +}); +Object.defineProperty(exports, "KnownArgumentNamesRule", { + enumerable: true, + get: function get() { + return _KnownArgumentNames.KnownArgumentNames; + } +}); +Object.defineProperty(exports, "KnownDirectivesRule", { + enumerable: true, + get: function get() { + return _KnownDirectives.KnownDirectives; + } +}); +Object.defineProperty(exports, "KnownFragmentNamesRule", { + enumerable: true, + get: function get() { + return _KnownFragmentNames.KnownFragmentNames; + } +}); +Object.defineProperty(exports, "KnownTypeNamesRule", { + enumerable: true, + get: function get() { + return _KnownTypeNames.KnownTypeNames; + } +}); +Object.defineProperty(exports, "LoneAnonymousOperationRule", { + enumerable: true, + get: function get() { + return _LoneAnonymousOperation.LoneAnonymousOperation; + } +}); +Object.defineProperty(exports, "NoFragmentCyclesRule", { + enumerable: true, + get: function get() { + return _NoFragmentCycles.NoFragmentCycles; + } +}); +Object.defineProperty(exports, "NoUndefinedVariablesRule", { + enumerable: true, + get: function get() { + return _NoUndefinedVariables.NoUndefinedVariables; + } +}); +Object.defineProperty(exports, "NoUnusedFragmentsRule", { + enumerable: true, + get: function get() { + return _NoUnusedFragments.NoUnusedFragments; + } +}); +Object.defineProperty(exports, "NoUnusedVariablesRule", { + enumerable: true, + get: function get() { + return _NoUnusedVariables.NoUnusedVariables; + } +}); +Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { + enumerable: true, + get: function get() { + return _OverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged; + } +}); +Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { + enumerable: true, + get: function get() { + return _PossibleFragmentSpreads.PossibleFragmentSpreads; + } +}); +Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { + enumerable: true, + get: function get() { + return _ProvidedRequiredArguments.ProvidedRequiredArguments; + } +}); +Object.defineProperty(exports, "ScalarLeafsRule", { + enumerable: true, + get: function get() { + return _ScalarLeafs.ScalarLeafs; + } +}); +Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { + enumerable: true, + get: function get() { + return _SingleFieldSubscriptions.SingleFieldSubscriptions; + } +}); +Object.defineProperty(exports, "UniqueArgumentNamesRule", { + enumerable: true, + get: function get() { + return _UniqueArgumentNames.UniqueArgumentNames; + } +}); +Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { + enumerable: true, + get: function get() { + return _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation; + } +}); +Object.defineProperty(exports, "UniqueFragmentNamesRule", { + enumerable: true, + get: function get() { + return _UniqueFragmentNames.UniqueFragmentNames; + } +}); +Object.defineProperty(exports, "UniqueInputFieldNamesRule", { + enumerable: true, + get: function get() { + return _UniqueInputFieldNames.UniqueInputFieldNames; + } +}); +Object.defineProperty(exports, "UniqueOperationNamesRule", { + enumerable: true, + get: function get() { + return _UniqueOperationNames.UniqueOperationNames; + } +}); +Object.defineProperty(exports, "UniqueVariableNamesRule", { + enumerable: true, + get: function get() { + return _UniqueVariableNames.UniqueVariableNames; + } +}); +Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { + enumerable: true, + get: function get() { + return _ValuesOfCorrectType.ValuesOfCorrectType; + } +}); +Object.defineProperty(exports, "VariablesAreInputTypesRule", { + enumerable: true, + get: function get() { + return _VariablesAreInputTypes.VariablesAreInputTypes; + } +}); +Object.defineProperty(exports, "VariablesInAllowedPositionRule", { + enumerable: true, + get: function get() { + return _VariablesInAllowedPosition.VariablesInAllowedPosition; + } +}); + +var _validate = require("./validate"); + +var _ValidationContext = require("./ValidationContext"); + +var _specifiedRules = require("./specifiedRules"); + +var _FieldsOnCorrectType = require("./rules/FieldsOnCorrectType"); + +var _FragmentsOnCompositeTypes = require("./rules/FragmentsOnCompositeTypes"); + +var _KnownArgumentNames = require("./rules/KnownArgumentNames"); + +var _KnownDirectives = require("./rules/KnownDirectives"); + +var _KnownFragmentNames = require("./rules/KnownFragmentNames"); + +var _KnownTypeNames = require("./rules/KnownTypeNames"); + +var _LoneAnonymousOperation = require("./rules/LoneAnonymousOperation"); + +var _NoFragmentCycles = require("./rules/NoFragmentCycles"); + +var _NoUndefinedVariables = require("./rules/NoUndefinedVariables"); + +var _NoUnusedFragments = require("./rules/NoUnusedFragments"); + +var _NoUnusedVariables = require("./rules/NoUnusedVariables"); + +var _OverlappingFieldsCanBeMerged = require("./rules/OverlappingFieldsCanBeMerged"); + +var _PossibleFragmentSpreads = require("./rules/PossibleFragmentSpreads"); + +var _ProvidedRequiredArguments = require("./rules/ProvidedRequiredArguments"); + +var _ScalarLeafs = require("./rules/ScalarLeafs"); + +var _SingleFieldSubscriptions = require("./rules/SingleFieldSubscriptions"); + +var _UniqueArgumentNames = require("./rules/UniqueArgumentNames"); + +var _UniqueDirectivesPerLocation = require("./rules/UniqueDirectivesPerLocation"); + +var _UniqueFragmentNames = require("./rules/UniqueFragmentNames"); + +var _UniqueInputFieldNames = require("./rules/UniqueInputFieldNames"); + +var _UniqueOperationNames = require("./rules/UniqueOperationNames"); + +var _UniqueVariableNames = require("./rules/UniqueVariableNames"); + +var _ValuesOfCorrectType = require("./rules/ValuesOfCorrectType"); + +var _VariablesAreInputTypes = require("./rules/VariablesAreInputTypes"); + +var _VariablesInAllowedPosition = require("./rules/VariablesInAllowedPosition"); diff --git a/node_modules/graphql/validation/index.js.flow b/node_modules/graphql/validation/index.js.flow new file mode 100644 index 000000000..16fc9bf2f --- /dev/null +++ b/node_modules/graphql/validation/index.js.flow @@ -0,0 +1,130 @@ +// @flow strict + +export { validate } from './validate'; + +export { ValidationContext } from './ValidationContext'; +export type { ValidationRule } from './ValidationContext'; + +// All validation rules in the GraphQL Specification. +export { specifiedRules } from './specifiedRules'; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +export { + FieldsOnCorrectType as FieldsOnCorrectTypeRule, +} from './rules/FieldsOnCorrectType'; + +// Spec Section: "Fragments on Composite Types" +export { + FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule, +} from './rules/FragmentsOnCompositeTypes'; + +// Spec Section: "Argument Names" +export { + KnownArgumentNames as KnownArgumentNamesRule, +} from './rules/KnownArgumentNames'; + +// Spec Section: "Directives Are Defined" +export { + KnownDirectives as KnownDirectivesRule, +} from './rules/KnownDirectives'; + +// Spec Section: "Fragment spread target defined" +export { + KnownFragmentNames as KnownFragmentNamesRule, +} from './rules/KnownFragmentNames'; + +// Spec Section: "Fragment Spread Type Existence" +export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; + +// Spec Section: "Lone Anonymous Operation" +export { + LoneAnonymousOperation as LoneAnonymousOperationRule, +} from './rules/LoneAnonymousOperation'; + +// Spec Section: "Fragments must not form cycles" +export { + NoFragmentCycles as NoFragmentCyclesRule, +} from './rules/NoFragmentCycles'; + +// Spec Section: "All Variable Used Defined" +export { + NoUndefinedVariables as NoUndefinedVariablesRule, +} from './rules/NoUndefinedVariables'; + +// Spec Section: "Fragments must be used" +export { + NoUnusedFragments as NoUnusedFragmentsRule, +} from './rules/NoUnusedFragments'; + +// Spec Section: "All Variables Used" +export { + NoUnusedVariables as NoUnusedVariablesRule, +} from './rules/NoUnusedVariables'; + +// Spec Section: "Field Selection Merging" +export { + OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule, +} from './rules/OverlappingFieldsCanBeMerged'; + +// Spec Section: "Fragment spread is possible" +export { + PossibleFragmentSpreads as PossibleFragmentSpreadsRule, +} from './rules/PossibleFragmentSpreads'; + +// Spec Section: "Argument Optionality" +export { + ProvidedRequiredArguments as ProvidedRequiredArgumentsRule, +} from './rules/ProvidedRequiredArguments'; + +// Spec Section: "Leaf Field Selections" +export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; + +// Spec Section: "Subscriptions with Single Root Field" +export { + SingleFieldSubscriptions as SingleFieldSubscriptionsRule, +} from './rules/SingleFieldSubscriptions'; + +// Spec Section: "Argument Uniqueness" +export { + UniqueArgumentNames as UniqueArgumentNamesRule, +} from './rules/UniqueArgumentNames'; + +// Spec Section: "Directives Are Unique Per Location" +export { + UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule, +} from './rules/UniqueDirectivesPerLocation'; + +// Spec Section: "Fragment Name Uniqueness" +export { + UniqueFragmentNames as UniqueFragmentNamesRule, +} from './rules/UniqueFragmentNames'; + +// Spec Section: "Input Object Field Uniqueness" +export { + UniqueInputFieldNames as UniqueInputFieldNamesRule, +} from './rules/UniqueInputFieldNames'; + +// Spec Section: "Operation Name Uniqueness" +export { + UniqueOperationNames as UniqueOperationNamesRule, +} from './rules/UniqueOperationNames'; + +// Spec Section: "Variable Uniqueness" +export { + UniqueVariableNames as UniqueVariableNamesRule, +} from './rules/UniqueVariableNames'; + +// Spec Section: "Values Type Correctness" +export { + ValuesOfCorrectType as ValuesOfCorrectTypeRule, +} from './rules/ValuesOfCorrectType'; + +// Spec Section: "Variables are Input Types" +export { + VariablesAreInputTypes as VariablesAreInputTypesRule, +} from './rules/VariablesAreInputTypes'; + +// Spec Section: "All Variable Usages Are Allowed" +export { + VariablesInAllowedPosition as VariablesInAllowedPositionRule, +} from './rules/VariablesInAllowedPosition'; diff --git a/node_modules/graphql/validation/index.mjs b/node_modules/graphql/validation/index.mjs new file mode 100644 index 000000000..ef2094fa6 --- /dev/null +++ b/node_modules/graphql/validation/index.mjs @@ -0,0 +1,54 @@ +export { validate } from './validate'; +export { ValidationContext } from './ValidationContext'; +// All validation rules in the GraphQL Specification. +export { specifiedRules } from './specifiedRules'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" + +export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragments on Composite Types" + +export { FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Argument Names" + +export { KnownArgumentNames as KnownArgumentNamesRule } from './rules/KnownArgumentNames'; // Spec Section: "Directives Are Defined" + +export { KnownDirectives as KnownDirectivesRule } from './rules/KnownDirectives'; // Spec Section: "Fragment spread target defined" + +export { KnownFragmentNames as KnownFragmentNamesRule } from './rules/KnownFragmentNames'; // Spec Section: "Fragment Spread Type Existence" + +export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames'; // Spec Section: "Lone Anonymous Operation" + +export { LoneAnonymousOperation as LoneAnonymousOperationRule } from './rules/LoneAnonymousOperation'; // Spec Section: "Fragments must not form cycles" + +export { NoFragmentCycles as NoFragmentCyclesRule } from './rules/NoFragmentCycles'; // Spec Section: "All Variable Used Defined" + +export { NoUndefinedVariables as NoUndefinedVariablesRule } from './rules/NoUndefinedVariables'; // Spec Section: "Fragments must be used" + +export { NoUnusedFragments as NoUnusedFragmentsRule } from './rules/NoUnusedFragments'; // Spec Section: "All Variables Used" + +export { NoUnusedVariables as NoUnusedVariablesRule } from './rules/NoUnusedVariables'; // Spec Section: "Field Selection Merging" + +export { OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Fragment spread is possible" + +export { PossibleFragmentSpreads as PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreads'; // Spec Section: "Argument Optionality" + +export { ProvidedRequiredArguments as ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArguments'; // Spec Section: "Leaf Field Selections" + +export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs'; // Spec Section: "Subscriptions with Single Root Field" + +export { SingleFieldSubscriptions as SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptions'; // Spec Section: "Argument Uniqueness" + +export { UniqueArgumentNames as UniqueArgumentNamesRule } from './rules/UniqueArgumentNames'; // Spec Section: "Directives Are Unique Per Location" + +export { UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Fragment Name Uniqueness" + +export { UniqueFragmentNames as UniqueFragmentNamesRule } from './rules/UniqueFragmentNames'; // Spec Section: "Input Object Field Uniqueness" + +export { UniqueInputFieldNames as UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNames'; // Spec Section: "Operation Name Uniqueness" + +export { UniqueOperationNames as UniqueOperationNamesRule } from './rules/UniqueOperationNames'; // Spec Section: "Variable Uniqueness" + +export { UniqueVariableNames as UniqueVariableNamesRule } from './rules/UniqueVariableNames'; // Spec Section: "Values Type Correctness" + +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectType'; // Spec Section: "Variables are Input Types" + +export { VariablesAreInputTypes as VariablesAreInputTypesRule } from './rules/VariablesAreInputTypes'; // Spec Section: "All Variable Usages Are Allowed" + +export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPosition'; diff --git a/node_modules/graphql/validation/rules/ExecutableDefinitions.js b/node_modules/graphql/validation/rules/ExecutableDefinitions.js new file mode 100644 index 000000000..545872747 --- /dev/null +++ b/node_modules/graphql/validation/rules/ExecutableDefinitions.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nonExecutableDefinitionMessage = nonExecutableDefinitionMessage; +exports.ExecutableDefinitions = ExecutableDefinitions; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _predicates = require("../../language/predicates"); + +function nonExecutableDefinitionMessage(defName) { + return "The ".concat(defName, " definition is not executable."); +} +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ + + +function ExecutableDefinitions(context) { + return { + Document: function Document(node) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var definition = _step.value; + + if (!(0, _predicates.isExecutableDefinitionNode)(definition)) { + context.reportError(new _GraphQLError.GraphQLError(nonExecutableDefinitionMessage(definition.kind === _kinds.Kind.SCHEMA_DEFINITION || definition.kind === _kinds.Kind.SCHEMA_EXTENSION ? 'schema' : definition.name.value), definition)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow b/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow new file mode 100644 index 000000000..9b070d2cb --- /dev/null +++ b/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow @@ -0,0 +1,42 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { isExecutableDefinitionNode } from '../../language/predicates'; +import { type ASTVisitor } from '../../language/visitor'; + +export function nonExecutableDefinitionMessage(defName: string): string { + return `The ${defName} definition is not executable.`; +} + +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ +export function ExecutableDefinitions( + context: ASTValidationContext, +): ASTVisitor { + return { + Document(node) { + for (const definition of node.definitions) { + if (!isExecutableDefinitionNode(definition)) { + context.reportError( + new GraphQLError( + nonExecutableDefinitionMessage( + definition.kind === Kind.SCHEMA_DEFINITION || + definition.kind === Kind.SCHEMA_EXTENSION + ? 'schema' + : definition.name.value, + ), + definition, + ), + ); + } + } + return false; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs b/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs new file mode 100644 index 000000000..80965d14f --- /dev/null +++ b/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs @@ -0,0 +1,47 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { isExecutableDefinitionNode } from '../../language/predicates'; +export function nonExecutableDefinitionMessage(defName) { + return "The ".concat(defName, " definition is not executable."); +} +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ + +export function ExecutableDefinitions(context) { + return { + Document: function Document(node) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var definition = _step.value; + + if (!isExecutableDefinitionNode(definition)) { + context.reportError(new GraphQLError(nonExecutableDefinitionMessage(definition.kind === Kind.SCHEMA_DEFINITION || definition.kind === Kind.SCHEMA_EXTENSION ? 'schema' : definition.name.value), definition)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/FieldsOnCorrectType.js b/node_modules/graphql/validation/rules/FieldsOnCorrectType.js new file mode 100644 index 000000000..1e9a1086a --- /dev/null +++ b/node_modules/graphql/validation/rules/FieldsOnCorrectType.js @@ -0,0 +1,154 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.undefinedFieldMessage = undefinedFieldMessage; +exports.FieldsOnCorrectType = FieldsOnCorrectType; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList")); + +var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean")); + +var _definition = require("../../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function undefinedFieldMessage(fieldName, type, suggestedTypeNames, suggestedFieldNames) { + var quotedTypeNames = suggestedTypeNames.map(function (x) { + return "\"".concat(x, "\""); + }); + var quotedFieldNames = suggestedFieldNames.map(function (x) { + return "\"".concat(x, "\""); + }); + return "Cannot query field \"".concat(fieldName, "\" on type \"").concat(type, "\".") + ((0, _didYouMean.default)('to use an inline fragment on', quotedTypeNames) || (0, _didYouMean.default)(quotedFieldNames)); +} +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + */ + + +function FieldsOnCorrectType(context) { + return { + Field: function Field(node) { + var type = context.getParentType(); + + if (type) { + var fieldDef = context.getFieldDef(); + + if (!fieldDef) { + // This field doesn't exist, lets look for suggestions. + var schema = context.getSchema(); + var fieldName = node.name.value; // First determine if there are any suggested types to condition on. + + var suggestedTypeNames = getSuggestedTypeNames(schema, type, fieldName); // If there are no suggested types, then perhaps this was a typo? + + var suggestedFieldNames = suggestedTypeNames.length !== 0 ? [] : getSuggestedFieldNames(schema, type, fieldName); // Report an error, including helpful suggestions. + + context.reportError(new _GraphQLError.GraphQLError(undefinedFieldMessage(fieldName, type.name, suggestedTypeNames, suggestedFieldNames), node)); + } + } + } + }; +} +/** + * Go through all of the implementations of type, as well as the interfaces that + * they implement. If any of those types include the provided field, suggest + * them, sorted by how often the type is referenced, starting with Interfaces. + */ + + +function getSuggestedTypeNames(schema, type, fieldName) { + if ((0, _definition.isAbstractType)(type)) { + var suggestedObjectTypes = []; + var interfaceUsageCount = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = schema.getPossibleTypes(type)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var possibleType = _step.value; + + if (!possibleType.getFields()[fieldName]) { + continue; + } // This object type defines this field. + + + suggestedObjectTypes.push(possibleType.name); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = possibleType.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var possibleInterface = _step2.value; + + if (!possibleInterface.getFields()[fieldName]) { + continue; + } // This interface type defines this field. + + + interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Suggest interface types based on how common they are. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) { + return interfaceUsageCount[b] - interfaceUsageCount[a]; + }); // Suggest both interface and object types. + + return suggestedInterfaceTypes.concat(suggestedObjectTypes); + } // Otherwise, must be an Object type, which does not have possible fields. + + + return []; +} +/** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + */ + + +function getSuggestedFieldNames(schema, type, fieldName) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { + var possibleFieldNames = Object.keys(type.getFields()); + return (0, _suggestionList.default)(fieldName, possibleFieldNames); + } // Otherwise, must be a Union type, which does not define fields. + + + return []; +} diff --git a/node_modules/graphql/validation/rules/FieldsOnCorrectType.js.flow b/node_modules/graphql/validation/rules/FieldsOnCorrectType.js.flow new file mode 100644 index 000000000..889976953 --- /dev/null +++ b/node_modules/graphql/validation/rules/FieldsOnCorrectType.js.flow @@ -0,0 +1,135 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { type FieldNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; +import { type GraphQLSchema } from '../../type/schema'; +import { + type GraphQLOutputType, + isObjectType, + isInterfaceType, + isAbstractType, +} from '../../type/definition'; + +export function undefinedFieldMessage( + fieldName: string, + type: string, + suggestedTypeNames: $ReadOnlyArray, + suggestedFieldNames: $ReadOnlyArray, +): string { + const quotedTypeNames = suggestedTypeNames.map(x => `"${x}"`); + const quotedFieldNames = suggestedFieldNames.map(x => `"${x}"`); + return ( + `Cannot query field "${fieldName}" on type "${type}".` + + (didYouMean('to use an inline fragment on', quotedTypeNames) || + didYouMean(quotedFieldNames)) + ); +} + +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + */ +export function FieldsOnCorrectType(context: ValidationContext): ASTVisitor { + return { + Field(node: FieldNode) { + const type = context.getParentType(); + if (type) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + // This field doesn't exist, lets look for suggestions. + const schema = context.getSchema(); + const fieldName = node.name.value; + // First determine if there are any suggested types to condition on. + const suggestedTypeNames = getSuggestedTypeNames( + schema, + type, + fieldName, + ); + // If there are no suggested types, then perhaps this was a typo? + const suggestedFieldNames = + suggestedTypeNames.length !== 0 + ? [] + : getSuggestedFieldNames(schema, type, fieldName); + + // Report an error, including helpful suggestions. + context.reportError( + new GraphQLError( + undefinedFieldMessage( + fieldName, + type.name, + suggestedTypeNames, + suggestedFieldNames, + ), + node, + ), + ); + } + } + }, + }; +} + +/** + * Go through all of the implementations of type, as well as the interfaces that + * they implement. If any of those types include the provided field, suggest + * them, sorted by how often the type is referenced, starting with Interfaces. + */ +function getSuggestedTypeNames( + schema: GraphQLSchema, + type: GraphQLOutputType, + fieldName: string, +): Array { + if (isAbstractType(type)) { + const suggestedObjectTypes = []; + const interfaceUsageCount = Object.create(null); + for (const possibleType of schema.getPossibleTypes(type)) { + if (!possibleType.getFields()[fieldName]) { + continue; + } + // This object type defines this field. + suggestedObjectTypes.push(possibleType.name); + for (const possibleInterface of possibleType.getInterfaces()) { + if (!possibleInterface.getFields()[fieldName]) { + continue; + } + // This interface type defines this field. + interfaceUsageCount[possibleInterface.name] = + (interfaceUsageCount[possibleInterface.name] || 0) + 1; + } + } + + // Suggest interface types based on how common they are. + const suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort( + (a, b) => interfaceUsageCount[b] - interfaceUsageCount[a], + ); + + // Suggest both interface and object types. + return suggestedInterfaceTypes.concat(suggestedObjectTypes); + } + + // Otherwise, must be an Object type, which does not have possible fields. + return []; +} + +/** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + */ +function getSuggestedFieldNames( + schema: GraphQLSchema, + type: GraphQLOutputType, + fieldName: string, +): Array { + if (isObjectType(type) || isInterfaceType(type)) { + const possibleFieldNames = Object.keys(type.getFields()); + return suggestionList(fieldName, possibleFieldNames); + } + // Otherwise, must be a Union type, which does not define fields. + return []; +} diff --git a/node_modules/graphql/validation/rules/FieldsOnCorrectType.mjs b/node_modules/graphql/validation/rules/FieldsOnCorrectType.mjs new file mode 100644 index 000000000..14add6dbf --- /dev/null +++ b/node_modules/graphql/validation/rules/FieldsOnCorrectType.mjs @@ -0,0 +1,138 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { isObjectType, isInterfaceType, isAbstractType } from '../../type/definition'; +export function undefinedFieldMessage(fieldName, type, suggestedTypeNames, suggestedFieldNames) { + var quotedTypeNames = suggestedTypeNames.map(function (x) { + return "\"".concat(x, "\""); + }); + var quotedFieldNames = suggestedFieldNames.map(function (x) { + return "\"".concat(x, "\""); + }); + return "Cannot query field \"".concat(fieldName, "\" on type \"").concat(type, "\".") + (didYouMean('to use an inline fragment on', quotedTypeNames) || didYouMean(quotedFieldNames)); +} +/** + * Fields on correct type + * + * A GraphQL document is only valid if all fields selected are defined by the + * parent type, or are an allowed meta field such as __typename. + */ + +export function FieldsOnCorrectType(context) { + return { + Field: function Field(node) { + var type = context.getParentType(); + + if (type) { + var fieldDef = context.getFieldDef(); + + if (!fieldDef) { + // This field doesn't exist, lets look for suggestions. + var schema = context.getSchema(); + var fieldName = node.name.value; // First determine if there are any suggested types to condition on. + + var suggestedTypeNames = getSuggestedTypeNames(schema, type, fieldName); // If there are no suggested types, then perhaps this was a typo? + + var suggestedFieldNames = suggestedTypeNames.length !== 0 ? [] : getSuggestedFieldNames(schema, type, fieldName); // Report an error, including helpful suggestions. + + context.reportError(new GraphQLError(undefinedFieldMessage(fieldName, type.name, suggestedTypeNames, suggestedFieldNames), node)); + } + } + } + }; +} +/** + * Go through all of the implementations of type, as well as the interfaces that + * they implement. If any of those types include the provided field, suggest + * them, sorted by how often the type is referenced, starting with Interfaces. + */ + +function getSuggestedTypeNames(schema, type, fieldName) { + if (isAbstractType(type)) { + var suggestedObjectTypes = []; + var interfaceUsageCount = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = schema.getPossibleTypes(type)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var possibleType = _step.value; + + if (!possibleType.getFields()[fieldName]) { + continue; + } // This object type defines this field. + + + suggestedObjectTypes.push(possibleType.name); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = possibleType.getInterfaces()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var possibleInterface = _step2.value; + + if (!possibleInterface.getFields()[fieldName]) { + continue; + } // This interface type defines this field. + + + interfaceUsageCount[possibleInterface.name] = (interfaceUsageCount[possibleInterface.name] || 0) + 1; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } // Suggest interface types based on how common they are. + + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var suggestedInterfaceTypes = Object.keys(interfaceUsageCount).sort(function (a, b) { + return interfaceUsageCount[b] - interfaceUsageCount[a]; + }); // Suggest both interface and object types. + + return suggestedInterfaceTypes.concat(suggestedObjectTypes); + } // Otherwise, must be an Object type, which does not have possible fields. + + + return []; +} +/** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + */ + + +function getSuggestedFieldNames(schema, type, fieldName) { + if (isObjectType(type) || isInterfaceType(type)) { + var possibleFieldNames = Object.keys(type.getFields()); + return suggestionList(fieldName, possibleFieldNames); + } // Otherwise, must be a Union type, which does not define fields. + + + return []; +} diff --git a/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js new file mode 100644 index 000000000..f33647f9a --- /dev/null +++ b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js @@ -0,0 +1,55 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.inlineFragmentOnNonCompositeErrorMessage = inlineFragmentOnNonCompositeErrorMessage; +exports.fragmentOnNonCompositeErrorMessage = fragmentOnNonCompositeErrorMessage; +exports.FragmentsOnCompositeTypes = FragmentsOnCompositeTypes; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _printer = require("../../language/printer"); + +var _definition = require("../../type/definition"); + +var _typeFromAST = require("../../utilities/typeFromAST"); + +function inlineFragmentOnNonCompositeErrorMessage(type) { + return "Fragment cannot condition on non composite type \"".concat(type, "\"."); +} + +function fragmentOnNonCompositeErrorMessage(fragName, type) { + return "Fragment \"".concat(fragName, "\" cannot condition on non composite type \"").concat(type, "\"."); +} +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + */ + + +function FragmentsOnCompositeTypes(context) { + return { + InlineFragment: function InlineFragment(node) { + var typeCondition = node.typeCondition; + + if (typeCondition) { + var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition); + + if (type && !(0, _definition.isCompositeType)(type)) { + context.reportError(new _GraphQLError.GraphQLError(inlineFragmentOnNonCompositeErrorMessage((0, _printer.print)(typeCondition)), typeCondition)); + } + } + }, + FragmentDefinition: function FragmentDefinition(node) { + var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition); + + if (type && !(0, _definition.isCompositeType)(type)) { + context.reportError(new _GraphQLError.GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, (0, _printer.print)(node.typeCondition)), node.typeCondition)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js.flow b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js.flow new file mode 100644 index 000000000..d9a75033c --- /dev/null +++ b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.js.flow @@ -0,0 +1,61 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { print } from '../../language/printer'; +import { type ASTVisitor } from '../../language/visitor'; +import { isCompositeType } from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; + +export function inlineFragmentOnNonCompositeErrorMessage(type: string): string { + return `Fragment cannot condition on non composite type "${type}".`; +} + +export function fragmentOnNonCompositeErrorMessage( + fragName: string, + type: string, +): string { + return `Fragment "${fragName}" cannot condition on non composite type "${type}".`; +} + +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + */ +export function FragmentsOnCompositeTypes( + context: ValidationContext, +): ASTVisitor { + return { + InlineFragment(node) { + const typeCondition = node.typeCondition; + if (typeCondition) { + const type = typeFromAST(context.getSchema(), typeCondition); + if (type && !isCompositeType(type)) { + context.reportError( + new GraphQLError( + inlineFragmentOnNonCompositeErrorMessage(print(typeCondition)), + typeCondition, + ), + ); + } + } + }, + FragmentDefinition(node) { + const type = typeFromAST(context.getSchema(), node.typeCondition); + if (type && !isCompositeType(type)) { + context.reportError( + new GraphQLError( + fragmentOnNonCompositeErrorMessage( + node.name.value, + print(node.typeCondition), + ), + node.typeCondition, + ), + ); + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.mjs b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.mjs new file mode 100644 index 000000000..19810e4bf --- /dev/null +++ b/node_modules/graphql/validation/rules/FragmentsOnCompositeTypes.mjs @@ -0,0 +1,40 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { print } from '../../language/printer'; +import { isCompositeType } from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; +export function inlineFragmentOnNonCompositeErrorMessage(type) { + return "Fragment cannot condition on non composite type \"".concat(type, "\"."); +} +export function fragmentOnNonCompositeErrorMessage(fragName, type) { + return "Fragment \"".concat(fragName, "\" cannot condition on non composite type \"").concat(type, "\"."); +} +/** + * Fragments on composite type + * + * Fragments use a type condition to determine if they apply, since fragments + * can only be spread into a composite type (object, interface, or union), the + * type condition must also be a composite type. + */ + +export function FragmentsOnCompositeTypes(context) { + return { + InlineFragment: function InlineFragment(node) { + var typeCondition = node.typeCondition; + + if (typeCondition) { + var type = typeFromAST(context.getSchema(), typeCondition); + + if (type && !isCompositeType(type)) { + context.reportError(new GraphQLError(inlineFragmentOnNonCompositeErrorMessage(print(typeCondition)), typeCondition)); + } + } + }, + FragmentDefinition: function FragmentDefinition(node) { + var type = typeFromAST(context.getSchema(), node.typeCondition); + + if (type && !isCompositeType(type)) { + context.reportError(new GraphQLError(fragmentOnNonCompositeErrorMessage(node.name.value, print(node.typeCondition)), node.typeCondition)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/KnownArgumentNames.js b/node_modules/graphql/validation/rules/KnownArgumentNames.js new file mode 100644 index 000000000..49afd25c6 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownArgumentNames.js @@ -0,0 +1,164 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unknownArgMessage = unknownArgMessage; +exports.unknownDirectiveArgMessage = unknownDirectiveArgMessage; +exports.KnownArgumentNames = KnownArgumentNames; +exports.KnownArgumentNamesOnDirectives = KnownArgumentNamesOnDirectives; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList")); + +var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean")); + +var _kinds = require("../../language/kinds"); + +var _directives = require("../../type/directives"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function unknownArgMessage(argName, fieldName, typeName, suggestedArgs) { + return "Unknown argument \"".concat(argName, "\" on field \"").concat(fieldName, "\" of type \"").concat(typeName, "\".") + (0, _didYouMean.default)(suggestedArgs.map(function (x) { + return "\"".concat(x, "\""); + })); +} + +function unknownDirectiveArgMessage(argName, directiveName, suggestedArgs) { + return "Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + (0, _didYouMean.default)(suggestedArgs.map(function (x) { + return "\"".concat(x, "\""); + })); +} +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + */ + + +function KnownArgumentNames(context) { + return _objectSpread({}, KnownArgumentNamesOnDirectives(context), { + Argument: function Argument(argNode) { + var argDef = context.getArgument(); + var fieldDef = context.getFieldDef(); + var parentType = context.getParentType(); + + if (!argDef && fieldDef && parentType) { + var argName = argNode.name.value; + var knownArgsNames = fieldDef.args.map(function (arg) { + return arg.name; + }); + context.reportError(new _GraphQLError.GraphQLError(unknownArgMessage(argName, fieldDef.name, parentType.name, (0, _suggestionList.default)(argName, knownArgsNames)), argNode)); + } + } + }); +} // @internal + + +function KnownArgumentNamesOnDirectives(context) { + var directiveArgs = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + directiveArgs[directive.name] = directive.args.map(function (arg) { + return arg.name; + }); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + directiveArgs[def.name.value] = def.arguments ? def.arguments.map(function (arg) { + return arg.name.value; + }) : []; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + Directive: function Directive(directiveNode) { + var directiveName = directiveNode.name.value; + var knownArgs = directiveArgs[directiveName]; + + if (directiveNode.arguments && knownArgs) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = directiveNode.arguments[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var argNode = _step3.value; + var argName = argNode.name.value; + + if (knownArgs.indexOf(argName) === -1) { + var suggestions = (0, _suggestionList.default)(argName, knownArgs); + context.reportError(new _GraphQLError.GraphQLError(unknownDirectiveArgMessage(argName, directiveName, suggestions), argNode)); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/KnownArgumentNames.js.flow b/node_modules/graphql/validation/rules/KnownArgumentNames.js.flow new file mode 100644 index 000000000..97978ec8a --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownArgumentNames.js.flow @@ -0,0 +1,116 @@ +// @flow strict + +import { + type ValidationContext, + type SDLValidationContext, +} from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { Kind } from '../../language/kinds'; +import { specifiedDirectives } from '../../type/directives'; + +export function unknownArgMessage( + argName: string, + fieldName: string, + typeName: string, + suggestedArgs: $ReadOnlyArray, +): string { + return ( + `Unknown argument "${argName}" on field "${fieldName}" of type "${typeName}".` + + didYouMean(suggestedArgs.map(x => `"${x}"`)) + ); +} + +export function unknownDirectiveArgMessage( + argName: string, + directiveName: string, + suggestedArgs: $ReadOnlyArray, +): string { + return ( + `Unknown argument "${argName}" on directive "@${directiveName}".` + + didYouMean(suggestedArgs.map(x => `"${x}"`)) + ); +} + +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + */ +export function KnownArgumentNames(context: ValidationContext): ASTVisitor { + return { + ...KnownArgumentNamesOnDirectives(context), + Argument(argNode) { + const argDef = context.getArgument(); + const fieldDef = context.getFieldDef(); + const parentType = context.getParentType(); + + if (!argDef && fieldDef && parentType) { + const argName = argNode.name.value; + const knownArgsNames = fieldDef.args.map(arg => arg.name); + context.reportError( + new GraphQLError( + unknownArgMessage( + argName, + fieldDef.name, + parentType.name, + suggestionList(argName, knownArgsNames), + ), + argNode, + ), + ); + } + }, + }; +} + +// @internal +export function KnownArgumentNamesOnDirectives( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const directiveArgs = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + directiveArgs[directive.name] = directive.args.map(arg => arg.name); + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveArgs[def.name.value] = def.arguments + ? def.arguments.map(arg => arg.name.value) + : []; + } + } + + return { + Directive(directiveNode) { + const directiveName = directiveNode.name.value; + const knownArgs = directiveArgs[directiveName]; + + if (directiveNode.arguments && knownArgs) { + for (const argNode of directiveNode.arguments) { + const argName = argNode.name.value; + if (knownArgs.indexOf(argName) === -1) { + const suggestions = suggestionList(argName, knownArgs); + context.reportError( + new GraphQLError( + unknownDirectiveArgMessage(argName, directiveName, suggestions), + argNode, + ), + ); + } + } + } + + return false; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/KnownArgumentNames.mjs b/node_modules/graphql/validation/rules/KnownArgumentNames.mjs new file mode 100644 index 000000000..7730f10fe --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownArgumentNames.mjs @@ -0,0 +1,144 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { GraphQLError } from '../../error/GraphQLError'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { Kind } from '../../language/kinds'; +import { specifiedDirectives } from '../../type/directives'; +export function unknownArgMessage(argName, fieldName, typeName, suggestedArgs) { + return "Unknown argument \"".concat(argName, "\" on field \"").concat(fieldName, "\" of type \"").concat(typeName, "\".") + didYouMean(suggestedArgs.map(function (x) { + return "\"".concat(x, "\""); + })); +} +export function unknownDirectiveArgMessage(argName, directiveName, suggestedArgs) { + return "Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + didYouMean(suggestedArgs.map(function (x) { + return "\"".concat(x, "\""); + })); +} +/** + * Known argument names + * + * A GraphQL field is only valid if all supplied arguments are defined by + * that field. + */ + +export function KnownArgumentNames(context) { + return _objectSpread({}, KnownArgumentNamesOnDirectives(context), { + Argument: function Argument(argNode) { + var argDef = context.getArgument(); + var fieldDef = context.getFieldDef(); + var parentType = context.getParentType(); + + if (!argDef && fieldDef && parentType) { + var argName = argNode.name.value; + var knownArgsNames = fieldDef.args.map(function (arg) { + return arg.name; + }); + context.reportError(new GraphQLError(unknownArgMessage(argName, fieldDef.name, parentType.name, suggestionList(argName, knownArgsNames)), argNode)); + } + } + }); +} // @internal + +export function KnownArgumentNamesOnDirectives(context) { + var directiveArgs = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + directiveArgs[directive.name] = directive.args.map(function (arg) { + return arg.name; + }); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + directiveArgs[def.name.value] = def.arguments ? def.arguments.map(function (arg) { + return arg.name.value; + }) : []; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + Directive: function Directive(directiveNode) { + var directiveName = directiveNode.name.value; + var knownArgs = directiveArgs[directiveName]; + + if (directiveNode.arguments && knownArgs) { + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = directiveNode.arguments[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var argNode = _step3.value; + var argName = argNode.name.value; + + if (knownArgs.indexOf(argName) === -1) { + var suggestions = suggestionList(argName, knownArgs); + context.reportError(new GraphQLError(unknownDirectiveArgMessage(argName, directiveName, suggestions), argNode)); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/KnownDirectives.js b/node_modules/graphql/validation/rules/KnownDirectives.js new file mode 100644 index 000000000..660213f47 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownDirectives.js @@ -0,0 +1,185 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unknownDirectiveMessage = unknownDirectiveMessage; +exports.misplacedDirectiveMessage = misplacedDirectiveMessage; +exports.KnownDirectives = KnownDirectives; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _directiveLocation = require("../../language/directiveLocation"); + +var _directives = require("../../type/directives"); + +function unknownDirectiveMessage(directiveName) { + return "Unknown directive \"".concat(directiveName, "\"."); +} + +function misplacedDirectiveMessage(directiveName, location) { + return "Directive \"".concat(directiveName, "\" may not be used on ").concat(location, "."); +} +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + */ + + +function KnownDirectives(context) { + var locationsMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + locationsMap[directive.name] = directive.locations; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + locationsMap[def.name.value] = def.locations.map(function (name) { + return name.value; + }); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + Directive: function Directive(node, key, parent, path, ancestors) { + var name = node.name.value; + var locations = locationsMap[name]; + + if (!locations) { + context.reportError(new _GraphQLError.GraphQLError(unknownDirectiveMessage(name), node)); + return; + } + + var candidateLocation = getDirectiveLocationForASTPath(ancestors); + + if (candidateLocation && locations.indexOf(candidateLocation) === -1) { + context.reportError(new _GraphQLError.GraphQLError(misplacedDirectiveMessage(name, candidateLocation), node)); + } + } + }; +} + +function getDirectiveLocationForASTPath(ancestors) { + var appliedTo = ancestors[ancestors.length - 1]; + + if (!Array.isArray(appliedTo)) { + switch (appliedTo.kind) { + case _kinds.Kind.OPERATION_DEFINITION: + switch (appliedTo.operation) { + case 'query': + return _directiveLocation.DirectiveLocation.QUERY; + + case 'mutation': + return _directiveLocation.DirectiveLocation.MUTATION; + + case 'subscription': + return _directiveLocation.DirectiveLocation.SUBSCRIPTION; + } + + break; + + case _kinds.Kind.FIELD: + return _directiveLocation.DirectiveLocation.FIELD; + + case _kinds.Kind.FRAGMENT_SPREAD: + return _directiveLocation.DirectiveLocation.FRAGMENT_SPREAD; + + case _kinds.Kind.INLINE_FRAGMENT: + return _directiveLocation.DirectiveLocation.INLINE_FRAGMENT; + + case _kinds.Kind.FRAGMENT_DEFINITION: + return _directiveLocation.DirectiveLocation.FRAGMENT_DEFINITION; + + case _kinds.Kind.VARIABLE_DEFINITION: + return _directiveLocation.DirectiveLocation.VARIABLE_DEFINITION; + + case _kinds.Kind.SCHEMA_DEFINITION: + case _kinds.Kind.SCHEMA_EXTENSION: + return _directiveLocation.DirectiveLocation.SCHEMA; + + case _kinds.Kind.SCALAR_TYPE_DEFINITION: + case _kinds.Kind.SCALAR_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.SCALAR; + + case _kinds.Kind.OBJECT_TYPE_DEFINITION: + case _kinds.Kind.OBJECT_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.OBJECT; + + case _kinds.Kind.FIELD_DEFINITION: + return _directiveLocation.DirectiveLocation.FIELD_DEFINITION; + + case _kinds.Kind.INTERFACE_TYPE_DEFINITION: + case _kinds.Kind.INTERFACE_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.INTERFACE; + + case _kinds.Kind.UNION_TYPE_DEFINITION: + case _kinds.Kind.UNION_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.UNION; + + case _kinds.Kind.ENUM_TYPE_DEFINITION: + case _kinds.Kind.ENUM_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.ENUM; + + case _kinds.Kind.ENUM_VALUE_DEFINITION: + return _directiveLocation.DirectiveLocation.ENUM_VALUE; + + case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: + case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return _directiveLocation.DirectiveLocation.INPUT_OBJECT; + + case _kinds.Kind.INPUT_VALUE_DEFINITION: + { + var parentNode = ancestors[ancestors.length - 3]; + return parentNode.kind === _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION ? _directiveLocation.DirectiveLocation.INPUT_FIELD_DEFINITION : _directiveLocation.DirectiveLocation.ARGUMENT_DEFINITION; + } + } + } +} diff --git a/node_modules/graphql/validation/rules/KnownDirectives.js.flow b/node_modules/graphql/validation/rules/KnownDirectives.js.flow new file mode 100644 index 000000000..b787f9310 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownDirectives.js.flow @@ -0,0 +1,131 @@ +// @flow strict + +import { + type ValidationContext, + type SDLValidationContext, +} from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { DirectiveLocation } from '../../language/directiveLocation'; +import { type ASTVisitor } from '../../language/visitor'; +import { specifiedDirectives } from '../../type/directives'; + +export function unknownDirectiveMessage(directiveName: string): string { + return `Unknown directive "${directiveName}".`; +} + +export function misplacedDirectiveMessage( + directiveName: string, + location: string, +): string { + return `Directive "${directiveName}" may not be used on ${location}.`; +} + +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + */ +export function KnownDirectives( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const locationsMap = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + locationsMap[directive.name] = directive.locations; + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + locationsMap[def.name.value] = def.locations.map(name => name.value); + } + } + + return { + Directive(node, key, parent, path, ancestors) { + const name = node.name.value; + const locations = locationsMap[name]; + + if (!locations) { + context.reportError( + new GraphQLError(unknownDirectiveMessage(name), node), + ); + return; + } + const candidateLocation = getDirectiveLocationForASTPath(ancestors); + if (candidateLocation && locations.indexOf(candidateLocation) === -1) { + context.reportError( + new GraphQLError( + misplacedDirectiveMessage(name, candidateLocation), + node, + ), + ); + } + }, + }; +} + +function getDirectiveLocationForASTPath(ancestors) { + const appliedTo = ancestors[ancestors.length - 1]; + if (!Array.isArray(appliedTo)) { + switch (appliedTo.kind) { + case Kind.OPERATION_DEFINITION: + switch (appliedTo.operation) { + case 'query': + return DirectiveLocation.QUERY; + case 'mutation': + return DirectiveLocation.MUTATION; + case 'subscription': + return DirectiveLocation.SUBSCRIPTION; + } + break; + case Kind.FIELD: + return DirectiveLocation.FIELD; + case Kind.FRAGMENT_SPREAD: + return DirectiveLocation.FRAGMENT_SPREAD; + case Kind.INLINE_FRAGMENT: + return DirectiveLocation.INLINE_FRAGMENT; + case Kind.FRAGMENT_DEFINITION: + return DirectiveLocation.FRAGMENT_DEFINITION; + case Kind.VARIABLE_DEFINITION: + return DirectiveLocation.VARIABLE_DEFINITION; + case Kind.SCHEMA_DEFINITION: + case Kind.SCHEMA_EXTENSION: + return DirectiveLocation.SCHEMA; + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.SCALAR_TYPE_EXTENSION: + return DirectiveLocation.SCALAR; + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_EXTENSION: + return DirectiveLocation.OBJECT; + case Kind.FIELD_DEFINITION: + return DirectiveLocation.FIELD_DEFINITION; + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_EXTENSION: + return DirectiveLocation.INTERFACE; + case Kind.UNION_TYPE_DEFINITION: + case Kind.UNION_TYPE_EXTENSION: + return DirectiveLocation.UNION; + case Kind.ENUM_TYPE_DEFINITION: + case Kind.ENUM_TYPE_EXTENSION: + return DirectiveLocation.ENUM; + case Kind.ENUM_VALUE_DEFINITION: + return DirectiveLocation.ENUM_VALUE; + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return DirectiveLocation.INPUT_OBJECT; + case Kind.INPUT_VALUE_DEFINITION: { + const parentNode = ancestors[ancestors.length - 3]; + return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION + ? DirectiveLocation.INPUT_FIELD_DEFINITION + : DirectiveLocation.ARGUMENT_DEFINITION; + } + } + } +} diff --git a/node_modules/graphql/validation/rules/KnownDirectives.mjs b/node_modules/graphql/validation/rules/KnownDirectives.mjs new file mode 100644 index 000000000..d47764185 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownDirectives.mjs @@ -0,0 +1,170 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { DirectiveLocation } from '../../language/directiveLocation'; +import { specifiedDirectives } from '../../type/directives'; +export function unknownDirectiveMessage(directiveName) { + return "Unknown directive \"".concat(directiveName, "\"."); +} +export function misplacedDirectiveMessage(directiveName, location) { + return "Directive \"".concat(directiveName, "\" may not be used on ").concat(location, "."); +} +/** + * Known directives + * + * A GraphQL document is only valid if all `@directives` are known by the + * schema and legally positioned. + */ + +export function KnownDirectives(context) { + var locationsMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + locationsMap[directive.name] = directive.locations; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + locationsMap[def.name.value] = def.locations.map(function (name) { + return name.value; + }); + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + Directive: function Directive(node, key, parent, path, ancestors) { + var name = node.name.value; + var locations = locationsMap[name]; + + if (!locations) { + context.reportError(new GraphQLError(unknownDirectiveMessage(name), node)); + return; + } + + var candidateLocation = getDirectiveLocationForASTPath(ancestors); + + if (candidateLocation && locations.indexOf(candidateLocation) === -1) { + context.reportError(new GraphQLError(misplacedDirectiveMessage(name, candidateLocation), node)); + } + } + }; +} + +function getDirectiveLocationForASTPath(ancestors) { + var appliedTo = ancestors[ancestors.length - 1]; + + if (!Array.isArray(appliedTo)) { + switch (appliedTo.kind) { + case Kind.OPERATION_DEFINITION: + switch (appliedTo.operation) { + case 'query': + return DirectiveLocation.QUERY; + + case 'mutation': + return DirectiveLocation.MUTATION; + + case 'subscription': + return DirectiveLocation.SUBSCRIPTION; + } + + break; + + case Kind.FIELD: + return DirectiveLocation.FIELD; + + case Kind.FRAGMENT_SPREAD: + return DirectiveLocation.FRAGMENT_SPREAD; + + case Kind.INLINE_FRAGMENT: + return DirectiveLocation.INLINE_FRAGMENT; + + case Kind.FRAGMENT_DEFINITION: + return DirectiveLocation.FRAGMENT_DEFINITION; + + case Kind.VARIABLE_DEFINITION: + return DirectiveLocation.VARIABLE_DEFINITION; + + case Kind.SCHEMA_DEFINITION: + case Kind.SCHEMA_EXTENSION: + return DirectiveLocation.SCHEMA; + + case Kind.SCALAR_TYPE_DEFINITION: + case Kind.SCALAR_TYPE_EXTENSION: + return DirectiveLocation.SCALAR; + + case Kind.OBJECT_TYPE_DEFINITION: + case Kind.OBJECT_TYPE_EXTENSION: + return DirectiveLocation.OBJECT; + + case Kind.FIELD_DEFINITION: + return DirectiveLocation.FIELD_DEFINITION; + + case Kind.INTERFACE_TYPE_DEFINITION: + case Kind.INTERFACE_TYPE_EXTENSION: + return DirectiveLocation.INTERFACE; + + case Kind.UNION_TYPE_DEFINITION: + case Kind.UNION_TYPE_EXTENSION: + return DirectiveLocation.UNION; + + case Kind.ENUM_TYPE_DEFINITION: + case Kind.ENUM_TYPE_EXTENSION: + return DirectiveLocation.ENUM; + + case Kind.ENUM_VALUE_DEFINITION: + return DirectiveLocation.ENUM_VALUE; + + case Kind.INPUT_OBJECT_TYPE_DEFINITION: + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return DirectiveLocation.INPUT_OBJECT; + + case Kind.INPUT_VALUE_DEFINITION: + { + var parentNode = ancestors[ancestors.length - 3]; + return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION; + } + } + } +} diff --git a/node_modules/graphql/validation/rules/KnownFragmentNames.js b/node_modules/graphql/validation/rules/KnownFragmentNames.js new file mode 100644 index 000000000..f825da644 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownFragmentNames.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unknownFragmentMessage = unknownFragmentMessage; +exports.KnownFragmentNames = KnownFragmentNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function unknownFragmentMessage(fragName) { + return "Unknown fragment \"".concat(fragName, "\"."); +} +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + */ + + +function KnownFragmentNames(context) { + return { + FragmentSpread: function FragmentSpread(node) { + var fragmentName = node.name.value; + var fragment = context.getFragment(fragmentName); + + if (!fragment) { + context.reportError(new _GraphQLError.GraphQLError(unknownFragmentMessage(fragmentName), node.name)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/KnownFragmentNames.js.flow b/node_modules/graphql/validation/rules/KnownFragmentNames.js.flow new file mode 100644 index 000000000..4fd79361f --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownFragmentNames.js.flow @@ -0,0 +1,29 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function unknownFragmentMessage(fragName: string): string { + return `Unknown fragment "${fragName}".`; +} + +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + */ +export function KnownFragmentNames(context: ValidationContext): ASTVisitor { + return { + FragmentSpread(node) { + const fragmentName = node.name.value; + const fragment = context.getFragment(fragmentName); + if (!fragment) { + context.reportError( + new GraphQLError(unknownFragmentMessage(fragmentName), node.name), + ); + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/KnownFragmentNames.mjs b/node_modules/graphql/validation/rules/KnownFragmentNames.mjs new file mode 100644 index 000000000..1881e8796 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownFragmentNames.mjs @@ -0,0 +1,23 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function unknownFragmentMessage(fragName) { + return "Unknown fragment \"".concat(fragName, "\"."); +} +/** + * Known fragment names + * + * A GraphQL document is only valid if all `...Fragment` fragment spreads refer + * to fragments defined in the same document. + */ + +export function KnownFragmentNames(context) { + return { + FragmentSpread: function FragmentSpread(node) { + var fragmentName = node.name.value; + var fragment = context.getFragment(fragmentName); + + if (!fragment) { + context.reportError(new GraphQLError(unknownFragmentMessage(fragmentName), node.name)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/KnownTypeNames.js b/node_modules/graphql/validation/rules/KnownTypeNames.js new file mode 100644 index 000000000..0d8f601ac --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownTypeNames.js @@ -0,0 +1,95 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unknownTypeMessage = unknownTypeMessage; +exports.KnownTypeNames = KnownTypeNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList")); + +var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean")); + +var _predicates = require("../../language/predicates"); + +var _scalars = require("../../type/scalars"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function unknownTypeMessage(typeName, suggestedTypes) { + return "Unknown type \"".concat(typeName, "\".") + (0, _didYouMean.default)(suggestedTypes.map(function (x) { + return "\"".concat(x, "\""); + })); +} +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + */ + + +function KnownTypeNames(context) { + var schema = context.getSchema(); + var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); + var definedTypes = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getDocument().definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if ((0, _predicates.isTypeDefinitionNode)(def)) { + definedTypes[def.name.value] = true; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes)); + return { + NamedType: function NamedType(node, _1, parent, _2, ancestors) { + var typeName = node.name.value; + + if (!existingTypesMap[typeName] && !definedTypes[typeName]) { + var definitionNode = ancestors[2] || parent; + var isSDL = isSDLNode(definitionNode); + + if (isSDL && isSpecifiedScalarName(typeName)) { + return; + } + + var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames); + context.reportError(new _GraphQLError.GraphQLError(unknownTypeMessage(typeName, suggestedTypes), node)); + } + } + }; +} + +var specifiedScalarsNames = _scalars.specifiedScalarTypes.map(function (type) { + return type.name; +}); + +function isSpecifiedScalarName(typeName) { + return specifiedScalarsNames.indexOf(typeName) !== -1; +} + +function isSDLNode(value) { + return Boolean(value && !Array.isArray(value) && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value))); +} diff --git a/node_modules/graphql/validation/rules/KnownTypeNames.js.flow b/node_modules/graphql/validation/rules/KnownTypeNames.js.flow new file mode 100644 index 000000000..22c01c1de --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownTypeNames.js.flow @@ -0,0 +1,85 @@ +// @flow strict + +import { + type ValidationContext, + type SDLValidationContext, +} from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { type ASTNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; +import { + isTypeDefinitionNode, + isTypeSystemDefinitionNode, + isTypeSystemExtensionNode, +} from '../../language/predicates'; +import { specifiedScalarTypes } from '../../type/scalars'; + +export function unknownTypeMessage( + typeName: string, + suggestedTypes: $ReadOnlyArray, +): string { + return ( + `Unknown type "${typeName}".` + + didYouMean(suggestedTypes.map(x => `"${x}"`)) + ); +} + +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + */ +export function KnownTypeNames( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); + + const definedTypes = Object.create(null); + for (const def of context.getDocument().definitions) { + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = true; + } + } + + const typeNames = Object.keys(existingTypesMap).concat( + Object.keys(definedTypes), + ); + + return { + NamedType(node, _1, parent, _2, ancestors) { + const typeName = node.name.value; + if (!existingTypesMap[typeName] && !definedTypes[typeName]) { + const definitionNode = ancestors[2] || parent; + const isSDL = isSDLNode(definitionNode); + if (isSDL && isSpecifiedScalarName(typeName)) { + return; + } + + const suggestedTypes = suggestionList( + typeName, + isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames, + ); + context.reportError( + new GraphQLError(unknownTypeMessage(typeName, suggestedTypes), node), + ); + } + }, + }; +} + +const specifiedScalarsNames = specifiedScalarTypes.map(type => type.name); +function isSpecifiedScalarName(typeName) { + return specifiedScalarsNames.indexOf(typeName) !== -1; +} + +function isSDLNode(value: ASTNode | $ReadOnlyArray | void): boolean { + return Boolean( + value && + !Array.isArray(value) && + (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value)), + ); +} diff --git a/node_modules/graphql/validation/rules/KnownTypeNames.mjs b/node_modules/graphql/validation/rules/KnownTypeNames.mjs new file mode 100644 index 000000000..f4169c096 --- /dev/null +++ b/node_modules/graphql/validation/rules/KnownTypeNames.mjs @@ -0,0 +1,78 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import suggestionList from '../../jsutils/suggestionList'; +import didYouMean from '../../jsutils/didYouMean'; +import { isTypeDefinitionNode, isTypeSystemDefinitionNode, isTypeSystemExtensionNode } from '../../language/predicates'; +import { specifiedScalarTypes } from '../../type/scalars'; +export function unknownTypeMessage(typeName, suggestedTypes) { + return "Unknown type \"".concat(typeName, "\".") + didYouMean(suggestedTypes.map(function (x) { + return "\"".concat(x, "\""); + })); +} +/** + * Known type names + * + * A GraphQL document is only valid if referenced types (specifically + * variable definitions and fragment conditions) are defined by the type schema. + */ + +export function KnownTypeNames(context) { + var schema = context.getSchema(); + var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); + var definedTypes = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getDocument().definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = true; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var typeNames = Object.keys(existingTypesMap).concat(Object.keys(definedTypes)); + return { + NamedType: function NamedType(node, _1, parent, _2, ancestors) { + var typeName = node.name.value; + + if (!existingTypesMap[typeName] && !definedTypes[typeName]) { + var definitionNode = ancestors[2] || parent; + var isSDL = isSDLNode(definitionNode); + + if (isSDL && isSpecifiedScalarName(typeName)) { + return; + } + + var suggestedTypes = suggestionList(typeName, isSDL ? specifiedScalarsNames.concat(typeNames) : typeNames); + context.reportError(new GraphQLError(unknownTypeMessage(typeName, suggestedTypes), node)); + } + } + }; +} +var specifiedScalarsNames = specifiedScalarTypes.map(function (type) { + return type.name; +}); + +function isSpecifiedScalarName(typeName) { + return specifiedScalarsNames.indexOf(typeName) !== -1; +} + +function isSDLNode(value) { + return Boolean(value && !Array.isArray(value) && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))); +} diff --git a/node_modules/graphql/validation/rules/LoneAnonymousOperation.js b/node_modules/graphql/validation/rules/LoneAnonymousOperation.js new file mode 100644 index 000000000..8137323c1 --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneAnonymousOperation.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.anonOperationNotAloneMessage = anonOperationNotAloneMessage; +exports.LoneAnonymousOperation = LoneAnonymousOperation; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +function anonOperationNotAloneMessage() { + return 'This anonymous operation must be the only defined operation.'; +} +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + */ + + +function LoneAnonymousOperation(context) { + var operationCount = 0; + return { + Document: function Document(node) { + operationCount = node.definitions.filter(function (definition) { + return definition.kind === _kinds.Kind.OPERATION_DEFINITION; + }).length; + }, + OperationDefinition: function OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError(new _GraphQLError.GraphQLError(anonOperationNotAloneMessage(), node)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/LoneAnonymousOperation.js.flow b/node_modules/graphql/validation/rules/LoneAnonymousOperation.js.flow new file mode 100644 index 000000000..0b3001bbd --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneAnonymousOperation.js.flow @@ -0,0 +1,36 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { type ASTVisitor } from '../../language/visitor'; + +export function anonOperationNotAloneMessage(): string { + return 'This anonymous operation must be the only defined operation.'; +} + +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + */ +export function LoneAnonymousOperation( + context: ASTValidationContext, +): ASTVisitor { + let operationCount = 0; + return { + Document(node) { + operationCount = node.definitions.filter( + definition => definition.kind === Kind.OPERATION_DEFINITION, + ).length; + }, + OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError( + new GraphQLError(anonOperationNotAloneMessage(), node), + ); + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/LoneAnonymousOperation.mjs b/node_modules/graphql/validation/rules/LoneAnonymousOperation.mjs new file mode 100644 index 000000000..74a9f9d55 --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneAnonymousOperation.mjs @@ -0,0 +1,27 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +export function anonOperationNotAloneMessage() { + return 'This anonymous operation must be the only defined operation.'; +} +/** + * Lone anonymous operation + * + * A GraphQL document is only valid if when it contains an anonymous operation + * (the query short-hand) that it contains only that one operation definition. + */ + +export function LoneAnonymousOperation(context) { + var operationCount = 0; + return { + Document: function Document(node) { + operationCount = node.definitions.filter(function (definition) { + return definition.kind === Kind.OPERATION_DEFINITION; + }).length; + }, + OperationDefinition: function OperationDefinition(node) { + if (!node.name && operationCount > 1) { + context.reportError(new GraphQLError(anonOperationNotAloneMessage(), node)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/LoneSchemaDefinition.js b/node_modules/graphql/validation/rules/LoneSchemaDefinition.js new file mode 100644 index 000000000..42c754708 --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneSchemaDefinition.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.schemaDefinitionNotAloneMessage = schemaDefinitionNotAloneMessage; +exports.canNotDefineSchemaWithinExtensionMessage = canNotDefineSchemaWithinExtensionMessage; +exports.LoneSchemaDefinition = LoneSchemaDefinition; + +var _GraphQLError = require("../../error/GraphQLError"); + +function schemaDefinitionNotAloneMessage() { + return 'Must provide only one schema definition.'; +} + +function canNotDefineSchemaWithinExtensionMessage() { + return 'Cannot define a new schema within a schema extension.'; +} +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + */ + + +function LoneSchemaDefinition(context) { + var oldSchema = context.getSchema(); + var alreadyDefined = oldSchema && (oldSchema.astNode || oldSchema.getQueryType() || oldSchema.getMutationType() || oldSchema.getSubscriptionType()); + var schemaDefinitionsCount = 0; + return { + SchemaDefinition: function SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError(new _GraphQLError.GraphQLError(canNotDefineSchemaWithinExtensionMessage(), node)); + return; + } + + if (schemaDefinitionsCount > 0) { + context.reportError(new _GraphQLError.GraphQLError(schemaDefinitionNotAloneMessage(), node)); + } + + ++schemaDefinitionsCount; + } + }; +} diff --git a/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow b/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow new file mode 100644 index 000000000..0fd6e8e24 --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow @@ -0,0 +1,49 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function schemaDefinitionNotAloneMessage(): string { + return 'Must provide only one schema definition.'; +} + +export function canNotDefineSchemaWithinExtensionMessage(): string { + return 'Cannot define a new schema within a schema extension.'; +} + +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + */ +export function LoneSchemaDefinition( + context: SDLValidationContext, +): ASTVisitor { + const oldSchema = context.getSchema(); + const alreadyDefined = + oldSchema && + (oldSchema.astNode || + oldSchema.getQueryType() || + oldSchema.getMutationType() || + oldSchema.getSubscriptionType()); + + let schemaDefinitionsCount = 0; + return { + SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError( + new GraphQLError(canNotDefineSchemaWithinExtensionMessage(), node), + ); + return; + } + + if (schemaDefinitionsCount > 0) { + context.reportError( + new GraphQLError(schemaDefinitionNotAloneMessage(), node), + ); + } + ++schemaDefinitionsCount; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs b/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs new file mode 100644 index 000000000..c9961ecf4 --- /dev/null +++ b/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs @@ -0,0 +1,32 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function schemaDefinitionNotAloneMessage() { + return 'Must provide only one schema definition.'; +} +export function canNotDefineSchemaWithinExtensionMessage() { + return 'Cannot define a new schema within a schema extension.'; +} +/** + * Lone Schema definition + * + * A GraphQL document is only valid if it contains only one schema definition. + */ + +export function LoneSchemaDefinition(context) { + var oldSchema = context.getSchema(); + var alreadyDefined = oldSchema && (oldSchema.astNode || oldSchema.getQueryType() || oldSchema.getMutationType() || oldSchema.getSubscriptionType()); + var schemaDefinitionsCount = 0; + return { + SchemaDefinition: function SchemaDefinition(node) { + if (alreadyDefined) { + context.reportError(new GraphQLError(canNotDefineSchemaWithinExtensionMessage(), node)); + return; + } + + if (schemaDefinitionsCount > 0) { + context.reportError(new GraphQLError(schemaDefinitionNotAloneMessage(), node)); + } + + ++schemaDefinitionsCount; + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoFragmentCycles.js b/node_modules/graphql/validation/rules/NoFragmentCycles.js new file mode 100644 index 000000000..e75b89ee1 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoFragmentCycles.js @@ -0,0 +1,94 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.cycleErrorMessage = cycleErrorMessage; +exports.NoFragmentCycles = NoFragmentCycles; + +var _GraphQLError = require("../../error/GraphQLError"); + +function cycleErrorMessage(fragName, spreadNames) { + var via = spreadNames.length ? ' via ' + spreadNames.join(', ') : ''; + return "Cannot spread fragment \"".concat(fragName, "\" within itself").concat(via, "."); +} + +function NoFragmentCycles(context) { + // Tracks already visited fragments to maintain O(N) and to ensure that cycles + // are not redundantly reported. + var visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors + + var spreadPath = []; // Position in the spread path + + var spreadPathIndexByName = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + } + }; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(fragment) { + if (visitedFrags[fragment.name.value]) { + return; + } + + var fragmentName = fragment.name.value; + visitedFrags[fragmentName] = true; + var spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + + if (spreadNodes.length === 0) { + return; + } + + spreadPathIndexByName[fragmentName] = spreadPath.length; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = spreadNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var spreadNode = _step.value; + var spreadName = spreadNode.name.value; + var cycleIndex = spreadPathIndexByName[spreadName]; + spreadPath.push(spreadNode); + + if (cycleIndex === undefined) { + var spreadFragment = context.getFragment(spreadName); + + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } else { + var cyclePath = spreadPath.slice(cycleIndex); + var fragmentNames = cyclePath.slice(0, -1).map(function (s) { + return s.name.value; + }); + context.reportError(new _GraphQLError.GraphQLError(cycleErrorMessage(spreadName, fragmentNames), cyclePath)); + } + + spreadPath.pop(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + spreadPathIndexByName[fragmentName] = undefined; + } +} diff --git a/node_modules/graphql/validation/rules/NoFragmentCycles.js.flow b/node_modules/graphql/validation/rules/NoFragmentCycles.js.flow new file mode 100644 index 000000000..4792968eb --- /dev/null +++ b/node_modules/graphql/validation/rules/NoFragmentCycles.js.flow @@ -0,0 +1,78 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type FragmentDefinitionNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; + +export function cycleErrorMessage( + fragName: string, + spreadNames: $ReadOnlyArray, +): string { + const via = spreadNames.length ? ' via ' + spreadNames.join(', ') : ''; + return `Cannot spread fragment "${fragName}" within itself${via}.`; +} + +export function NoFragmentCycles(context: ASTValidationContext): ASTVisitor { + // Tracks already visited fragments to maintain O(N) and to ensure that cycles + // are not redundantly reported. + const visitedFrags = Object.create(null); + + // Array of AST nodes used to produce meaningful errors + const spreadPath = []; + + // Position in the spread path + const spreadPathIndexByName = Object.create(null); + + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + }, + }; + + // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + function detectCycleRecursive(fragment: FragmentDefinitionNode) { + if (visitedFrags[fragment.name.value]) { + return; + } + + const fragmentName = fragment.name.value; + visitedFrags[fragmentName] = true; + + const spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + if (spreadNodes.length === 0) { + return; + } + + spreadPathIndexByName[fragmentName] = spreadPath.length; + + for (const spreadNode of spreadNodes) { + const spreadName = spreadNode.name.value; + const cycleIndex = spreadPathIndexByName[spreadName]; + + spreadPath.push(spreadNode); + if (cycleIndex === undefined) { + const spreadFragment = context.getFragment(spreadName); + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } else { + const cyclePath = spreadPath.slice(cycleIndex); + const fragmentNames = cyclePath.slice(0, -1).map(s => s.name.value); + context.reportError( + new GraphQLError( + cycleErrorMessage(spreadName, fragmentNames), + cyclePath, + ), + ); + } + spreadPath.pop(); + } + + spreadPathIndexByName[fragmentName] = undefined; + } +} diff --git a/node_modules/graphql/validation/rules/NoFragmentCycles.mjs b/node_modules/graphql/validation/rules/NoFragmentCycles.mjs new file mode 100644 index 000000000..43b0e16fa --- /dev/null +++ b/node_modules/graphql/validation/rules/NoFragmentCycles.mjs @@ -0,0 +1,84 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function cycleErrorMessage(fragName, spreadNames) { + var via = spreadNames.length ? ' via ' + spreadNames.join(', ') : ''; + return "Cannot spread fragment \"".concat(fragName, "\" within itself").concat(via, "."); +} +export function NoFragmentCycles(context) { + // Tracks already visited fragments to maintain O(N) and to ensure that cycles + // are not redundantly reported. + var visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors + + var spreadPath = []; // Position in the spread path + + var spreadPathIndexByName = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + detectCycleRecursive(node); + return false; + } + }; // This does a straight-forward DFS to find cycles. + // It does not terminate when a cycle was found but continues to explore + // the graph to find all possible cycles. + + function detectCycleRecursive(fragment) { + if (visitedFrags[fragment.name.value]) { + return; + } + + var fragmentName = fragment.name.value; + visitedFrags[fragmentName] = true; + var spreadNodes = context.getFragmentSpreads(fragment.selectionSet); + + if (spreadNodes.length === 0) { + return; + } + + spreadPathIndexByName[fragmentName] = spreadPath.length; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = spreadNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var spreadNode = _step.value; + var spreadName = spreadNode.name.value; + var cycleIndex = spreadPathIndexByName[spreadName]; + spreadPath.push(spreadNode); + + if (cycleIndex === undefined) { + var spreadFragment = context.getFragment(spreadName); + + if (spreadFragment) { + detectCycleRecursive(spreadFragment); + } + } else { + var cyclePath = spreadPath.slice(cycleIndex); + var fragmentNames = cyclePath.slice(0, -1).map(function (s) { + return s.name.value; + }); + context.reportError(new GraphQLError(cycleErrorMessage(spreadName, fragmentNames), cyclePath)); + } + + spreadPath.pop(); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + spreadPathIndexByName[fragmentName] = undefined; + } +} diff --git a/node_modules/graphql/validation/rules/NoUndefinedVariables.js b/node_modules/graphql/validation/rules/NoUndefinedVariables.js new file mode 100644 index 000000000..28a0879e9 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUndefinedVariables.js @@ -0,0 +1,65 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.undefinedVarMessage = undefinedVarMessage; +exports.NoUndefinedVariables = NoUndefinedVariables; + +var _GraphQLError = require("../../error/GraphQLError"); + +function undefinedVarMessage(varName, opName) { + return opName ? "Variable \"$".concat(varName, "\" is not defined by operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is not defined."); +} +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + */ + + +function NoUndefinedVariables(context) { + var variableNameDefined = Object.create(null); + return { + OperationDefinition: { + enter: function enter() { + variableNameDefined = Object.create(null); + }, + leave: function leave(operation) { + var usages = context.getRecursiveVariableUsages(operation); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + var varName = node.name.value; + + if (variableNameDefined[varName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation])); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + }, + VariableDefinition: function VariableDefinition(node) { + variableNameDefined[node.variable.name.value] = true; + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoUndefinedVariables.js.flow b/node_modules/graphql/validation/rules/NoUndefinedVariables.js.flow new file mode 100644 index 000000000..2fe80b1ef --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUndefinedVariables.js.flow @@ -0,0 +1,50 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function undefinedVarMessage(varName: string, opName: ?string): string { + return opName + ? `Variable "$${varName}" is not defined by operation "${opName}".` + : `Variable "$${varName}" is not defined.`; +} + +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + */ +export function NoUndefinedVariables(context: ValidationContext): ASTVisitor { + let variableNameDefined = Object.create(null); + + return { + OperationDefinition: { + enter() { + variableNameDefined = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + + for (const { node } of usages) { + const varName = node.name.value; + if (variableNameDefined[varName] !== true) { + context.reportError( + new GraphQLError( + undefinedVarMessage( + varName, + operation.name && operation.name.value, + ), + [node, operation], + ), + ); + } + } + }, + }, + VariableDefinition(node) { + variableNameDefined[node.variable.name.value] = true; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/NoUndefinedVariables.mjs b/node_modules/graphql/validation/rules/NoUndefinedVariables.mjs new file mode 100644 index 000000000..a9cc11b20 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUndefinedVariables.mjs @@ -0,0 +1,55 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function undefinedVarMessage(varName, opName) { + return opName ? "Variable \"$".concat(varName, "\" is not defined by operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is not defined."); +} +/** + * No undefined variables + * + * A GraphQL operation is only valid if all variables encountered, both directly + * and via fragment spreads, are defined by that operation. + */ + +export function NoUndefinedVariables(context) { + var variableNameDefined = Object.create(null); + return { + OperationDefinition: { + enter: function enter() { + variableNameDefined = Object.create(null); + }, + leave: function leave(operation) { + var usages = context.getRecursiveVariableUsages(operation); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + var varName = node.name.value; + + if (variableNameDefined[varName] !== true) { + context.reportError(new GraphQLError(undefinedVarMessage(varName, operation.name && operation.name.value), [node, operation])); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + }, + VariableDefinition: function VariableDefinition(node) { + variableNameDefined[node.variable.name.value] = true; + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedFragments.js b/node_modules/graphql/validation/rules/NoUnusedFragments.js new file mode 100644 index 000000000..eaf2606f5 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedFragments.js @@ -0,0 +1,76 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unusedFragMessage = unusedFragMessage; +exports.NoUnusedFragments = NoUnusedFragments; + +var _GraphQLError = require("../../error/GraphQLError"); + +function unusedFragMessage(fragName) { + return "Fragment \"".concat(fragName, "\" is never used."); +} +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + */ + + +function NoUnusedFragments(context) { + var operationDefs = []; + var fragmentDefs = []; + return { + OperationDefinition: function OperationDefinition(node) { + operationDefs.push(node); + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave: function leave() { + var fragmentNameUsed = Object.create(null); + + for (var _i = 0, _operationDefs = operationDefs; _i < _operationDefs.length; _i++) { + var operation = _operationDefs[_i]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fragment = _step.value; + fragmentNameUsed[fragment.name.value] = true; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + for (var _i2 = 0, _fragmentDefs = fragmentDefs; _i2 < _fragmentDefs.length; _i2++) { + var fragmentDef = _fragmentDefs[_i2]; + var fragName = fragmentDef.name.value; + + if (fragmentNameUsed[fragName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(unusedFragMessage(fragName), fragmentDef)); + } + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedFragments.js.flow b/node_modules/graphql/validation/rules/NoUnusedFragments.js.flow new file mode 100644 index 000000000..7845e6d84 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedFragments.js.flow @@ -0,0 +1,52 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function unusedFragMessage(fragName: string): string { + return `Fragment "${fragName}" is never used.`; +} + +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + */ +export function NoUnusedFragments(context: ASTValidationContext): ASTVisitor { + const operationDefs = []; + const fragmentDefs = []; + + return { + OperationDefinition(node) { + operationDefs.push(node); + return false; + }, + FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave() { + const fragmentNameUsed = Object.create(null); + for (const operation of operationDefs) { + for (const fragment of context.getRecursivelyReferencedFragments( + operation, + )) { + fragmentNameUsed[fragment.name.value] = true; + } + } + + for (const fragmentDef of fragmentDefs) { + const fragName = fragmentDef.name.value; + if (fragmentNameUsed[fragName] !== true) { + context.reportError( + new GraphQLError(unusedFragMessage(fragName), fragmentDef), + ); + } + } + }, + }, + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedFragments.mjs b/node_modules/graphql/validation/rules/NoUnusedFragments.mjs new file mode 100644 index 000000000..15add5cba --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedFragments.mjs @@ -0,0 +1,66 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function unusedFragMessage(fragName) { + return "Fragment \"".concat(fragName, "\" is never used."); +} +/** + * No unused fragments + * + * A GraphQL document is only valid if all fragment definitions are spread + * within operations, or spread within other fragments spread within operations. + */ + +export function NoUnusedFragments(context) { + var operationDefs = []; + var fragmentDefs = []; + return { + OperationDefinition: function OperationDefinition(node) { + operationDefs.push(node); + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + fragmentDefs.push(node); + return false; + }, + Document: { + leave: function leave() { + var fragmentNameUsed = Object.create(null); + + for (var _i = 0, _operationDefs = operationDefs; _i < _operationDefs.length; _i++) { + var operation = _operationDefs[_i]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fragment = _step.value; + fragmentNameUsed[fragment.name.value] = true; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + for (var _i2 = 0, _fragmentDefs = fragmentDefs; _i2 < _fragmentDefs.length; _i2++) { + var fragmentDef = _fragmentDefs[_i2]; + var fragName = fragmentDef.name.value; + + if (fragmentNameUsed[fragName] !== true) { + context.reportError(new GraphQLError(unusedFragMessage(fragName), fragmentDef)); + } + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedVariables.js b/node_modules/graphql/validation/rules/NoUnusedVariables.js new file mode 100644 index 000000000..7336fe8e6 --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedVariables.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.unusedVariableMessage = unusedVariableMessage; +exports.NoUnusedVariables = NoUnusedVariables; + +var _GraphQLError = require("../../error/GraphQLError"); + +function unusedVariableMessage(varName, opName) { + return opName ? "Variable \"$".concat(varName, "\" is never used in operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is never used."); +} +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + */ + + +function NoUnusedVariables(context) { + var variableDefs = []; + return { + OperationDefinition: { + enter: function enter() { + variableDefs = []; + }, + leave: function leave(operation) { + var variableNameUsed = Object.create(null); + var usages = context.getRecursiveVariableUsages(operation); + var opName = operation.name ? operation.name.value : null; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + variableNameUsed[node.name.value] = true; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + for (var _i = 0, _variableDefs = variableDefs; _i < _variableDefs.length; _i++) { + var variableDef = _variableDefs[_i]; + var variableName = variableDef.variable.name.value; + + if (variableNameUsed[variableName] !== true) { + context.reportError(new _GraphQLError.GraphQLError(unusedVariableMessage(variableName, opName), variableDef)); + } + } + } + }, + VariableDefinition: function VariableDefinition(def) { + variableDefs.push(def); + } + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedVariables.js.flow b/node_modules/graphql/validation/rules/NoUnusedVariables.js.flow new file mode 100644 index 000000000..72ed34d8a --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedVariables.js.flow @@ -0,0 +1,56 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function unusedVariableMessage( + varName: string, + opName: ?string, +): string { + return opName + ? `Variable "$${varName}" is never used in operation "${opName}".` + : `Variable "$${varName}" is never used.`; +} + +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + */ +export function NoUnusedVariables(context: ValidationContext): ASTVisitor { + let variableDefs = []; + + return { + OperationDefinition: { + enter() { + variableDefs = []; + }, + leave(operation) { + const variableNameUsed = Object.create(null); + const usages = context.getRecursiveVariableUsages(operation); + const opName = operation.name ? operation.name.value : null; + + for (const { node } of usages) { + variableNameUsed[node.name.value] = true; + } + + for (const variableDef of variableDefs) { + const variableName = variableDef.variable.name.value; + if (variableNameUsed[variableName] !== true) { + context.reportError( + new GraphQLError( + unusedVariableMessage(variableName, opName), + variableDef, + ), + ); + } + } + }, + }, + VariableDefinition(def) { + variableDefs.push(def); + }, + }; +} diff --git a/node_modules/graphql/validation/rules/NoUnusedVariables.mjs b/node_modules/graphql/validation/rules/NoUnusedVariables.mjs new file mode 100644 index 000000000..d950ec42b --- /dev/null +++ b/node_modules/graphql/validation/rules/NoUnusedVariables.mjs @@ -0,0 +1,62 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function unusedVariableMessage(varName, opName) { + return opName ? "Variable \"$".concat(varName, "\" is never used in operation \"").concat(opName, "\".") : "Variable \"$".concat(varName, "\" is never used."); +} +/** + * No unused variables + * + * A GraphQL operation is only valid if all variables defined by an operation + * are used, either directly or within a spread fragment. + */ + +export function NoUnusedVariables(context) { + var variableDefs = []; + return { + OperationDefinition: { + enter: function enter() { + variableDefs = []; + }, + leave: function leave(operation) { + var variableNameUsed = Object.create(null); + var usages = context.getRecursiveVariableUsages(operation); + var opName = operation.name ? operation.name.value : null; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + variableNameUsed[node.name.value] = true; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + for (var _i = 0, _variableDefs = variableDefs; _i < _variableDefs.length; _i++) { + var variableDef = _variableDefs[_i]; + var variableName = variableDef.variable.name.value; + + if (variableNameUsed[variableName] !== true) { + context.reportError(new GraphQLError(unusedVariableMessage(variableName, opName), variableDef)); + } + } + } + }, + VariableDefinition: function VariableDefinition(def) { + variableDefs.push(def); + } + }; +} diff --git a/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js new file mode 100644 index 000000000..6e18bbd56 --- /dev/null +++ b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js @@ -0,0 +1,614 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fieldsConflictMessage = fieldsConflictMessage; +exports.OverlappingFieldsCanBeMerged = OverlappingFieldsCanBeMerged; + +var _find = _interopRequireDefault(require("../../polyfills/find")); + +var _objectEntries = _interopRequireDefault(require("../../polyfills/objectEntries")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _kinds = require("../../language/kinds"); + +var _printer = require("../../language/printer"); + +var _definition = require("../../type/definition"); + +var _typeFromAST = require("../../utilities/typeFromAST"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function fieldsConflictMessage(responseName, reason) { + return "Fields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(reason), ". ") + 'Use different aliases on the fields to fetch both if this was intentional.'; +} + +function reasonMessage(reason) { + if (Array.isArray(reason)) { + return reason.map(function (_ref) { + var responseName = _ref[0], + subreason = _ref[1]; + return "subfields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(subreason)); + }).join(' and '); + } + + return reason; +} +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + */ + + +function OverlappingFieldsCanBeMerged(context) { + // A memoization for when two fragments are compared "between" each other for + // conflicts. Two fragments may be compared many times, so memoizing this can + // dramatically improve the performance of this validator. + var comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given + // selection set. Selection sets may be asked for this information multiple + // times, so this improves the performance of this validator. + + var cachedFieldsAndFragmentNames = new Map(); + return { + SelectionSet: function SelectionSet(selectionSet) { + var conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet); + + for (var _i = 0, _conflicts = conflicts; _i < _conflicts.length; _i++) { + var _ref3 = _conflicts[_i]; + var _ref2$ = _ref3[0]; + var responseName = _ref2$[0]; + var reason = _ref2$[1]; + var fields1 = _ref3[1]; + var fields2 = _ref3[2]; + context.reportError(new _GraphQLError.GraphQLError(fieldsConflictMessage(responseName, reason), fields1.concat(fields2))); + } + } + }; +} + +/** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + * + */ +// Find all conflicts found "within" a selection set, including those found +// via spreading in fragments. Called when visiting each SelectionSet in the +// GraphQL Document. +function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) { + var conflicts = []; + + var _getFieldsAndFragment = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet), + fieldMap = _getFieldsAndFragment[0], + fragmentNames = _getFieldsAndFragment[1]; // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + + + collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap); + + if (fragmentNames.length !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + var comparedFragments = Object.create(null); + + for (var i = 0; i < fragmentNames.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other + // item in that same list (except for itself). + + for (var j = i + 1; j < fragmentNames.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]); + } + } + } + + return conflicts; +} // Collect all conflicts found between a set of fields and a fragment reference +// including via spreading in any nested fragments. + + +function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { + // Memoize so a fragment is not compared for conflicts more than once. + if (comparedFragments[fragmentName]) { + return; + } + + comparedFragments[fragmentName] = true; + var fragment = context.getFragment(fragmentName); + + if (!fragment) { + return; + } + + var _getReferencedFieldsA = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment), + fieldMap2 = _getReferencedFieldsA[0], + fragmentNames2 = _getReferencedFieldsA[1]; // Do not compare a fragment's fieldMap to itself. + + + if (fieldMap === fieldMap2) { + return; + } // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + + for (var i = 0; i < fragmentNames2.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentNames2[i]); + } +} // Collect all conflicts found between two fragments, including via spreading in +// any nested fragments. + + +function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { + // No need to compare a fragment to itself. + if (fragmentName1 === fragmentName2) { + return; + } // Memoize so two fragments are not compared for conflicts more than once. + + + if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) { + return; + } + + comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); + var fragment1 = context.getFragment(fragmentName1); + var fragment2 = context.getFragment(fragmentName2); + + if (!fragment1 || !fragment2) { + return; + } + + var _getReferencedFieldsA2 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1), + fieldMap1 = _getReferencedFieldsA2[0], + fragmentNames1 = _getReferencedFieldsA2[1]; + + var _getReferencedFieldsA3 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2), + fieldMap2 = _getReferencedFieldsA3[0], + fragmentNames2 = _getReferencedFieldsA3[1]; // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. + + for (var j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentNames2[j]); + } // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + + + for (var i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[i], fragmentName2); + } +} // Find all conflicts found between two selection sets, including those found +// via spreading in fragments. Called when determining if conflicts exist +// between the sub-fields of two overlapping fields. + + +function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { + var conflicts = []; + + var _getFieldsAndFragment2 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1), + fieldMap1 = _getFieldsAndFragment2[0], + fragmentNames1 = _getFieldsAndFragment2[1]; + + var _getFieldsAndFragment3 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2), + fieldMap2 = _getFieldsAndFragment3[0], + fragmentNames2 = _getFieldsAndFragment3[1]; // (H) First, collect all conflicts between these two collections of field. + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + + if (fragmentNames2.length !== 0) { + var comparedFragments = Object.create(null); + + for (var j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentNames2[j]); + } + } // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + + + if (fragmentNames1.length !== 0) { + var _comparedFragments = Object.create(null); + + for (var i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, _comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentNames1[i]); + } + } // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + + + for (var _i2 = 0; _i2 < fragmentNames1.length; _i2++) { + for (var _j = 0; _j < fragmentNames2.length; _j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i2], fragmentNames2[_j]); + } + } + + return conflicts; +} // Collect all Conflicts "within" one collection of fields. + + +function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectEntries.default)(fieldMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref5 = _step.value; + var responseName = _ref5[0]; + var fields = _ref5[1]; + + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + if (fields.length > 1) { + for (var i = 0; i < fields.length; i++) { + for (var j = i + 1; j < fields.length; j++) { + var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, // within one collection is never mutually exclusive + responseName, fields[i], fields[j]); + + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } +} // Collect all Conflicts between two collections of fields. This is similar to, +// but different from the `collectConflictsWithin` function above. This check +// assumes that `collectConflictsWithin` has already been called on each +// provided collection of fields. This is true because this validator traverses +// each individual selection set. + + +function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + for (var _i3 = 0, _Object$keys = Object.keys(fieldMap1); _i3 < _Object$keys.length; _i3++) { + var responseName = _Object$keys[_i3]; + var fields2 = fieldMap2[responseName]; + + if (fields2) { + var fields1 = fieldMap1[responseName]; + + for (var i = 0; i < fields1.length; i++) { + for (var j = 0; j < fields2.length; j++) { + var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, fields1[i], fields2[j]); + + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} // Determines if there is a conflict between two particular fields, including +// comparing their sub-fields. + + +function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { + var parentType1 = field1[0], + node1 = field1[1], + def1 = field1[2]; + var parentType2 = field2[0], + node2 = field2[1], + def2 = field2[2]; // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. + + var areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && (0, _definition.isObjectType)(parentType1) && (0, _definition.isObjectType)(parentType2); // The return type for each field. + + var type1 = def1 && def1.type; + var type2 = def2 && def2.type; + + if (!areMutuallyExclusive) { + // Two aliases must refer to the same field. + var name1 = node1.name.value; + var name2 = node2.name.value; + + if (name1 !== name2) { + return [[responseName, "".concat(name1, " and ").concat(name2, " are different fields")], [node1], [node2]]; + } // Two field calls must have the same arguments. + + + if (!sameArguments(node1.arguments || [], node2.arguments || [])) { + return [[responseName, 'they have differing arguments'], [node1], [node2]]; + } + } + + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [[responseName, "they return conflicting types ".concat((0, _inspect.default)(type1), " and ").concat((0, _inspect.default)(type2))], [node1], [node2]]; + } // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. + + + var selectionSet1 = node1.selectionSet; + var selectionSet2 = node2.selectionSet; + + if (selectionSet1 && selectionSet2) { + var conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, (0, _definition.getNamedType)(type1), selectionSet1, (0, _definition.getNamedType)(type2), selectionSet2); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} + +function sameArguments(arguments1, arguments2) { + if (arguments1.length !== arguments2.length) { + return false; + } + + return arguments1.every(function (argument1) { + var argument2 = (0, _find.default)(arguments2, function (argument) { + return argument.name.value === argument1.name.value; + }); + + if (!argument2) { + return false; + } + + return sameValue(argument1.value, argument2.value); + }); +} + +function sameValue(value1, value2) { + return !value1 && !value2 || (0, _printer.print)(value1) === (0, _printer.print)(value2); +} // Two types conflict if both types could not apply to a value simultaneously. +// Composite types are ignored as their individual field types will be compared +// later recursively. However List and Non-Null types must match. + + +function doTypesConflict(type1, type2) { + if ((0, _definition.isListType)(type1)) { + return (0, _definition.isListType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; + } + + if ((0, _definition.isListType)(type2)) { + return true; + } + + if ((0, _definition.isNonNullType)(type1)) { + return (0, _definition.isNonNullType)(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; + } + + if ((0, _definition.isNonNullType)(type2)) { + return true; + } + + if ((0, _definition.isLeafType)(type1) || (0, _definition.isLeafType)(type2)) { + return type1 !== type2; + } + + return false; +} // Given a selection set, return the collection of fields (a mapping of response +// name to field nodes and definitions) as well as a list of fragment names +// referenced via fragment spreads. + + +function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { + var cached = cachedFieldsAndFragmentNames.get(selectionSet); + + if (!cached) { + var nodeAndDefs = Object.create(null); + var fragmentNames = Object.create(null); + + _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames); + + cached = [nodeAndDefs, Object.keys(fragmentNames)]; + cachedFieldsAndFragmentNames.set(selectionSet, cached); + } + + return cached; +} // Given a reference to a fragment, return the represented collection of fields +// as well as a list of nested fragment names referenced via fragment spreads. + + +function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { + // Short-circuit building a type from the node if possible. + var cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); + + if (cached) { + return cached; + } + + var fragmentType = (0, _typeFromAST.typeFromAST)(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet); +} + +function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) { + for (var i = 0; i < selectionSet.selections.length; i++) { + var selection = selectionSet.selections[i]; + + switch (selection.kind) { + case _kinds.Kind.FIELD: + { + var fieldName = selection.name.value; + var fieldDef = void 0; + + if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + + var responseName = selection.alias ? selection.alias.value : fieldName; + + if (!nodeAndDefs[responseName]) { + nodeAndDefs[responseName] = []; + } + + nodeAndDefs[responseName].push([parentType, selection, fieldDef]); + break; + } + + case _kinds.Kind.FRAGMENT_SPREAD: + fragmentNames[selection.name.value] = true; + break; + + case _kinds.Kind.INLINE_FRAGMENT: + { + var typeCondition = selection.typeCondition; + var inlineFragmentType = typeCondition ? (0, _typeFromAST.typeFromAST)(context.getSchema(), typeCondition) : parentType; + + _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames); + + break; + } + } + } +} // Given a series of Conflicts which occurred between two sub-fields, generate +// a single Conflict. + + +function subfieldConflicts(conflicts, responseName, node1, node2) { + if (conflicts.length > 0) { + return [[responseName, conflicts.map(function (_ref6) { + var reason = _ref6[0]; + return reason; + })], conflicts.reduce(function (allFields, _ref7) { + var fields1 = _ref7[1]; + return allFields.concat(fields1); + }, [node1]), conflicts.reduce(function (allFields, _ref8) { + var fields2 = _ref8[2]; + return allFields.concat(fields2); + }, [node2])]; + } +} +/** + * A way to keep track of pairs of things when the ordering of the pair does + * not matter. We do this by maintaining a sort of double adjacency sets. + */ + + +var PairSet = +/*#__PURE__*/ +function () { + function PairSet() { + this._data = Object.create(null); + } + + var _proto = PairSet.prototype; + + _proto.has = function has(a, b, areMutuallyExclusive) { + var first = this._data[a]; + var result = first && first[b]; + + if (result === undefined) { + return false; + } // areMutuallyExclusive being false is a superset of being true, + // hence if we want to know if this PairSet "has" these two with no + // exclusivity, we have to ensure it was added as such. + + + if (areMutuallyExclusive === false) { + return result === false; + } + + return true; + }; + + _proto.add = function add(a, b, areMutuallyExclusive) { + _pairSetAdd(this._data, a, b, areMutuallyExclusive); + + _pairSetAdd(this._data, b, a, areMutuallyExclusive); + }; + + return PairSet; +}(); + +function _pairSetAdd(data, a, b, areMutuallyExclusive) { + var map = data[a]; + + if (!map) { + map = Object.create(null); + data[a] = map; + } + + map[b] = areMutuallyExclusive; +} diff --git a/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js.flow b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js.flow new file mode 100644 index 000000000..a7c23cc0a --- /dev/null +++ b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.js.flow @@ -0,0 +1,840 @@ +// @flow strict + +import find from '../../polyfills/find'; +import objectEntries from '../../polyfills/objectEntries'; +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import inspect from '../../jsutils/inspect'; +import { type ObjMap } from '../../jsutils/ObjMap'; +import { + type SelectionSetNode, + type FieldNode, + type ArgumentNode, + type FragmentDefinitionNode, +} from '../../language/ast'; +import { Kind } from '../../language/kinds'; +import { print } from '../../language/printer'; +import { type ASTVisitor } from '../../language/visitor'; +import { + type GraphQLNamedType, + type GraphQLOutputType, + type GraphQLCompositeType, + type GraphQLField, + getNamedType, + isNonNullType, + isLeafType, + isObjectType, + isListType, + isInterfaceType, +} from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; + +export function fieldsConflictMessage( + responseName: string, + reason: ConflictReasonMessage, +): string { + return ( + `Fields "${responseName}" conflict because ${reasonMessage(reason)}. ` + + 'Use different aliases on the fields to fetch both if this was intentional.' + ); +} + +function reasonMessage(reason: ConflictReasonMessage): string { + if (Array.isArray(reason)) { + return reason + .map( + ([responseName, subreason]) => + `subfields "${responseName}" conflict because ${reasonMessage( + subreason, + )}`, + ) + .join(' and '); + } + return reason; +} + +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + */ +export function OverlappingFieldsCanBeMerged( + context: ValidationContext, +): ASTVisitor { + // A memoization for when two fragments are compared "between" each other for + // conflicts. Two fragments may be compared many times, so memoizing this can + // dramatically improve the performance of this validator. + const comparedFragmentPairs = new PairSet(); + + // A cache for the "field map" and list of fragment names found in any given + // selection set. Selection sets may be asked for this information multiple + // times, so this improves the performance of this validator. + const cachedFieldsAndFragmentNames = new Map(); + + return { + SelectionSet(selectionSet) { + const conflicts = findConflictsWithinSelectionSet( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + context.getParentType(), + selectionSet, + ); + for (const [[responseName, reason], fields1, fields2] of conflicts) { + context.reportError( + new GraphQLError( + fieldsConflictMessage(responseName, reason), + fields1.concat(fields2), + ), + ); + } + }, + }; +} + +type Conflict = [ConflictReason, Array, Array]; +// Field name and reason. +type ConflictReason = [string, ConflictReasonMessage]; +// Reason is a string, or a nested list of conflicts. +type ConflictReasonMessage = string | Array; +// Tuple defining a field node in a context. +type NodeAndDef = [GraphQLCompositeType, FieldNode, ?GraphQLField<*, *>]; +// Map of array of those. +type NodeAndDefCollection = ObjMap>; + +/** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + * + */ + +// Find all conflicts found "within" a selection set, including those found +// via spreading in fragments. Called when visiting each SelectionSet in the +// GraphQL Document. +function findConflictsWithinSelectionSet( + context: ValidationContext, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + parentType: ?GraphQLNamedType, + selectionSet: SelectionSetNode, +): Array { + const conflicts = []; + + const [fieldMap, fragmentNames] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType, + selectionSet, + ); + + // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + collectConflictsWithin( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + fieldMap, + ); + + if (fragmentNames.length !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + const comparedFragments = Object.create(null); + for (let i = 0; i < fragmentNames.length; i++) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragments, + comparedFragmentPairs, + false, + fieldMap, + fragmentNames[i], + ); + // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other + // item in that same list (except for itself). + for (let j = i + 1; j < fragmentNames.length; j++) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, + fragmentNames[i], + fragmentNames[j], + ); + } + } + } + return conflicts; +} + +// Collect all conflicts found between a set of fields and a fragment reference +// including via spreading in any nested fragments. +function collectConflictsBetweenFieldsAndFragment( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames, + comparedFragments: ObjMap, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + fieldMap: NodeAndDefCollection, + fragmentName: string, +): void { + // Memoize so a fragment is not compared for conflicts more than once. + if (comparedFragments[fragmentName]) { + return; + } + comparedFragments[fragmentName] = true; + + const fragment = context.getFragment(fragmentName); + if (!fragment) { + return; + } + + const [fieldMap2, fragmentNames2] = getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment, + ); + + // Do not compare a fragment's fieldMap to itself. + if (fieldMap === fieldMap2) { + return; + } + + // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap, + fieldMap2, + ); + + // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + for (let i = 0; i < fragmentNames2.length; i++) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragments, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap, + fragmentNames2[i], + ); + } +} + +// Collect all conflicts found between two fragments, including via spreading in +// any nested fragments. +function collectConflictsBetweenFragments( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + fragmentName1: string, + fragmentName2: string, +): void { + // No need to compare a fragment to itself. + if (fragmentName1 === fragmentName2) { + return; + } + + // Memoize so two fragments are not compared for conflicts more than once. + if ( + comparedFragmentPairs.has( + fragmentName1, + fragmentName2, + areMutuallyExclusive, + ) + ) { + return; + } + comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); + + const fragment1 = context.getFragment(fragmentName1); + const fragment2 = context.getFragment(fragmentName2); + if (!fragment1 || !fragment2) { + return; + } + + const [fieldMap1, fragmentNames1] = getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment1, + ); + const [fieldMap2, fragmentNames2] = getReferencedFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragment2, + ); + + // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fieldMap2, + ); + + // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. + for (let j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fragmentName1, + fragmentNames2[j], + ); + } + + // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + for (let i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fragmentNames1[i], + fragmentName2, + ); + } +} + +// Find all conflicts found between two selection sets, including those found +// via spreading in fragments. Called when determining if conflicts exist +// between the sub-fields of two overlapping fields. +function findConflictsBetweenSubSelectionSets( + context: ValidationContext, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + areMutuallyExclusive: boolean, + parentType1: ?GraphQLNamedType, + selectionSet1: SelectionSetNode, + parentType2: ?GraphQLNamedType, + selectionSet2: SelectionSetNode, +): Array { + const conflicts = []; + + const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType1, + selectionSet1, + ); + const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + parentType2, + selectionSet2, + ); + + // (H) First, collect all conflicts between these two collections of field. + collectConflictsBetween( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fieldMap2, + ); + + // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + if (fragmentNames2.length !== 0) { + const comparedFragments = Object.create(null); + for (let j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragments, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap1, + fragmentNames2[j], + ); + } + } + + // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + if (fragmentNames1.length !== 0) { + const comparedFragments = Object.create(null); + for (let i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFieldsAndFragment( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragments, + comparedFragmentPairs, + areMutuallyExclusive, + fieldMap2, + fragmentNames1[i], + ); + } + } + + // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + for (let i = 0; i < fragmentNames1.length; i++) { + for (let j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFragments( + context, + conflicts, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + fragmentNames1[i], + fragmentNames2[j], + ); + } + } + return conflicts; +} + +// Collect all Conflicts "within" one collection of fields. +function collectConflictsWithin( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + fieldMap: NodeAndDefCollection, +): void { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + for (const [responseName, fields] of objectEntries(fieldMap)) { + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + if (fields.length > 1) { + for (let i = 0; i < fields.length; i++) { + for (let j = i + 1; j < fields.length; j++) { + const conflict = findConflict( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + false, // within one collection is never mutually exclusive + responseName, + fields[i], + fields[j], + ); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} + +// Collect all Conflicts between two collections of fields. This is similar to, +// but different from the `collectConflictsWithin` function above. This check +// assumes that `collectConflictsWithin` has already been called on each +// provided collection of fields. This is true because this validator traverses +// each individual selection set. +function collectConflictsBetween( + context: ValidationContext, + conflicts: Array, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + parentFieldsAreMutuallyExclusive: boolean, + fieldMap1: NodeAndDefCollection, + fieldMap2: NodeAndDefCollection, +): void { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + for (const responseName of Object.keys(fieldMap1)) { + const fields2 = fieldMap2[responseName]; + if (fields2) { + const fields1 = fieldMap1[responseName]; + for (let i = 0; i < fields1.length; i++) { + for (let j = 0; j < fields2.length; j++) { + const conflict = findConflict( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + parentFieldsAreMutuallyExclusive, + responseName, + fields1[i], + fields2[j], + ); + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} + +// Determines if there is a conflict between two particular fields, including +// comparing their sub-fields. +function findConflict( + context: ValidationContext, + cachedFieldsAndFragmentNames, + comparedFragmentPairs: PairSet, + parentFieldsAreMutuallyExclusive: boolean, + responseName: string, + field1: NodeAndDef, + field2: NodeAndDef, +): ?Conflict { + const [parentType1, node1, def1] = field1; + const [parentType2, node2, def2] = field2; + + // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. + const areMutuallyExclusive = + parentFieldsAreMutuallyExclusive || + (parentType1 !== parentType2 && + isObjectType(parentType1) && + isObjectType(parentType2)); + + // The return type for each field. + const type1 = def1 && def1.type; + const type2 = def2 && def2.type; + + if (!areMutuallyExclusive) { + // Two aliases must refer to the same field. + const name1 = node1.name.value; + const name2 = node2.name.value; + if (name1 !== name2) { + return [ + [responseName, `${name1} and ${name2} are different fields`], + [node1], + [node2], + ]; + } + + // Two field calls must have the same arguments. + if (!sameArguments(node1.arguments || [], node2.arguments || [])) { + return [ + [responseName, 'they have differing arguments'], + [node1], + [node2], + ]; + } + } + + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [ + [ + responseName, + `they return conflicting types ${inspect(type1)} and ${inspect(type2)}`, + ], + [node1], + [node2], + ]; + } + + // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. + const selectionSet1 = node1.selectionSet; + const selectionSet2 = node2.selectionSet; + if (selectionSet1 && selectionSet2) { + const conflicts = findConflictsBetweenSubSelectionSets( + context, + cachedFieldsAndFragmentNames, + comparedFragmentPairs, + areMutuallyExclusive, + getNamedType(type1), + selectionSet1, + getNamedType(type2), + selectionSet2, + ); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} + +function sameArguments( + arguments1: $ReadOnlyArray, + arguments2: $ReadOnlyArray, +): boolean { + if (arguments1.length !== arguments2.length) { + return false; + } + return arguments1.every(argument1 => { + const argument2 = find( + arguments2, + argument => argument.name.value === argument1.name.value, + ); + if (!argument2) { + return false; + } + return sameValue(argument1.value, argument2.value); + }); +} + +function sameValue(value1, value2) { + return (!value1 && !value2) || print(value1) === print(value2); +} + +// Two types conflict if both types could not apply to a value simultaneously. +// Composite types are ignored as their individual field types will be compared +// later recursively. However List and Non-Null types must match. +function doTypesConflict( + type1: GraphQLOutputType, + type2: GraphQLOutputType, +): boolean { + if (isListType(type1)) { + return isListType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isListType(type2)) { + return true; + } + if (isNonNullType(type1)) { + return isNonNullType(type2) + ? doTypesConflict(type1.ofType, type2.ofType) + : true; + } + if (isNonNullType(type2)) { + return true; + } + if (isLeafType(type1) || isLeafType(type2)) { + return type1 !== type2; + } + return false; +} + +// Given a selection set, return the collection of fields (a mapping of response +// name to field nodes and definitions) as well as a list of fragment names +// referenced via fragment spreads. +function getFieldsAndFragmentNames( + context: ValidationContext, + cachedFieldsAndFragmentNames, + parentType: ?GraphQLNamedType, + selectionSet: SelectionSetNode, +): [NodeAndDefCollection, Array] { + let cached = cachedFieldsAndFragmentNames.get(selectionSet); + if (!cached) { + const nodeAndDefs = Object.create(null); + const fragmentNames = Object.create(null); + _collectFieldsAndFragmentNames( + context, + parentType, + selectionSet, + nodeAndDefs, + fragmentNames, + ); + cached = [nodeAndDefs, Object.keys(fragmentNames)]; + cachedFieldsAndFragmentNames.set(selectionSet, cached); + } + return cached; +} + +// Given a reference to a fragment, return the represented collection of fields +// as well as a list of nested fragment names referenced via fragment spreads. +function getReferencedFieldsAndFragmentNames( + context: ValidationContext, + cachedFieldsAndFragmentNames, + fragment: FragmentDefinitionNode, +) { + // Short-circuit building a type from the node if possible. + const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); + if (cached) { + return cached; + } + + const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentNames( + context, + cachedFieldsAndFragmentNames, + fragmentType, + fragment.selectionSet, + ); +} + +function _collectFieldsAndFragmentNames( + context: ValidationContext, + parentType: ?GraphQLNamedType, + selectionSet: SelectionSetNode, + nodeAndDefs, + fragmentNames, +): void { + for (let i = 0; i < selectionSet.selections.length; i++) { + const selection = selectionSet.selections[i]; + switch (selection.kind) { + case Kind.FIELD: { + const fieldName = selection.name.value; + let fieldDef; + if (isObjectType(parentType) || isInterfaceType(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + const responseName = selection.alias + ? selection.alias.value + : fieldName; + if (!nodeAndDefs[responseName]) { + nodeAndDefs[responseName] = []; + } + nodeAndDefs[responseName].push([parentType, selection, fieldDef]); + break; + } + case Kind.FRAGMENT_SPREAD: + fragmentNames[selection.name.value] = true; + break; + case Kind.INLINE_FRAGMENT: { + const typeCondition = selection.typeCondition; + const inlineFragmentType = typeCondition + ? typeFromAST(context.getSchema(), typeCondition) + : parentType; + _collectFieldsAndFragmentNames( + context, + inlineFragmentType, + selection.selectionSet, + nodeAndDefs, + fragmentNames, + ); + break; + } + } + } +} + +// Given a series of Conflicts which occurred between two sub-fields, generate +// a single Conflict. +function subfieldConflicts( + conflicts: $ReadOnlyArray, + responseName: string, + node1: FieldNode, + node2: FieldNode, +): ?Conflict { + if (conflicts.length > 0) { + return [ + [responseName, conflicts.map(([reason]) => reason)], + conflicts.reduce((allFields, [, fields1]) => allFields.concat(fields1), [ + node1, + ]), + conflicts.reduce( + (allFields, [, , fields2]) => allFields.concat(fields2), + [node2], + ), + ]; + } +} + +/** + * A way to keep track of pairs of things when the ordering of the pair does + * not matter. We do this by maintaining a sort of double adjacency sets. + */ +class PairSet { + _data: ObjMap>; + + constructor(): void { + this._data = Object.create(null); + } + + has(a: string, b: string, areMutuallyExclusive: boolean) { + const first = this._data[a]; + const result = first && first[b]; + if (result === undefined) { + return false; + } + // areMutuallyExclusive being false is a superset of being true, + // hence if we want to know if this PairSet "has" these two with no + // exclusivity, we have to ensure it was added as such. + if (areMutuallyExclusive === false) { + return result === false; + } + return true; + } + + add(a: string, b: string, areMutuallyExclusive: boolean) { + _pairSetAdd(this._data, a, b, areMutuallyExclusive); + _pairSetAdd(this._data, b, a, areMutuallyExclusive); + } +} + +function _pairSetAdd(data, a, b, areMutuallyExclusive) { + let map = data[a]; + if (!map) { + map = Object.create(null); + data[a] = map; + } + map[b] = areMutuallyExclusive; +} diff --git a/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.mjs b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.mjs new file mode 100644 index 000000000..6b07a910a --- /dev/null +++ b/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMerged.mjs @@ -0,0 +1,596 @@ +import find from '../../polyfills/find'; +import objectEntries from '../../polyfills/objectEntries'; +import { GraphQLError } from '../../error/GraphQLError'; +import inspect from '../../jsutils/inspect'; +import { Kind } from '../../language/kinds'; +import { print } from '../../language/printer'; +import { getNamedType, isNonNullType, isLeafType, isObjectType, isListType, isInterfaceType } from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; +export function fieldsConflictMessage(responseName, reason) { + return "Fields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(reason), ". ") + 'Use different aliases on the fields to fetch both if this was intentional.'; +} + +function reasonMessage(reason) { + if (Array.isArray(reason)) { + return reason.map(function (_ref) { + var responseName = _ref[0], + subreason = _ref[1]; + return "subfields \"".concat(responseName, "\" conflict because ").concat(reasonMessage(subreason)); + }).join(' and '); + } + + return reason; +} +/** + * Overlapping fields can be merged + * + * A selection set is only valid if all fields (including spreading any + * fragments) either correspond to distinct response names or can be merged + * without ambiguity. + */ + + +export function OverlappingFieldsCanBeMerged(context) { + // A memoization for when two fragments are compared "between" each other for + // conflicts. Two fragments may be compared many times, so memoizing this can + // dramatically improve the performance of this validator. + var comparedFragmentPairs = new PairSet(); // A cache for the "field map" and list of fragment names found in any given + // selection set. Selection sets may be asked for this information multiple + // times, so this improves the performance of this validator. + + var cachedFieldsAndFragmentNames = new Map(); + return { + SelectionSet: function SelectionSet(selectionSet) { + var conflicts = findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, context.getParentType(), selectionSet); + + for (var _i = 0, _conflicts = conflicts; _i < _conflicts.length; _i++) { + var _ref3 = _conflicts[_i]; + var _ref2$ = _ref3[0]; + var responseName = _ref2$[0]; + var reason = _ref2$[1]; + var fields1 = _ref3[1]; + var fields2 = _ref3[2]; + context.reportError(new GraphQLError(fieldsConflictMessage(responseName, reason), fields1.concat(fields2))); + } + } + }; +} + +/** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + * + */ +// Find all conflicts found "within" a selection set, including those found +// via spreading in fragments. Called when visiting each SelectionSet in the +// GraphQL Document. +function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentType, selectionSet) { + var conflicts = []; + + var _getFieldsAndFragment = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet), + fieldMap = _getFieldsAndFragment[0], + fragmentNames = _getFieldsAndFragment[1]; // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + + + collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap); + + if (fragmentNames.length !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + var comparedFragments = Object.create(null); + + for (var i = 0; i < fragmentNames.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, false, fieldMap, fragmentNames[i]); // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other + // item in that same list (except for itself). + + for (var j = i + 1; j < fragmentNames.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, fragmentNames[i], fragmentNames[j]); + } + } + } + + return conflicts; +} // Collect all conflicts found between a set of fields and a fragment reference +// including via spreading in any nested fragments. + + +function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { + // Memoize so a fragment is not compared for conflicts more than once. + if (comparedFragments[fragmentName]) { + return; + } + + comparedFragments[fragmentName] = true; + var fragment = context.getFragment(fragmentName); + + if (!fragment) { + return; + } + + var _getReferencedFieldsA = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment), + fieldMap2 = _getReferencedFieldsA[0], + fragmentNames2 = _getReferencedFieldsA[1]; // Do not compare a fragment's fieldMap to itself. + + + if (fieldMap === fieldMap2) { + return; + } // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fieldMap2); // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + + for (var i = 0; i < fragmentNames2.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentNames2[i]); + } +} // Collect all conflicts found between two fragments, including via spreading in +// any nested fragments. + + +function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { + // No need to compare a fragment to itself. + if (fragmentName1 === fragmentName2) { + return; + } // Memoize so two fragments are not compared for conflicts more than once. + + + if (comparedFragmentPairs.has(fragmentName1, fragmentName2, areMutuallyExclusive)) { + return; + } + + comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive); + var fragment1 = context.getFragment(fragmentName1); + var fragment2 = context.getFragment(fragmentName2); + + if (!fragment1 || !fragment2) { + return; + } + + var _getReferencedFieldsA2 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment1), + fieldMap1 = _getReferencedFieldsA2[0], + fragmentNames1 = _getReferencedFieldsA2[1]; + + var _getReferencedFieldsA3 = getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment2), + fieldMap2 = _getReferencedFieldsA3[0], + fragmentNames2 = _getReferencedFieldsA3[1]; // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. + + for (var j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentNames2[j]); + } // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + + + for (var i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[i], fragmentName2); + } +} // Find all conflicts found between two selection sets, including those found +// via spreading in fragments. Called when determining if conflicts exist +// between the sub-fields of two overlapping fields. + + +function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { + var conflicts = []; + + var _getFieldsAndFragment2 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType1, selectionSet1), + fieldMap1 = _getFieldsAndFragment2[0], + fragmentNames1 = _getFieldsAndFragment2[1]; + + var _getFieldsAndFragment3 = getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType2, selectionSet2), + fieldMap2 = _getFieldsAndFragment3[0], + fragmentNames2 = _getFieldsAndFragment3[1]; // (H) First, collect all conflicts between these two collections of field. + + + collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fieldMap2); // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + + if (fragmentNames2.length !== 0) { + var comparedFragments = Object.create(null); + + for (var j = 0; j < fragmentNames2.length; j++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap1, fragmentNames2[j]); + } + } // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + + + if (fragmentNames1.length !== 0) { + var _comparedFragments = Object.create(null); + + for (var i = 0; i < fragmentNames1.length; i++) { + collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, _comparedFragments, comparedFragmentPairs, areMutuallyExclusive, fieldMap2, fragmentNames1[i]); + } + } // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + + + for (var _i2 = 0; _i2 < fragmentNames1.length; _i2++) { + for (var _j = 0; _j < fragmentNames2.length; _j++) { + collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i2], fragmentNames2[_j]); + } + } + + return conflicts; +} // Collect all Conflicts "within" one collection of fields. + + +function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, fieldMap) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectEntries(fieldMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref5 = _step.value; + var responseName = _ref5[0]; + var fields = _ref5[1]; + + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + if (fields.length > 1) { + for (var i = 0; i < fields.length; i++) { + for (var j = i + 1; j < fields.length; j++) { + var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, false, // within one collection is never mutually exclusive + responseName, fields[i], fields[j]); + + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } +} // Collect all Conflicts between two collections of fields. This is similar to, +// but different from the `collectConflictsWithin` function above. This check +// assumes that `collectConflictsWithin` has already been called on each +// provided collection of fields. This is true because this validator traverses +// each individual selection set. + + +function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + for (var _i3 = 0, _Object$keys = Object.keys(fieldMap1); _i3 < _Object$keys.length; _i3++) { + var responseName = _Object$keys[_i3]; + var fields2 = fieldMap2[responseName]; + + if (fields2) { + var fields1 = fieldMap1[responseName]; + + for (var i = 0; i < fields1.length; i++) { + for (var j = 0; j < fields2.length; j++) { + var conflict = findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, fields1[i], fields2[j]); + + if (conflict) { + conflicts.push(conflict); + } + } + } + } + } +} // Determines if there is a conflict between two particular fields, including +// comparing their sub-fields. + + +function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { + var parentType1 = field1[0], + node1 = field1[1], + def1 = field1[2]; + var parentType2 = field2[0], + node2 = field2[1], + def2 = field2[2]; // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. + + var areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && isObjectType(parentType1) && isObjectType(parentType2); // The return type for each field. + + var type1 = def1 && def1.type; + var type2 = def2 && def2.type; + + if (!areMutuallyExclusive) { + // Two aliases must refer to the same field. + var name1 = node1.name.value; + var name2 = node2.name.value; + + if (name1 !== name2) { + return [[responseName, "".concat(name1, " and ").concat(name2, " are different fields")], [node1], [node2]]; + } // Two field calls must have the same arguments. + + + if (!sameArguments(node1.arguments || [], node2.arguments || [])) { + return [[responseName, 'they have differing arguments'], [node1], [node2]]; + } + } + + if (type1 && type2 && doTypesConflict(type1, type2)) { + return [[responseName, "they return conflicting types ".concat(inspect(type1), " and ").concat(inspect(type2))], [node1], [node2]]; + } // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. + + + var selectionSet1 = node1.selectionSet; + var selectionSet2 = node2.selectionSet; + + if (selectionSet1 && selectionSet2) { + var conflicts = findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, getNamedType(type1), selectionSet1, getNamedType(type2), selectionSet2); + return subfieldConflicts(conflicts, responseName, node1, node2); + } +} + +function sameArguments(arguments1, arguments2) { + if (arguments1.length !== arguments2.length) { + return false; + } + + return arguments1.every(function (argument1) { + var argument2 = find(arguments2, function (argument) { + return argument.name.value === argument1.name.value; + }); + + if (!argument2) { + return false; + } + + return sameValue(argument1.value, argument2.value); + }); +} + +function sameValue(value1, value2) { + return !value1 && !value2 || print(value1) === print(value2); +} // Two types conflict if both types could not apply to a value simultaneously. +// Composite types are ignored as their individual field types will be compared +// later recursively. However List and Non-Null types must match. + + +function doTypesConflict(type1, type2) { + if (isListType(type1)) { + return isListType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; + } + + if (isListType(type2)) { + return true; + } + + if (isNonNullType(type1)) { + return isNonNullType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; + } + + if (isNonNullType(type2)) { + return true; + } + + if (isLeafType(type1) || isLeafType(type2)) { + return type1 !== type2; + } + + return false; +} // Given a selection set, return the collection of fields (a mapping of response +// name to field nodes and definitions) as well as a list of fragment names +// referenced via fragment spreads. + + +function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { + var cached = cachedFieldsAndFragmentNames.get(selectionSet); + + if (!cached) { + var nodeAndDefs = Object.create(null); + var fragmentNames = Object.create(null); + + _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames); + + cached = [nodeAndDefs, Object.keys(fragmentNames)]; + cachedFieldsAndFragmentNames.set(selectionSet, cached); + } + + return cached; +} // Given a reference to a fragment, return the represented collection of fields +// as well as a list of nested fragment names referenced via fragment spreads. + + +function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { + // Short-circuit building a type from the node if possible. + var cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); + + if (cached) { + return cached; + } + + var fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition); + return getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragmentType, fragment.selectionSet); +} + +function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeAndDefs, fragmentNames) { + for (var i = 0; i < selectionSet.selections.length; i++) { + var selection = selectionSet.selections[i]; + + switch (selection.kind) { + case Kind.FIELD: + { + var fieldName = selection.name.value; + var fieldDef = void 0; + + if (isObjectType(parentType) || isInterfaceType(parentType)) { + fieldDef = parentType.getFields()[fieldName]; + } + + var responseName = selection.alias ? selection.alias.value : fieldName; + + if (!nodeAndDefs[responseName]) { + nodeAndDefs[responseName] = []; + } + + nodeAndDefs[responseName].push([parentType, selection, fieldDef]); + break; + } + + case Kind.FRAGMENT_SPREAD: + fragmentNames[selection.name.value] = true; + break; + + case Kind.INLINE_FRAGMENT: + { + var typeCondition = selection.typeCondition; + var inlineFragmentType = typeCondition ? typeFromAST(context.getSchema(), typeCondition) : parentType; + + _collectFieldsAndFragmentNames(context, inlineFragmentType, selection.selectionSet, nodeAndDefs, fragmentNames); + + break; + } + } + } +} // Given a series of Conflicts which occurred between two sub-fields, generate +// a single Conflict. + + +function subfieldConflicts(conflicts, responseName, node1, node2) { + if (conflicts.length > 0) { + return [[responseName, conflicts.map(function (_ref6) { + var reason = _ref6[0]; + return reason; + })], conflicts.reduce(function (allFields, _ref7) { + var fields1 = _ref7[1]; + return allFields.concat(fields1); + }, [node1]), conflicts.reduce(function (allFields, _ref8) { + var fields2 = _ref8[2]; + return allFields.concat(fields2); + }, [node2])]; + } +} +/** + * A way to keep track of pairs of things when the ordering of the pair does + * not matter. We do this by maintaining a sort of double adjacency sets. + */ + + +var PairSet = +/*#__PURE__*/ +function () { + function PairSet() { + this._data = Object.create(null); + } + + var _proto = PairSet.prototype; + + _proto.has = function has(a, b, areMutuallyExclusive) { + var first = this._data[a]; + var result = first && first[b]; + + if (result === undefined) { + return false; + } // areMutuallyExclusive being false is a superset of being true, + // hence if we want to know if this PairSet "has" these two with no + // exclusivity, we have to ensure it was added as such. + + + if (areMutuallyExclusive === false) { + return result === false; + } + + return true; + }; + + _proto.add = function add(a, b, areMutuallyExclusive) { + _pairSetAdd(this._data, a, b, areMutuallyExclusive); + + _pairSetAdd(this._data, b, a, areMutuallyExclusive); + }; + + return PairSet; +}(); + +function _pairSetAdd(data, a, b, areMutuallyExclusive) { + var map = data[a]; + + if (!map) { + map = Object.create(null); + data[a] = map; + } + + map[b] = areMutuallyExclusive; +} diff --git a/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js new file mode 100644 index 000000000..2ba23212d --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.typeIncompatibleSpreadMessage = typeIncompatibleSpreadMessage; +exports.typeIncompatibleAnonSpreadMessage = typeIncompatibleAnonSpreadMessage; +exports.PossibleFragmentSpreads = PossibleFragmentSpreads; + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _typeComparators = require("../../utilities/typeComparators"); + +var _typeFromAST = require("../../utilities/typeFromAST"); + +var _definition = require("../../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function typeIncompatibleSpreadMessage(fragName, parentType, fragType) { + return "Fragment \"".concat(fragName, "\" cannot be spread here as objects of type \"").concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); +} + +function typeIncompatibleAnonSpreadMessage(parentType, fragType) { + return "Fragment cannot be spread here as objects of type \"".concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); +} +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + */ + + +function PossibleFragmentSpreads(context) { + return { + InlineFragment: function InlineFragment(node) { + var fragType = context.getType(); + var parentType = context.getParentType(); + + if ((0, _definition.isCompositeType)(fragType) && (0, _definition.isCompositeType)(parentType) && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + context.reportError(new _GraphQLError.GraphQLError(typeIncompatibleAnonSpreadMessage((0, _inspect.default)(parentType), (0, _inspect.default)(fragType)), node)); + } + }, + FragmentSpread: function FragmentSpread(node) { + var fragName = node.name.value; + var fragType = getFragmentType(context, fragName); + var parentType = context.getParentType(); + + if (fragType && parentType && !(0, _typeComparators.doTypesOverlap)(context.getSchema(), fragType, parentType)) { + context.reportError(new _GraphQLError.GraphQLError(typeIncompatibleSpreadMessage(fragName, (0, _inspect.default)(parentType), (0, _inspect.default)(fragType)), node)); + } + } + }; +} + +function getFragmentType(context, name) { + var frag = context.getFragment(name); + + if (frag) { + var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition); + + if ((0, _definition.isCompositeType)(type)) { + return type; + } + } +} diff --git a/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js.flow b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js.flow new file mode 100644 index 000000000..4367d70fe --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.js.flow @@ -0,0 +1,88 @@ +// @flow strict + +import inspect from '../../jsutils/inspect'; +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; +import { doTypesOverlap } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; +import { isCompositeType } from '../../type/definition'; + +export function typeIncompatibleSpreadMessage( + fragName: string, + parentType: string, + fragType: string, +): string { + return `Fragment "${fragName}" cannot be spread here as objects of type "${parentType}" can never be of type "${fragType}".`; +} + +export function typeIncompatibleAnonSpreadMessage( + parentType: string, + fragType: string, +): string { + return `Fragment cannot be spread here as objects of type "${parentType}" can never be of type "${fragType}".`; +} + +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + */ +export function PossibleFragmentSpreads( + context: ValidationContext, +): ASTVisitor { + return { + InlineFragment(node) { + const fragType = context.getType(); + const parentType = context.getParentType(); + if ( + isCompositeType(fragType) && + isCompositeType(parentType) && + !doTypesOverlap(context.getSchema(), fragType, parentType) + ) { + context.reportError( + new GraphQLError( + typeIncompatibleAnonSpreadMessage( + inspect(parentType), + inspect(fragType), + ), + node, + ), + ); + } + }, + FragmentSpread(node) { + const fragName = node.name.value; + const fragType = getFragmentType(context, fragName); + const parentType = context.getParentType(); + if ( + fragType && + parentType && + !doTypesOverlap(context.getSchema(), fragType, parentType) + ) { + context.reportError( + new GraphQLError( + typeIncompatibleSpreadMessage( + fragName, + inspect(parentType), + inspect(fragType), + ), + node, + ), + ); + } + }, + }; +} + +function getFragmentType(context, name) { + const frag = context.getFragment(name); + if (frag) { + const type = typeFromAST(context.getSchema(), frag.typeCondition); + if (isCompositeType(type)) { + return type; + } + } +} diff --git a/node_modules/graphql/validation/rules/PossibleFragmentSpreads.mjs b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.mjs new file mode 100644 index 000000000..b0f2606a7 --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleFragmentSpreads.mjs @@ -0,0 +1,52 @@ +import inspect from '../../jsutils/inspect'; +import { GraphQLError } from '../../error/GraphQLError'; +import { doTypesOverlap } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; +import { isCompositeType } from '../../type/definition'; +export function typeIncompatibleSpreadMessage(fragName, parentType, fragType) { + return "Fragment \"".concat(fragName, "\" cannot be spread here as objects of type \"").concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); +} +export function typeIncompatibleAnonSpreadMessage(parentType, fragType) { + return "Fragment cannot be spread here as objects of type \"".concat(parentType, "\" can never be of type \"").concat(fragType, "\"."); +} +/** + * Possible fragment spread + * + * A fragment spread is only valid if the type condition could ever possibly + * be true: if there is a non-empty intersection of the possible parent types, + * and possible types which pass the type condition. + */ + +export function PossibleFragmentSpreads(context) { + return { + InlineFragment: function InlineFragment(node) { + var fragType = context.getType(); + var parentType = context.getParentType(); + + if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) { + context.reportError(new GraphQLError(typeIncompatibleAnonSpreadMessage(inspect(parentType), inspect(fragType)), node)); + } + }, + FragmentSpread: function FragmentSpread(node) { + var fragName = node.name.value; + var fragType = getFragmentType(context, fragName); + var parentType = context.getParentType(); + + if (fragType && parentType && !doTypesOverlap(context.getSchema(), fragType, parentType)) { + context.reportError(new GraphQLError(typeIncompatibleSpreadMessage(fragName, inspect(parentType), inspect(fragType)), node)); + } + } + }; +} + +function getFragmentType(context, name) { + var frag = context.getFragment(name); + + if (frag) { + var type = typeFromAST(context.getSchema(), frag.typeCondition); + + if (isCompositeType(type)) { + return type; + } + } +} diff --git a/node_modules/graphql/validation/rules/PossibleTypeExtensions.js b/node_modules/graphql/validation/rules/PossibleTypeExtensions.js new file mode 100644 index 000000000..30f992794 --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleTypeExtensions.js @@ -0,0 +1,154 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.extendingUnknownTypeMessage = extendingUnknownTypeMessage; +exports.extendingDifferentTypeKindMessage = extendingDifferentTypeKindMessage; +exports.PossibleTypeExtensions = PossibleTypeExtensions; + +var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean")); + +var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _predicates = require("../../language/predicates"); + +var _definition = require("../../type/definition"); + +var _defKindToExtKind; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function extendingUnknownTypeMessage(typeName, suggestedTypes) { + return "Cannot extend type \"".concat(typeName, "\" because it is not defined.") + (0, _didYouMean.default)(suggestedTypes.map(function (x) { + return "\"".concat(x, "\""); + })); +} + +function extendingDifferentTypeKindMessage(typeName, kind) { + return "Cannot extend non-".concat(kind, " type \"").concat(typeName, "\"."); +} +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + */ + + +function PossibleTypeExtensions(context) { + var schema = context.getSchema(); + var definedTypes = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getDocument().definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if ((0, _predicates.isTypeDefinitionNode)(def)) { + definedTypes[def.name.value] = def; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension + }; + + function checkExtension(node) { + var typeName = node.name.value; + var defNode = definedTypes[typeName]; + var existingType = schema && schema.getType(typeName); + + if (defNode) { + var expectedKind = defKindToExtKind[defNode.kind]; + + if (expectedKind !== node.kind) { + context.reportError(new _GraphQLError.GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(expectedKind)), [defNode, node])); + } + } else if (existingType) { + var _expectedKind = typeToExtKind(existingType); + + if (_expectedKind !== node.kind) { + context.reportError(new _GraphQLError.GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(_expectedKind)), node)); + } + } else { + var allTypeNames = Object.keys(definedTypes); + + if (schema) { + allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap())); + } + + var suggestedTypes = (0, _suggestionList.default)(typeName, allTypeNames); + context.reportError(new _GraphQLError.GraphQLError(extendingUnknownTypeMessage(typeName, suggestedTypes), node.name)); + } + } +} + +var defKindToExtKind = (_defKindToExtKind = {}, _defineProperty(_defKindToExtKind, _kinds.Kind.SCALAR_TYPE_DEFINITION, _kinds.Kind.SCALAR_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.OBJECT_TYPE_DEFINITION, _kinds.Kind.OBJECT_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.INTERFACE_TYPE_DEFINITION, _kinds.Kind.INTERFACE_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.UNION_TYPE_DEFINITION, _kinds.Kind.UNION_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.ENUM_TYPE_DEFINITION, _kinds.Kind.ENUM_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION), _defKindToExtKind); + +function typeToExtKind(type) { + if ((0, _definition.isScalarType)(type)) { + return _kinds.Kind.SCALAR_TYPE_EXTENSION; + } else if ((0, _definition.isObjectType)(type)) { + return _kinds.Kind.OBJECT_TYPE_EXTENSION; + } else if ((0, _definition.isInterfaceType)(type)) { + return _kinds.Kind.INTERFACE_TYPE_EXTENSION; + } else if ((0, _definition.isUnionType)(type)) { + return _kinds.Kind.UNION_TYPE_EXTENSION; + } else if ((0, _definition.isEnumType)(type)) { + return _kinds.Kind.ENUM_TYPE_EXTENSION; + } else if ((0, _definition.isInputObjectType)(type)) { + return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; + } +} + +function extensionKindToTypeName(kind) { + switch (kind) { + case _kinds.Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + + case _kinds.Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + + case _kinds.Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + + case _kinds.Kind.UNION_TYPE_EXTENSION: + return 'union'; + + case _kinds.Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + + case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + + default: + return 'unknown type'; + } +} diff --git a/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow b/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow new file mode 100644 index 000000000..c70909786 --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow @@ -0,0 +1,152 @@ +// @flow strict + +import didYouMean from '../../jsutils/didYouMean'; +import suggestionList from '../../jsutils/suggestionList'; +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { isTypeDefinitionNode } from '../../language/predicates'; +import { type ASTVisitor } from '../../language/visitor'; +import { + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, +} from '../../type/definition'; + +export function extendingUnknownTypeMessage( + typeName: string, + suggestedTypes: $ReadOnlyArray, +): string { + return ( + `Cannot extend type "${typeName}" because it is not defined.` + + didYouMean(suggestedTypes.map(x => `"${x}"`)) + ); +} + +export function extendingDifferentTypeKindMessage( + typeName: string, + kind: string, +): string { + return `Cannot extend non-${kind} type "${typeName}".`; +} + +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + */ +export function PossibleTypeExtensions( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const definedTypes = Object.create(null); + + for (const def of context.getDocument().definitions) { + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = def; + } + } + + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension, + }; + + function checkExtension(node) { + const typeName = node.name.value; + const defNode = definedTypes[typeName]; + const existingType = schema && schema.getType(typeName); + + if (defNode) { + const expectedKind = defKindToExtKind[defNode.kind]; + if (expectedKind !== node.kind) { + context.reportError( + new GraphQLError( + extendingDifferentTypeKindMessage( + typeName, + extensionKindToTypeName(expectedKind), + ), + [defNode, node], + ), + ); + } + } else if (existingType) { + const expectedKind = typeToExtKind(existingType); + if (expectedKind !== node.kind) { + context.reportError( + new GraphQLError( + extendingDifferentTypeKindMessage( + typeName, + extensionKindToTypeName(expectedKind), + ), + node, + ), + ); + } + } else { + let allTypeNames = Object.keys(definedTypes); + if (schema) { + allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap())); + } + + const suggestedTypes = suggestionList(typeName, allTypeNames); + context.reportError( + new GraphQLError( + extendingUnknownTypeMessage(typeName, suggestedTypes), + node.name, + ), + ); + } + } +} + +const defKindToExtKind = { + [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION, + [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION, + [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION, + [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION, + [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION, + [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION, +}; + +function typeToExtKind(type) { + if (isScalarType(type)) { + return Kind.SCALAR_TYPE_EXTENSION; + } else if (isObjectType(type)) { + return Kind.OBJECT_TYPE_EXTENSION; + } else if (isInterfaceType(type)) { + return Kind.INTERFACE_TYPE_EXTENSION; + } else if (isUnionType(type)) { + return Kind.UNION_TYPE_EXTENSION; + } else if (isEnumType(type)) { + return Kind.ENUM_TYPE_EXTENSION; + } else if (isInputObjectType(type)) { + return Kind.INPUT_OBJECT_TYPE_EXTENSION; + } +} + +function extensionKindToTypeName(kind) { + switch (kind) { + case Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + case Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + case Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + case Kind.UNION_TYPE_EXTENSION: + return 'union'; + case Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + default: + return 'unknown type'; + } +} diff --git a/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs b/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs new file mode 100644 index 000000000..e931a4929 --- /dev/null +++ b/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs @@ -0,0 +1,134 @@ +var _defKindToExtKind; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import didYouMean from '../../jsutils/didYouMean'; +import suggestionList from '../../jsutils/suggestionList'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { isTypeDefinitionNode } from '../../language/predicates'; +import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from '../../type/definition'; +export function extendingUnknownTypeMessage(typeName, suggestedTypes) { + return "Cannot extend type \"".concat(typeName, "\" because it is not defined.") + didYouMean(suggestedTypes.map(function (x) { + return "\"".concat(x, "\""); + })); +} +export function extendingDifferentTypeKindMessage(typeName, kind) { + return "Cannot extend non-".concat(kind, " type \"").concat(typeName, "\"."); +} +/** + * Possible type extension + * + * A type extension is only valid if the type is defined and has the same kind. + */ + +export function PossibleTypeExtensions(context) { + var schema = context.getSchema(); + var definedTypes = Object.create(null); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = context.getDocument().definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var def = _step.value; + + if (isTypeDefinitionNode(def)) { + definedTypes[def.name.value] = def; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return { + ScalarTypeExtension: checkExtension, + ObjectTypeExtension: checkExtension, + InterfaceTypeExtension: checkExtension, + UnionTypeExtension: checkExtension, + EnumTypeExtension: checkExtension, + InputObjectTypeExtension: checkExtension + }; + + function checkExtension(node) { + var typeName = node.name.value; + var defNode = definedTypes[typeName]; + var existingType = schema && schema.getType(typeName); + + if (defNode) { + var expectedKind = defKindToExtKind[defNode.kind]; + + if (expectedKind !== node.kind) { + context.reportError(new GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(expectedKind)), [defNode, node])); + } + } else if (existingType) { + var _expectedKind = typeToExtKind(existingType); + + if (_expectedKind !== node.kind) { + context.reportError(new GraphQLError(extendingDifferentTypeKindMessage(typeName, extensionKindToTypeName(_expectedKind)), node)); + } + } else { + var allTypeNames = Object.keys(definedTypes); + + if (schema) { + allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap())); + } + + var suggestedTypes = suggestionList(typeName, allTypeNames); + context.reportError(new GraphQLError(extendingUnknownTypeMessage(typeName, suggestedTypes), node.name)); + } + } +} +var defKindToExtKind = (_defKindToExtKind = {}, _defineProperty(_defKindToExtKind, Kind.SCALAR_TYPE_DEFINITION, Kind.SCALAR_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.OBJECT_TYPE_DEFINITION, Kind.OBJECT_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INTERFACE_TYPE_DEFINITION, Kind.INTERFACE_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.UNION_TYPE_DEFINITION, Kind.UNION_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.ENUM_TYPE_DEFINITION, Kind.ENUM_TYPE_EXTENSION), _defineProperty(_defKindToExtKind, Kind.INPUT_OBJECT_TYPE_DEFINITION, Kind.INPUT_OBJECT_TYPE_EXTENSION), _defKindToExtKind); + +function typeToExtKind(type) { + if (isScalarType(type)) { + return Kind.SCALAR_TYPE_EXTENSION; + } else if (isObjectType(type)) { + return Kind.OBJECT_TYPE_EXTENSION; + } else if (isInterfaceType(type)) { + return Kind.INTERFACE_TYPE_EXTENSION; + } else if (isUnionType(type)) { + return Kind.UNION_TYPE_EXTENSION; + } else if (isEnumType(type)) { + return Kind.ENUM_TYPE_EXTENSION; + } else if (isInputObjectType(type)) { + return Kind.INPUT_OBJECT_TYPE_EXTENSION; + } +} + +function extensionKindToTypeName(kind) { + switch (kind) { + case Kind.SCALAR_TYPE_EXTENSION: + return 'scalar'; + + case Kind.OBJECT_TYPE_EXTENSION: + return 'object'; + + case Kind.INTERFACE_TYPE_EXTENSION: + return 'interface'; + + case Kind.UNION_TYPE_EXTENSION: + return 'union'; + + case Kind.ENUM_TYPE_EXTENSION: + return 'enum'; + + case Kind.INPUT_OBJECT_TYPE_EXTENSION: + return 'input object'; + + default: + return 'unknown type'; + } +} diff --git a/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js new file mode 100644 index 000000000..f01a7d16e --- /dev/null +++ b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js @@ -0,0 +1,183 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.missingFieldArgMessage = missingFieldArgMessage; +exports.missingDirectiveArgMessage = missingDirectiveArgMessage; +exports.ProvidedRequiredArguments = ProvidedRequiredArguments; +exports.ProvidedRequiredArgumentsOnDirectives = ProvidedRequiredArgumentsOnDirectives; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _keyMap = _interopRequireDefault(require("../../jsutils/keyMap")); + +var _definition = require("../../type/definition"); + +var _printer = require("../../language/printer"); + +var _directives = require("../../type/directives"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function missingFieldArgMessage(fieldName, argName, type) { + return "Field \"".concat(fieldName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); +} + +function missingDirectiveArgMessage(directiveName, argName, type) { + return "Directive \"@".concat(directiveName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); +} +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + */ + + +function ProvidedRequiredArguments(context) { + return _objectSpread({}, ProvidedRequiredArgumentsOnDirectives(context), { + Field: { + // Validate on leave to allow for deeper errors to appear first. + leave: function leave(fieldNode) { + var fieldDef = context.getFieldDef(); + + if (!fieldDef) { + return false; + } + + var argNodes = fieldNode.arguments || []; + var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { + return arg.name.value; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = fieldDef.args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var argDef = _step.value; + var argNode = argNodeMap[argDef.name]; + + if (!argNode && (0, _definition.isRequiredArgument)(argDef)) { + context.reportError(new _GraphQLError.GraphQLError(missingFieldArgMessage(fieldDef.name, argDef.name, (0, _inspect.default)(argDef.type)), fieldNode)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + }); +} // @internal + + +function ProvidedRequiredArgumentsOnDirectives(context) { + var requiredArgsMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = definedDirectives[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var directive = _step2.value; + requiredArgsMap[directive.name] = (0, _keyMap.default)(directive.args.filter(_definition.isRequiredArgument), function (arg) { + return arg.name; + }); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = astDefinitions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var def = _step3.value; + + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + requiredArgsMap[def.name.value] = (0, _keyMap.default)(def.arguments ? def.arguments.filter(isRequiredArgumentNode) : [], function (arg) { + return arg.name.value; + }); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return { + Directive: { + // Validate on leave to allow for deeper errors to appear first. + leave: function leave(directiveNode) { + var directiveName = directiveNode.name.value; + var requiredArgs = requiredArgsMap[directiveName]; + + if (requiredArgs) { + var argNodes = directiveNode.arguments || []; + var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { + return arg.name.value; + }); + + for (var _i = 0, _Object$keys = Object.keys(requiredArgs); _i < _Object$keys.length; _i++) { + var argName = _Object$keys[_i]; + + if (!argNodeMap[argName]) { + var argType = requiredArgs[argName].type; + context.reportError(new _GraphQLError.GraphQLError(missingDirectiveArgMessage(directiveName, argName, (0, _definition.isType)(argType) ? (0, _inspect.default)(argType) : (0, _printer.print)(argType)), directiveNode)); + } + } + } + } + } + }; +} + +function isRequiredArgumentNode(arg) { + return arg.type.kind === _kinds.Kind.NON_NULL_TYPE && arg.defaultValue == null; +} diff --git a/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js.flow b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js.flow new file mode 100644 index 000000000..a23fe8373 --- /dev/null +++ b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.js.flow @@ -0,0 +1,132 @@ +// @flow strict + +import { + type ValidationContext, + type SDLValidationContext, +} from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import inspect from '../../jsutils/inspect'; +import keyMap from '../../jsutils/keyMap'; +import { isType, isRequiredArgument } from '../../type/definition'; +import { type ASTVisitor } from '../../language/visitor'; +import { print } from '../../language/printer'; +import { specifiedDirectives } from '../../type/directives'; + +export function missingFieldArgMessage( + fieldName: string, + argName: string, + type: string, +): string { + return `Field "${fieldName}" argument "${argName}" of type "${type}" is required, but it was not provided.`; +} + +export function missingDirectiveArgMessage( + directiveName: string, + argName: string, + type: string, +): string { + return `Directive "@${directiveName}" argument "${argName}" of type "${type}" is required, but it was not provided.`; +} + +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + */ +export function ProvidedRequiredArguments( + context: ValidationContext, +): ASTVisitor { + return { + ...ProvidedRequiredArgumentsOnDirectives(context), + Field: { + // Validate on leave to allow for deeper errors to appear first. + leave(fieldNode) { + const fieldDef = context.getFieldDef(); + if (!fieldDef) { + return false; + } + const argNodes = fieldNode.arguments || []; + + const argNodeMap = keyMap(argNodes, arg => arg.name.value); + for (const argDef of fieldDef.args) { + const argNode = argNodeMap[argDef.name]; + if (!argNode && isRequiredArgument(argDef)) { + context.reportError( + new GraphQLError( + missingFieldArgMessage( + fieldDef.name, + argDef.name, + inspect(argDef.type), + ), + fieldNode, + ), + ); + } + } + }, + }, + }; +} + +// @internal +export function ProvidedRequiredArgumentsOnDirectives( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const requiredArgsMap = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + requiredArgsMap[directive.name] = keyMap( + directive.args.filter(isRequiredArgument), + arg => arg.name, + ); + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + requiredArgsMap[def.name.value] = keyMap( + def.arguments ? def.arguments.filter(isRequiredArgumentNode) : [], + arg => arg.name.value, + ); + } + } + + return { + Directive: { + // Validate on leave to allow for deeper errors to appear first. + leave(directiveNode) { + const directiveName = directiveNode.name.value; + const requiredArgs = requiredArgsMap[directiveName]; + if (requiredArgs) { + const argNodes = directiveNode.arguments || []; + const argNodeMap = keyMap(argNodes, arg => arg.name.value); + for (const argName of Object.keys(requiredArgs)) { + if (!argNodeMap[argName]) { + const argType = requiredArgs[argName].type; + context.reportError( + new GraphQLError( + missingDirectiveArgMessage( + directiveName, + argName, + isType(argType) ? inspect(argType) : print(argType), + ), + directiveNode, + ), + ); + } + } + } + }, + }, + }; +} + +function isRequiredArgumentNode(arg) { + return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; +} diff --git a/node_modules/graphql/validation/rules/ProvidedRequiredArguments.mjs b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.mjs new file mode 100644 index 000000000..360de7a19 --- /dev/null +++ b/node_modules/graphql/validation/rules/ProvidedRequiredArguments.mjs @@ -0,0 +1,161 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import inspect from '../../jsutils/inspect'; +import keyMap from '../../jsutils/keyMap'; +import { isType, isRequiredArgument } from '../../type/definition'; +import { print } from '../../language/printer'; +import { specifiedDirectives } from '../../type/directives'; +export function missingFieldArgMessage(fieldName, argName, type) { + return "Field \"".concat(fieldName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); +} +export function missingDirectiveArgMessage(directiveName, argName, type) { + return "Directive \"@".concat(directiveName, "\" argument \"").concat(argName, "\" of type \"").concat(type, "\" is required, but it was not provided."); +} +/** + * Provided required arguments + * + * A field or directive is only valid if all required (non-null without a + * default value) field arguments have been provided. + */ + +export function ProvidedRequiredArguments(context) { + return _objectSpread({}, ProvidedRequiredArgumentsOnDirectives(context), { + Field: { + // Validate on leave to allow for deeper errors to appear first. + leave: function leave(fieldNode) { + var fieldDef = context.getFieldDef(); + + if (!fieldDef) { + return false; + } + + var argNodes = fieldNode.arguments || []; + var argNodeMap = keyMap(argNodes, function (arg) { + return arg.name.value; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = fieldDef.args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var argDef = _step.value; + var argNode = argNodeMap[argDef.name]; + + if (!argNode && isRequiredArgument(argDef)) { + context.reportError(new GraphQLError(missingFieldArgMessage(fieldDef.name, argDef.name, inspect(argDef.type)), fieldNode)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + }); +} // @internal + +export function ProvidedRequiredArgumentsOnDirectives(context) { + var requiredArgsMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = definedDirectives[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var directive = _step2.value; + requiredArgsMap[directive.name] = keyMap(directive.args.filter(isRequiredArgument), function (arg) { + return arg.name; + }); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = astDefinitions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var def = _step3.value; + + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + requiredArgsMap[def.name.value] = keyMap(def.arguments ? def.arguments.filter(isRequiredArgumentNode) : [], function (arg) { + return arg.name.value; + }); + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return { + Directive: { + // Validate on leave to allow for deeper errors to appear first. + leave: function leave(directiveNode) { + var directiveName = directiveNode.name.value; + var requiredArgs = requiredArgsMap[directiveName]; + + if (requiredArgs) { + var argNodes = directiveNode.arguments || []; + var argNodeMap = keyMap(argNodes, function (arg) { + return arg.name.value; + }); + + for (var _i = 0, _Object$keys = Object.keys(requiredArgs); _i < _Object$keys.length; _i++) { + var argName = _Object$keys[_i]; + + if (!argNodeMap[argName]) { + var argType = requiredArgs[argName].type; + context.reportError(new GraphQLError(missingDirectiveArgMessage(directiveName, argName, isType(argType) ? inspect(argType) : print(argType)), directiveNode)); + } + } + } + } + } + }; +} + +function isRequiredArgumentNode(arg) { + return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; +} diff --git a/node_modules/graphql/validation/rules/ScalarLeafs.js b/node_modules/graphql/validation/rules/ScalarLeafs.js new file mode 100644 index 000000000..a14d5f19d --- /dev/null +++ b/node_modules/graphql/validation/rules/ScalarLeafs.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.noSubselectionAllowedMessage = noSubselectionAllowedMessage; +exports.requiredSubselectionMessage = requiredSubselectionMessage; +exports.ScalarLeafs = ScalarLeafs; + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _definition = require("../../type/definition"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function noSubselectionAllowedMessage(fieldName, type) { + return "Field \"".concat(fieldName, "\" must not have a selection since type \"").concat(type, "\" has no subfields."); +} + +function requiredSubselectionMessage(fieldName, type) { + return "Field \"".concat(fieldName, "\" of type \"").concat(type, "\" must have a selection of subfields. Did you mean \"").concat(fieldName, " { ... }\"?"); +} +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + */ + + +function ScalarLeafs(context) { + return { + Field: function Field(node) { + var type = context.getType(); + var selectionSet = node.selectionSet; + + if (type) { + if ((0, _definition.isLeafType)((0, _definition.getNamedType)(type))) { + if (selectionSet) { + context.reportError(new _GraphQLError.GraphQLError(noSubselectionAllowedMessage(node.name.value, (0, _inspect.default)(type)), selectionSet)); + } + } else if (!selectionSet) { + context.reportError(new _GraphQLError.GraphQLError(requiredSubselectionMessage(node.name.value, (0, _inspect.default)(type)), node)); + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/ScalarLeafs.js.flow b/node_modules/graphql/validation/rules/ScalarLeafs.js.flow new file mode 100644 index 000000000..373367ca7 --- /dev/null +++ b/node_modules/graphql/validation/rules/ScalarLeafs.js.flow @@ -0,0 +1,56 @@ +// @flow strict + +import inspect from '../../jsutils/inspect'; +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type FieldNode } from '../../language/ast'; +import { getNamedType, isLeafType } from '../../type/definition'; +import { type ASTVisitor } from '../../language/visitor'; + +export function noSubselectionAllowedMessage( + fieldName: string, + type: string, +): string { + return `Field "${fieldName}" must not have a selection since type "${type}" has no subfields.`; +} + +export function requiredSubselectionMessage( + fieldName: string, + type: string, +): string { + return `Field "${fieldName}" of type "${type}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`; +} + +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + */ +export function ScalarLeafs(context: ValidationContext): ASTVisitor { + return { + Field(node: FieldNode) { + const type = context.getType(); + const selectionSet = node.selectionSet; + if (type) { + if (isLeafType(getNamedType(type))) { + if (selectionSet) { + context.reportError( + new GraphQLError( + noSubselectionAllowedMessage(node.name.value, inspect(type)), + selectionSet, + ), + ); + } + } else if (!selectionSet) { + context.reportError( + new GraphQLError( + requiredSubselectionMessage(node.name.value, inspect(type)), + node, + ), + ); + } + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/ScalarLeafs.mjs b/node_modules/graphql/validation/rules/ScalarLeafs.mjs new file mode 100644 index 000000000..e25a8418d --- /dev/null +++ b/node_modules/graphql/validation/rules/ScalarLeafs.mjs @@ -0,0 +1,34 @@ +import inspect from '../../jsutils/inspect'; +import { GraphQLError } from '../../error/GraphQLError'; +import { getNamedType, isLeafType } from '../../type/definition'; +export function noSubselectionAllowedMessage(fieldName, type) { + return "Field \"".concat(fieldName, "\" must not have a selection since type \"").concat(type, "\" has no subfields."); +} +export function requiredSubselectionMessage(fieldName, type) { + return "Field \"".concat(fieldName, "\" of type \"").concat(type, "\" must have a selection of subfields. Did you mean \"").concat(fieldName, " { ... }\"?"); +} +/** + * Scalar leafs + * + * A GraphQL document is valid only if all leaf fields (fields without + * sub selections) are of scalar or enum types. + */ + +export function ScalarLeafs(context) { + return { + Field: function Field(node) { + var type = context.getType(); + var selectionSet = node.selectionSet; + + if (type) { + if (isLeafType(getNamedType(type))) { + if (selectionSet) { + context.reportError(new GraphQLError(noSubselectionAllowedMessage(node.name.value, inspect(type)), selectionSet)); + } + } else if (!selectionSet) { + context.reportError(new GraphQLError(requiredSubselectionMessage(node.name.value, inspect(type)), node)); + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js new file mode 100644 index 000000000..82877d28c --- /dev/null +++ b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.singleFieldOnlyMessage = singleFieldOnlyMessage; +exports.SingleFieldSubscriptions = SingleFieldSubscriptions; + +var _GraphQLError = require("../../error/GraphQLError"); + +function singleFieldOnlyMessage(name) { + return name ? "Subscription \"".concat(name, "\" must select only one top level field.") : 'Anonymous Subscription must select only one top level field.'; +} +/** + * Subscriptions must only include one field. + * + * A GraphQL subscription is valid only if it contains a single root field. + */ + + +function SingleFieldSubscriptions(context) { + return { + OperationDefinition: function OperationDefinition(node) { + if (node.operation === 'subscription') { + if (node.selectionSet.selections.length !== 1) { + context.reportError(new _GraphQLError.GraphQLError(singleFieldOnlyMessage(node.name && node.name.value), node.selectionSet.selections.slice(1))); + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js.flow b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js.flow new file mode 100644 index 000000000..1bc3c5bb9 --- /dev/null +++ b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.js.flow @@ -0,0 +1,36 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type OperationDefinitionNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; + +export function singleFieldOnlyMessage(name: ?string): string { + return name + ? `Subscription "${name}" must select only one top level field.` + : 'Anonymous Subscription must select only one top level field.'; +} + +/** + * Subscriptions must only include one field. + * + * A GraphQL subscription is valid only if it contains a single root field. + */ +export function SingleFieldSubscriptions( + context: ASTValidationContext, +): ASTVisitor { + return { + OperationDefinition(node: OperationDefinitionNode) { + if (node.operation === 'subscription') { + if (node.selectionSet.selections.length !== 1) { + context.reportError( + new GraphQLError( + singleFieldOnlyMessage(node.name && node.name.value), + node.selectionSet.selections.slice(1), + ), + ); + } + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/SingleFieldSubscriptions.mjs b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.mjs new file mode 100644 index 000000000..3f43d00ca --- /dev/null +++ b/node_modules/graphql/validation/rules/SingleFieldSubscriptions.mjs @@ -0,0 +1,21 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function singleFieldOnlyMessage(name) { + return name ? "Subscription \"".concat(name, "\" must select only one top level field.") : 'Anonymous Subscription must select only one top level field.'; +} +/** + * Subscriptions must only include one field. + * + * A GraphQL subscription is valid only if it contains a single root field. + */ + +export function SingleFieldSubscriptions(context) { + return { + OperationDefinition: function OperationDefinition(node) { + if (node.operation === 'subscription') { + if (node.selectionSet.selections.length !== 1) { + context.reportError(new GraphQLError(singleFieldOnlyMessage(node.name && node.name.value), node.selectionSet.selections.slice(1))); + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueArgumentNames.js b/node_modules/graphql/validation/rules/UniqueArgumentNames.js new file mode 100644 index 000000000..aac7cda7a --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueArgumentNames.js @@ -0,0 +1,43 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateArgMessage = duplicateArgMessage; +exports.UniqueArgumentNames = UniqueArgumentNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateArgMessage(argName) { + return "There can be only one argument named \"".concat(argName, "\"."); +} +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + */ + + +function UniqueArgumentNames(context) { + var knownArgNames = Object.create(null); + return { + Field: function Field() { + knownArgNames = Object.create(null); + }, + Directive: function Directive() { + knownArgNames = Object.create(null); + }, + Argument: function Argument(node) { + var argName = node.name.value; + + if (knownArgNames[argName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateArgMessage(argName), [knownArgNames[argName], node.name])); + } else { + knownArgNames[argName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueArgumentNames.js.flow b/node_modules/graphql/validation/rules/UniqueArgumentNames.js.flow new file mode 100644 index 000000000..a3a2a51c4 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueArgumentNames.js.flow @@ -0,0 +1,41 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateArgMessage(argName: string): string { + return `There can be only one argument named "${argName}".`; +} + +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + */ +export function UniqueArgumentNames(context: ASTValidationContext): ASTVisitor { + let knownArgNames = Object.create(null); + return { + Field() { + knownArgNames = Object.create(null); + }, + Directive() { + knownArgNames = Object.create(null); + }, + Argument(node) { + const argName = node.name.value; + if (knownArgNames[argName]) { + context.reportError( + new GraphQLError(duplicateArgMessage(argName), [ + knownArgNames[argName], + node.name, + ]), + ); + } else { + knownArgNames[argName] = node.name; + } + return false; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueArgumentNames.mjs b/node_modules/graphql/validation/rules/UniqueArgumentNames.mjs new file mode 100644 index 000000000..b3e8c8da3 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueArgumentNames.mjs @@ -0,0 +1,33 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateArgMessage(argName) { + return "There can be only one argument named \"".concat(argName, "\"."); +} +/** + * Unique argument names + * + * A GraphQL field or directive is only valid if all supplied arguments are + * uniquely named. + */ + +export function UniqueArgumentNames(context) { + var knownArgNames = Object.create(null); + return { + Field: function Field() { + knownArgNames = Object.create(null); + }, + Directive: function Directive() { + knownArgNames = Object.create(null); + }, + Argument: function Argument(node) { + var argName = node.name.value; + + if (knownArgNames[argName]) { + context.reportError(new GraphQLError(duplicateArgMessage(argName), [knownArgNames[argName], node.name])); + } else { + knownArgNames[argName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectiveNames.js b/node_modules/graphql/validation/rules/UniqueDirectiveNames.js new file mode 100644 index 000000000..0ceebb889 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectiveNames.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateDirectiveNameMessage = duplicateDirectiveNameMessage; +exports.existedDirectiveNameMessage = existedDirectiveNameMessage; +exports.UniqueDirectiveNames = UniqueDirectiveNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateDirectiveNameMessage(directiveName) { + return "There can be only one directive named \"".concat(directiveName, "\"."); +} + +function existedDirectiveNameMessage(directiveName) { + return "Directive \"".concat(directiveName, "\" already exists in the schema. It cannot be redefined."); +} +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + */ + + +function UniqueDirectiveNames(context) { + var knownDirectiveNames = Object.create(null); + var schema = context.getSchema(); + return { + DirectiveDefinition: function DirectiveDefinition(node) { + var directiveName = node.name.value; + + if (schema && schema.getDirective(directiveName)) { + context.reportError(new _GraphQLError.GraphQLError(existedDirectiveNameMessage(directiveName), node.name)); + return; + } + + if (knownDirectiveNames[directiveName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveNameMessage(directiveName), [knownDirectiveNames[directiveName], node.name])); + } else { + knownDirectiveNames[directiveName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow b/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow new file mode 100644 index 000000000..11f9bf0aa --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow @@ -0,0 +1,54 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateDirectiveNameMessage(directiveName: string): string { + return `There can be only one directive named "${directiveName}".`; +} + +export function existedDirectiveNameMessage(directiveName: string): string { + return `Directive "${directiveName}" already exists in the schema. It cannot be redefined.`; +} + +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + */ +export function UniqueDirectiveNames( + context: SDLValidationContext, +): ASTVisitor { + const knownDirectiveNames = Object.create(null); + const schema = context.getSchema(); + + return { + DirectiveDefinition(node) { + const directiveName = node.name.value; + + if (schema && schema.getDirective(directiveName)) { + context.reportError( + new GraphQLError( + existedDirectiveNameMessage(directiveName), + node.name, + ), + ); + return; + } + + if (knownDirectiveNames[directiveName]) { + context.reportError( + new GraphQLError(duplicateDirectiveNameMessage(directiveName), [ + knownDirectiveNames[directiveName], + node.name, + ]), + ); + } else { + knownDirectiveNames[directiveName] = node.name; + } + + return false; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs b/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs new file mode 100644 index 000000000..4bf914cf6 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs @@ -0,0 +1,35 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateDirectiveNameMessage(directiveName) { + return "There can be only one directive named \"".concat(directiveName, "\"."); +} +export function existedDirectiveNameMessage(directiveName) { + return "Directive \"".concat(directiveName, "\" already exists in the schema. It cannot be redefined."); +} +/** + * Unique directive names + * + * A GraphQL document is only valid if all defined directives have unique names. + */ + +export function UniqueDirectiveNames(context) { + var knownDirectiveNames = Object.create(null); + var schema = context.getSchema(); + return { + DirectiveDefinition: function DirectiveDefinition(node) { + var directiveName = node.name.value; + + if (schema && schema.getDirective(directiveName)) { + context.reportError(new GraphQLError(existedDirectiveNameMessage(directiveName), node.name)); + return; + } + + if (knownDirectiveNames[directiveName]) { + context.reportError(new GraphQLError(duplicateDirectiveNameMessage(directiveName), [knownDirectiveNames[directiveName], node.name])); + } else { + knownDirectiveNames[directiveName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js new file mode 100644 index 000000000..5d1fee1e2 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js @@ -0,0 +1,127 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateDirectiveMessage = duplicateDirectiveMessage; +exports.UniqueDirectivesPerLocation = UniqueDirectivesPerLocation; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _directives = require("../../type/directives"); + +function duplicateDirectiveMessage(directiveName) { + return "The directive \"".concat(directiveName, "\" can only be used once at this location."); +} +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + */ + + +function UniqueDirectivesPerLocation(context) { + var uniqueDirectiveMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap[def.name.value] = !def.repeatable; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + // Many different AST nodes may contain directives. Rather than listing + // them all, just listen for entering any node, and check to see if it + // defines any directives. + enter: function enter(node) { + // Flow can't refine that node.directives will only contain directives, + // so we cast so the rest of the code is well typed. + var directives = node.directives; + + if (directives) { + var knownDirectives = Object.create(null); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = directives[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var directive = _step3.value; + var directiveName = directive.name.value; + + if (uniqueDirectiveMap[directiveName]) { + if (knownDirectives[directiveName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], directive])); + } else { + knownDirectives[directiveName] = directive; + } + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js.flow b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js.flow new file mode 100644 index 000000000..f93fb2303 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.js.flow @@ -0,0 +1,72 @@ +// @flow strict + +import { + type SDLValidationContext, + type ValidationContext, +} from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { type DirectiveNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; +import { specifiedDirectives } from '../../type/directives'; + +export function duplicateDirectiveMessage(directiveName: string): string { + return `The directive "${directiveName}" can only be used once at this location.`; +} + +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + */ +export function UniqueDirectivesPerLocation( + context: ValidationContext | SDLValidationContext, +): ASTVisitor { + const uniqueDirectiveMap = Object.create(null); + + const schema = context.getSchema(); + const definedDirectives = schema + ? schema.getDirectives() + : specifiedDirectives; + for (const directive of definedDirectives) { + uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + } + + const astDefinitions = context.getDocument().definitions; + for (const def of astDefinitions) { + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap[def.name.value] = !def.repeatable; + } + } + + return { + // Many different AST nodes may contain directives. Rather than listing + // them all, just listen for entering any node, and check to see if it + // defines any directives. + enter(node) { + // Flow can't refine that node.directives will only contain directives, + // so we cast so the rest of the code is well typed. + const directives: ?$ReadOnlyArray = (node: any).directives; + if (directives) { + const knownDirectives = Object.create(null); + for (const directive of directives) { + const directiveName = directive.name.value; + + if (uniqueDirectiveMap[directiveName]) { + if (knownDirectives[directiveName]) { + context.reportError( + new GraphQLError(duplicateDirectiveMessage(directiveName), [ + knownDirectives[directiveName], + directive, + ]), + ); + } else { + knownDirectives[directiveName] = directive; + } + } + } + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.mjs b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.mjs new file mode 100644 index 000000000..59e7ce514 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueDirectivesPerLocation.mjs @@ -0,0 +1,115 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { specifiedDirectives } from '../../type/directives'; +export function duplicateDirectiveMessage(directiveName) { + return "The directive \"".concat(directiveName, "\" can only be used once at this location."); +} +/** + * Unique directive names per location + * + * A GraphQL document is only valid if all non-repeatable directives at + * a given location are uniquely named. + */ + +export function UniqueDirectivesPerLocation(context) { + var uniqueDirectiveMap = Object.create(null); + var schema = context.getSchema(); + var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = definedDirectives[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var directive = _step.value; + uniqueDirectiveMap[directive.name] = !directive.isRepeatable; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var astDefinitions = context.getDocument().definitions; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = astDefinitions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var def = _step2.value; + + if (def.kind === Kind.DIRECTIVE_DEFINITION) { + uniqueDirectiveMap[def.name.value] = !def.repeatable; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return != null) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return { + // Many different AST nodes may contain directives. Rather than listing + // them all, just listen for entering any node, and check to see if it + // defines any directives. + enter: function enter(node) { + // Flow can't refine that node.directives will only contain directives, + // so we cast so the rest of the code is well typed. + var directives = node.directives; + + if (directives) { + var knownDirectives = Object.create(null); + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = directives[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var directive = _step3.value; + var directiveName = directive.name.value; + + if (uniqueDirectiveMap[directiveName]) { + if (knownDirectives[directiveName]) { + context.reportError(new GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], directive])); + } else { + knownDirectives[directiveName] = directive; + } + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return != null) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueEnumValueNames.js b/node_modules/graphql/validation/rules/UniqueEnumValueNames.js new file mode 100644 index 000000000..953235e2d --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueEnumValueNames.js @@ -0,0 +1,82 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateEnumValueNameMessage = duplicateEnumValueNameMessage; +exports.existedEnumValueNameMessage = existedEnumValueNameMessage; +exports.UniqueEnumValueNames = UniqueEnumValueNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _definition = require("../../type/definition"); + +function duplicateEnumValueNameMessage(typeName, valueName) { + return "Enum value \"".concat(typeName, ".").concat(valueName, "\" can only be defined once."); +} + +function existedEnumValueNameMessage(typeName, valueName) { + return "Enum value \"".concat(typeName, ".").concat(valueName, "\" already exists in the schema. It cannot also be defined in this type extension."); +} +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + */ + + +function UniqueEnumValueNames(context) { + var schema = context.getSchema(); + var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + var knownValueNames = Object.create(null); + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness + }; + + function checkValueUniqueness(node) { + var typeName = node.name.value; + + if (!knownValueNames[typeName]) { + knownValueNames[typeName] = Object.create(null); + } + + if (node.values) { + var valueNames = knownValueNames[typeName]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var valueDef = _step.value; + var valueName = valueDef.name.value; + var existingType = existingTypeMap[typeName]; + + if ((0, _definition.isEnumType)(existingType) && existingType.getValue(valueName)) { + context.reportError(new _GraphQLError.GraphQLError(existedEnumValueNameMessage(typeName, valueName), valueDef.name)); + } else if (valueNames[valueName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateEnumValueNameMessage(typeName, valueName), [valueNames[valueName], valueDef.name])); + } else { + valueNames[valueName] = valueDef.name; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow b/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow new file mode 100644 index 000000000..19d5f106b --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow @@ -0,0 +1,75 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; +import { isEnumType } from '../../type/definition'; + +export function duplicateEnumValueNameMessage( + typeName: string, + valueName: string, +): string { + return `Enum value "${typeName}.${valueName}" can only be defined once.`; +} + +export function existedEnumValueNameMessage( + typeName: string, + valueName: string, +): string { + return `Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`; +} + +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + */ +export function UniqueEnumValueNames( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownValueNames = Object.create(null); + + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness, + }; + + function checkValueUniqueness(node) { + const typeName = node.name.value; + + if (!knownValueNames[typeName]) { + knownValueNames[typeName] = Object.create(null); + } + + if (node.values) { + const valueNames = knownValueNames[typeName]; + + for (const valueDef of node.values) { + const valueName = valueDef.name.value; + + const existingType = existingTypeMap[typeName]; + if (isEnumType(existingType) && existingType.getValue(valueName)) { + context.reportError( + new GraphQLError( + existedEnumValueNameMessage(typeName, valueName), + valueDef.name, + ), + ); + } else if (valueNames[valueName]) { + context.reportError( + new GraphQLError( + duplicateEnumValueNameMessage(typeName, valueName), + [valueNames[valueName], valueDef.name], + ), + ); + } else { + valueNames[valueName] = valueDef.name; + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs b/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs new file mode 100644 index 000000000..a55eab785 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs @@ -0,0 +1,69 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { isEnumType } from '../../type/definition'; +export function duplicateEnumValueNameMessage(typeName, valueName) { + return "Enum value \"".concat(typeName, ".").concat(valueName, "\" can only be defined once."); +} +export function existedEnumValueNameMessage(typeName, valueName) { + return "Enum value \"".concat(typeName, ".").concat(valueName, "\" already exists in the schema. It cannot also be defined in this type extension."); +} +/** + * Unique enum value names + * + * A GraphQL enum type is only valid if all its values are uniquely named. + */ + +export function UniqueEnumValueNames(context) { + var schema = context.getSchema(); + var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + var knownValueNames = Object.create(null); + return { + EnumTypeDefinition: checkValueUniqueness, + EnumTypeExtension: checkValueUniqueness + }; + + function checkValueUniqueness(node) { + var typeName = node.name.value; + + if (!knownValueNames[typeName]) { + knownValueNames[typeName] = Object.create(null); + } + + if (node.values) { + var valueNames = knownValueNames[typeName]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.values[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var valueDef = _step.value; + var valueName = valueDef.name.value; + var existingType = existingTypeMap[typeName]; + + if (isEnumType(existingType) && existingType.getValue(valueName)) { + context.reportError(new GraphQLError(existedEnumValueNameMessage(typeName, valueName), valueDef.name)); + } else if (valueNames[valueName]) { + context.reportError(new GraphQLError(duplicateEnumValueNameMessage(typeName, valueName), [valueNames[valueName], valueDef.name])); + } else { + valueNames[valueName] = valueDef.name; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js new file mode 100644 index 000000000..4c63aeb6b --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js @@ -0,0 +1,93 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateFieldDefinitionNameMessage = duplicateFieldDefinitionNameMessage; +exports.existedFieldDefinitionNameMessage = existedFieldDefinitionNameMessage; +exports.UniqueFieldDefinitionNames = UniqueFieldDefinitionNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _definition = require("../../type/definition"); + +function duplicateFieldDefinitionNameMessage(typeName, fieldName) { + return "Field \"".concat(typeName, ".").concat(fieldName, "\" can only be defined once."); +} + +function existedFieldDefinitionNameMessage(typeName, fieldName) { + return "Field \"".concat(typeName, ".").concat(fieldName, "\" already exists in the schema. It cannot also be defined in this type extension."); +} +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + */ + + +function UniqueFieldDefinitionNames(context) { + var schema = context.getSchema(); + var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + var knownFieldNames = Object.create(null); + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness + }; + + function checkFieldUniqueness(node) { + var typeName = node.name.value; + + if (!knownFieldNames[typeName]) { + knownFieldNames[typeName] = Object.create(null); + } + + if (node.fields) { + var fieldNames = knownFieldNames[typeName]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fieldDef = _step.value; + var fieldName = fieldDef.name.value; + + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError(new _GraphQLError.GraphQLError(existedFieldDefinitionNameMessage(typeName, fieldName), fieldDef.name)); + } else if (fieldNames[fieldName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateFieldDefinitionNameMessage(typeName, fieldName), [fieldNames[fieldName], fieldDef.name])); + } else { + fieldNames[fieldName] = fieldDef.name; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} + +function hasField(type, fieldName) { + if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type) || (0, _definition.isInputObjectType)(type)) { + return type.getFields()[fieldName]; + } + + return false; +} diff --git a/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow new file mode 100644 index 000000000..6eaa3c97b --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow @@ -0,0 +1,89 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; +import { + isObjectType, + isInterfaceType, + isInputObjectType, +} from '../../type/definition'; + +export function duplicateFieldDefinitionNameMessage( + typeName: string, + fieldName: string, +): string { + return `Field "${typeName}.${fieldName}" can only be defined once.`; +} + +export function existedFieldDefinitionNameMessage( + typeName: string, + fieldName: string, +): string { + return `Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`; +} + +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + */ +export function UniqueFieldDefinitionNames( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + const knownFieldNames = Object.create(null); + + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness, + }; + + function checkFieldUniqueness(node) { + const typeName = node.name.value; + + if (!knownFieldNames[typeName]) { + knownFieldNames[typeName] = Object.create(null); + } + + if (node.fields) { + const fieldNames = knownFieldNames[typeName]; + + for (const fieldDef of node.fields) { + const fieldName = fieldDef.name.value; + + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError( + new GraphQLError( + existedFieldDefinitionNameMessage(typeName, fieldName), + fieldDef.name, + ), + ); + } else if (fieldNames[fieldName]) { + context.reportError( + new GraphQLError( + duplicateFieldDefinitionNameMessage(typeName, fieldName), + [fieldNames[fieldName], fieldDef.name], + ), + ); + } else { + fieldNames[fieldName] = fieldDef.name; + } + } + } + + return false; + } +} + +function hasField(type, fieldName) { + if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { + return type.getFields()[fieldName]; + } + return false; +} diff --git a/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs new file mode 100644 index 000000000..aecf106a7 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs @@ -0,0 +1,80 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { isObjectType, isInterfaceType, isInputObjectType } from '../../type/definition'; +export function duplicateFieldDefinitionNameMessage(typeName, fieldName) { + return "Field \"".concat(typeName, ".").concat(fieldName, "\" can only be defined once."); +} +export function existedFieldDefinitionNameMessage(typeName, fieldName) { + return "Field \"".concat(typeName, ".").concat(fieldName, "\" already exists in the schema. It cannot also be defined in this type extension."); +} +/** + * Unique field definition names + * + * A GraphQL complex type is only valid if all its fields are uniquely named. + */ + +export function UniqueFieldDefinitionNames(context) { + var schema = context.getSchema(); + var existingTypeMap = schema ? schema.getTypeMap() : Object.create(null); + var knownFieldNames = Object.create(null); + return { + InputObjectTypeDefinition: checkFieldUniqueness, + InputObjectTypeExtension: checkFieldUniqueness, + InterfaceTypeDefinition: checkFieldUniqueness, + InterfaceTypeExtension: checkFieldUniqueness, + ObjectTypeDefinition: checkFieldUniqueness, + ObjectTypeExtension: checkFieldUniqueness + }; + + function checkFieldUniqueness(node) { + var typeName = node.name.value; + + if (!knownFieldNames[typeName]) { + knownFieldNames[typeName] = Object.create(null); + } + + if (node.fields) { + var fieldNames = knownFieldNames[typeName]; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = node.fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fieldDef = _step.value; + var fieldName = fieldDef.name.value; + + if (hasField(existingTypeMap[typeName], fieldName)) { + context.reportError(new GraphQLError(existedFieldDefinitionNameMessage(typeName, fieldName), fieldDef.name)); + } else if (fieldNames[fieldName]) { + context.reportError(new GraphQLError(duplicateFieldDefinitionNameMessage(typeName, fieldName), [fieldNames[fieldName], fieldDef.name])); + } else { + fieldNames[fieldName] = fieldDef.name; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} + +function hasField(type, fieldName) { + if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { + return type.getFields()[fieldName]; + } + + return false; +} diff --git a/node_modules/graphql/validation/rules/UniqueFragmentNames.js b/node_modules/graphql/validation/rules/UniqueFragmentNames.js new file mode 100644 index 000000000..8356cd80b --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFragmentNames.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateFragmentNameMessage = duplicateFragmentNameMessage; +exports.UniqueFragmentNames = UniqueFragmentNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateFragmentNameMessage(fragName) { + return "There can be only one fragment named \"".concat(fragName, "\"."); +} +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + */ + + +function UniqueFragmentNames(context) { + var knownFragmentNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + var fragmentName = node.name.value; + + if (knownFragmentNames[fragmentName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateFragmentNameMessage(fragmentName), [knownFragmentNames[fragmentName], node.name])); + } else { + knownFragmentNames[fragmentName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueFragmentNames.js.flow b/node_modules/graphql/validation/rules/UniqueFragmentNames.js.flow new file mode 100644 index 000000000..6d256a706 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFragmentNames.js.flow @@ -0,0 +1,35 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateFragmentNameMessage(fragName: string): string { + return `There can be only one fragment named "${fragName}".`; +} + +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + */ +export function UniqueFragmentNames(context: ASTValidationContext): ASTVisitor { + const knownFragmentNames = Object.create(null); + return { + OperationDefinition: () => false, + FragmentDefinition(node) { + const fragmentName = node.name.value; + if (knownFragmentNames[fragmentName]) { + context.reportError( + new GraphQLError(duplicateFragmentNameMessage(fragmentName), [ + knownFragmentNames[fragmentName], + node.name, + ]), + ); + } else { + knownFragmentNames[fragmentName] = node.name; + } + return false; + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueFragmentNames.mjs b/node_modules/graphql/validation/rules/UniqueFragmentNames.mjs new file mode 100644 index 000000000..f0ffea40e --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueFragmentNames.mjs @@ -0,0 +1,29 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateFragmentNameMessage(fragName) { + return "There can be only one fragment named \"".concat(fragName, "\"."); +} +/** + * Unique fragment names + * + * A GraphQL document is only valid if all defined fragments have unique names. + */ + +export function UniqueFragmentNames(context) { + var knownFragmentNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + return false; + }, + FragmentDefinition: function FragmentDefinition(node) { + var fragmentName = node.name.value; + + if (knownFragmentNames[fragmentName]) { + context.reportError(new GraphQLError(duplicateFragmentNameMessage(fragmentName), [knownFragmentNames[fragmentName], node.name])); + } else { + knownFragmentNames[fragmentName] = node.name; + } + + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueInputFieldNames.js b/node_modules/graphql/validation/rules/UniqueInputFieldNames.js new file mode 100644 index 000000000..23f4978b3 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueInputFieldNames.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateInputFieldMessage = duplicateInputFieldMessage; +exports.UniqueInputFieldNames = UniqueInputFieldNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateInputFieldMessage(fieldName) { + return "There can be only one input field named \"".concat(fieldName, "\"."); +} +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + */ + + +function UniqueInputFieldNames(context) { + var knownNameStack = []; + var knownNames = Object.create(null); + return { + ObjectValue: { + enter: function enter() { + knownNameStack.push(knownNames); + knownNames = Object.create(null); + }, + leave: function leave() { + knownNames = knownNameStack.pop(); + } + }, + ObjectField: function ObjectField(node) { + var fieldName = node.name.value; + + if (knownNames[fieldName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateInputFieldMessage(fieldName), [knownNames[fieldName], node.name])); + } else { + knownNames[fieldName] = node.name; + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueInputFieldNames.js.flow b/node_modules/graphql/validation/rules/UniqueInputFieldNames.js.flow new file mode 100644 index 000000000..b43adce0c --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueInputFieldNames.js.flow @@ -0,0 +1,47 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateInputFieldMessage(fieldName: string): string { + return `There can be only one input field named "${fieldName}".`; +} + +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + */ +export function UniqueInputFieldNames( + context: ASTValidationContext, +): ASTVisitor { + const knownNameStack = []; + let knownNames = Object.create(null); + + return { + ObjectValue: { + enter() { + knownNameStack.push(knownNames); + knownNames = Object.create(null); + }, + leave() { + knownNames = knownNameStack.pop(); + }, + }, + ObjectField(node) { + const fieldName = node.name.value; + if (knownNames[fieldName]) { + context.reportError( + new GraphQLError(duplicateInputFieldMessage(fieldName), [ + knownNames[fieldName], + node.name, + ]), + ); + } else { + knownNames[fieldName] = node.name; + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueInputFieldNames.mjs b/node_modules/graphql/validation/rules/UniqueInputFieldNames.mjs new file mode 100644 index 000000000..264b010ca --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueInputFieldNames.mjs @@ -0,0 +1,35 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateInputFieldMessage(fieldName) { + return "There can be only one input field named \"".concat(fieldName, "\"."); +} +/** + * Unique input field names + * + * A GraphQL input object value is only valid if all supplied fields are + * uniquely named. + */ + +export function UniqueInputFieldNames(context) { + var knownNameStack = []; + var knownNames = Object.create(null); + return { + ObjectValue: { + enter: function enter() { + knownNameStack.push(knownNames); + knownNames = Object.create(null); + }, + leave: function leave() { + knownNames = knownNameStack.pop(); + } + }, + ObjectField: function ObjectField(node) { + var fieldName = node.name.value; + + if (knownNames[fieldName]) { + context.reportError(new GraphQLError(duplicateInputFieldMessage(fieldName), [knownNames[fieldName], node.name])); + } else { + knownNames[fieldName] = node.name; + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationNames.js b/node_modules/graphql/validation/rules/UniqueOperationNames.js new file mode 100644 index 000000000..a54014eb8 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationNames.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateOperationNameMessage = duplicateOperationNameMessage; +exports.UniqueOperationNames = UniqueOperationNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateOperationNameMessage(operationName) { + return "There can be only one operation named \"".concat(operationName, "\"."); +} +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + */ + + +function UniqueOperationNames(context) { + var knownOperationNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition(node) { + var operationName = node.name; + + if (operationName) { + if (knownOperationNames[operationName.value]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateOperationNameMessage(operationName.value), [knownOperationNames[operationName.value], operationName])); + } else { + knownOperationNames[operationName.value] = operationName; + } + } + + return false; + }, + FragmentDefinition: function FragmentDefinition() { + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationNames.js.flow b/node_modules/graphql/validation/rules/UniqueOperationNames.js.flow new file mode 100644 index 000000000..cd3cf2a55 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationNames.js.flow @@ -0,0 +1,39 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateOperationNameMessage(operationName: string): string { + return `There can be only one operation named "${operationName}".`; +} + +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + */ +export function UniqueOperationNames( + context: ASTValidationContext, +): ASTVisitor { + const knownOperationNames = Object.create(null); + return { + OperationDefinition(node) { + const operationName = node.name; + if (operationName) { + if (knownOperationNames[operationName.value]) { + context.reportError( + new GraphQLError( + duplicateOperationNameMessage(operationName.value), + [knownOperationNames[operationName.value], operationName], + ), + ); + } else { + knownOperationNames[operationName.value] = operationName; + } + } + return false; + }, + FragmentDefinition: () => false, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationNames.mjs b/node_modules/graphql/validation/rules/UniqueOperationNames.mjs new file mode 100644 index 000000000..b764a0724 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationNames.mjs @@ -0,0 +1,31 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateOperationNameMessage(operationName) { + return "There can be only one operation named \"".concat(operationName, "\"."); +} +/** + * Unique operation names + * + * A GraphQL document is only valid if all defined operations have unique names. + */ + +export function UniqueOperationNames(context) { + var knownOperationNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition(node) { + var operationName = node.name; + + if (operationName) { + if (knownOperationNames[operationName.value]) { + context.reportError(new GraphQLError(duplicateOperationNameMessage(operationName.value), [knownOperationNames[operationName.value], operationName])); + } else { + knownOperationNames[operationName.value] = operationName; + } + } + + return false; + }, + FragmentDefinition: function FragmentDefinition() { + return false; + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationTypes.js b/node_modules/graphql/validation/rules/UniqueOperationTypes.js new file mode 100644 index 000000000..cb39211ba --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationTypes.js @@ -0,0 +1,77 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateOperationTypeMessage = duplicateOperationTypeMessage; +exports.existedOperationTypeMessage = existedOperationTypeMessage; +exports.UniqueOperationTypes = UniqueOperationTypes; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateOperationTypeMessage(operation) { + return "There can be only one ".concat(operation, " type in schema."); +} + +function existedOperationTypeMessage(operation) { + return "Type for ".concat(operation, " already defined in the schema. It cannot be redefined."); +} +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + */ + + +function UniqueOperationTypes(context) { + var schema = context.getSchema(); + var definedOperationTypes = Object.create(null); + var existingOperationTypes = schema ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType() + } : {}; + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes + }; + + function checkOperationTypes(node) { + if (node.operationTypes) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (node.operationTypes || [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var operationType = _step.value; + var operation = operationType.operation; + var alreadyDefinedOperationType = definedOperationTypes[operation]; + + if (existingOperationTypes[operation]) { + context.reportError(new _GraphQLError.GraphQLError(existedOperationTypeMessage(operation), operationType)); + } else if (alreadyDefinedOperationType) { + context.reportError(new _GraphQLError.GraphQLError(duplicateOperationTypeMessage(operation), [alreadyDefinedOperationType, operationType])); + } else { + definedOperationTypes[operation] = operationType; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow b/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow new file mode 100644 index 000000000..393b916c8 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow @@ -0,0 +1,66 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateOperationTypeMessage(operation: string): string { + return `There can be only one ${operation} type in schema.`; +} + +export function existedOperationTypeMessage(operation: string): string { + return `Type for ${operation} already defined in the schema. It cannot be redefined.`; +} + +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + */ +export function UniqueOperationTypes( + context: SDLValidationContext, +): ASTVisitor { + const schema = context.getSchema(); + const definedOperationTypes = Object.create(null); + const existingOperationTypes = schema + ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType(), + } + : {}; + + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes, + }; + + function checkOperationTypes(node) { + if (node.operationTypes) { + for (const operationType of node.operationTypes || []) { + const operation = operationType.operation; + const alreadyDefinedOperationType = definedOperationTypes[operation]; + + if (existingOperationTypes[operation]) { + context.reportError( + new GraphQLError( + existedOperationTypeMessage(operation), + operationType, + ), + ); + } else if (alreadyDefinedOperationType) { + context.reportError( + new GraphQLError(duplicateOperationTypeMessage(operation), [ + alreadyDefinedOperationType, + operationType, + ]), + ); + } else { + definedOperationTypes[operation] = operationType; + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs b/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs new file mode 100644 index 000000000..d6db8236f --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs @@ -0,0 +1,65 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateOperationTypeMessage(operation) { + return "There can be only one ".concat(operation, " type in schema."); +} +export function existedOperationTypeMessage(operation) { + return "Type for ".concat(operation, " already defined in the schema. It cannot be redefined."); +} +/** + * Unique operation types + * + * A GraphQL document is only valid if it has only one type per operation. + */ + +export function UniqueOperationTypes(context) { + var schema = context.getSchema(); + var definedOperationTypes = Object.create(null); + var existingOperationTypes = schema ? { + query: schema.getQueryType(), + mutation: schema.getMutationType(), + subscription: schema.getSubscriptionType() + } : {}; + return { + SchemaDefinition: checkOperationTypes, + SchemaExtension: checkOperationTypes + }; + + function checkOperationTypes(node) { + if (node.operationTypes) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (node.operationTypes || [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var operationType = _step.value; + var operation = operationType.operation; + var alreadyDefinedOperationType = definedOperationTypes[operation]; + + if (existingOperationTypes[operation]) { + context.reportError(new GraphQLError(existedOperationTypeMessage(operation), operationType)); + } else if (alreadyDefinedOperationType) { + context.reportError(new GraphQLError(duplicateOperationTypeMessage(operation), [alreadyDefinedOperationType, operationType])); + } else { + definedOperationTypes[operation] = operationType; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueTypeNames.js b/node_modules/graphql/validation/rules/UniqueTypeNames.js new file mode 100644 index 000000000..e05899b3a --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueTypeNames.js @@ -0,0 +1,54 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateTypeNameMessage = duplicateTypeNameMessage; +exports.existedTypeNameMessage = existedTypeNameMessage; +exports.UniqueTypeNames = UniqueTypeNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateTypeNameMessage(typeName) { + return "There can be only one type named \"".concat(typeName, "\"."); +} + +function existedTypeNameMessage(typeName) { + return "Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."); +} +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + */ + + +function UniqueTypeNames(context) { + var knownTypeNames = Object.create(null); + var schema = context.getSchema(); + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName + }; + + function checkTypeName(node) { + var typeName = node.name.value; + + if (schema && schema.getType(typeName)) { + context.reportError(new _GraphQLError.GraphQLError(existedTypeNameMessage(typeName), node.name)); + return; + } + + if (knownTypeNames[typeName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateTypeNameMessage(typeName), [knownTypeNames[typeName], node.name])); + } else { + knownTypeNames[typeName] = node.name; + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow b/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow new file mode 100644 index 000000000..0ede9dc88 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow @@ -0,0 +1,57 @@ +// @flow strict + +import { type SDLValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; +import { type TypeDefinitionNode } from '../../language/ast'; + +export function duplicateTypeNameMessage(typeName: string): string { + return `There can be only one type named "${typeName}".`; +} + +export function existedTypeNameMessage(typeName: string): string { + return `Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`; +} + +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + */ +export function UniqueTypeNames(context: SDLValidationContext): ASTVisitor { + const knownTypeNames = Object.create(null); + const schema = context.getSchema(); + + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName, + }; + + function checkTypeName(node: TypeDefinitionNode) { + const typeName = node.name.value; + + if (schema && schema.getType(typeName)) { + context.reportError( + new GraphQLError(existedTypeNameMessage(typeName), node.name), + ); + return; + } + + if (knownTypeNames[typeName]) { + context.reportError( + new GraphQLError(duplicateTypeNameMessage(typeName), [ + knownTypeNames[typeName], + node.name, + ]), + ); + } else { + knownTypeNames[typeName] = node.name; + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueTypeNames.mjs b/node_modules/graphql/validation/rules/UniqueTypeNames.mjs new file mode 100644 index 000000000..09aa888f8 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueTypeNames.mjs @@ -0,0 +1,42 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateTypeNameMessage(typeName) { + return "There can be only one type named \"".concat(typeName, "\"."); +} +export function existedTypeNameMessage(typeName) { + return "Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."); +} +/** + * Unique type names + * + * A GraphQL document is only valid if all defined types have unique names. + */ + +export function UniqueTypeNames(context) { + var knownTypeNames = Object.create(null); + var schema = context.getSchema(); + return { + ScalarTypeDefinition: checkTypeName, + ObjectTypeDefinition: checkTypeName, + InterfaceTypeDefinition: checkTypeName, + UnionTypeDefinition: checkTypeName, + EnumTypeDefinition: checkTypeName, + InputObjectTypeDefinition: checkTypeName + }; + + function checkTypeName(node) { + var typeName = node.name.value; + + if (schema && schema.getType(typeName)) { + context.reportError(new GraphQLError(existedTypeNameMessage(typeName), node.name)); + return; + } + + if (knownTypeNames[typeName]) { + context.reportError(new GraphQLError(duplicateTypeNameMessage(typeName), [knownTypeNames[typeName], node.name])); + } else { + knownTypeNames[typeName] = node.name; + } + + return false; + } +} diff --git a/node_modules/graphql/validation/rules/UniqueVariableNames.js b/node_modules/graphql/validation/rules/UniqueVariableNames.js new file mode 100644 index 000000000..6e7925b3f --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueVariableNames.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.duplicateVariableMessage = duplicateVariableMessage; +exports.UniqueVariableNames = UniqueVariableNames; + +var _GraphQLError = require("../../error/GraphQLError"); + +function duplicateVariableMessage(variableName) { + return "There can be only one variable named \"".concat(variableName, "\"."); +} +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + */ + + +function UniqueVariableNames(context) { + var knownVariableNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + knownVariableNames = Object.create(null); + }, + VariableDefinition: function VariableDefinition(node) { + var variableName = node.variable.name.value; + + if (knownVariableNames[variableName]) { + context.reportError(new _GraphQLError.GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name])); + } else { + knownVariableNames[variableName] = node.variable.name; + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueVariableNames.js.flow b/node_modules/graphql/validation/rules/UniqueVariableNames.js.flow new file mode 100644 index 000000000..42fb16688 --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueVariableNames.js.flow @@ -0,0 +1,37 @@ +// @flow strict + +import { type ASTValidationContext } from '../ValidationContext'; +import { type VariableDefinitionNode } from '../../language/ast'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ASTVisitor } from '../../language/visitor'; + +export function duplicateVariableMessage(variableName: string): string { + return `There can be only one variable named "${variableName}".`; +} + +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + */ +export function UniqueVariableNames(context: ASTValidationContext): ASTVisitor { + let knownVariableNames = Object.create(null); + return { + OperationDefinition() { + knownVariableNames = Object.create(null); + }, + VariableDefinition(node: VariableDefinitionNode) { + const variableName = node.variable.name.value; + if (knownVariableNames[variableName]) { + context.reportError( + new GraphQLError(duplicateVariableMessage(variableName), [ + knownVariableNames[variableName], + node.variable.name, + ]), + ); + } else { + knownVariableNames[variableName] = node.variable.name; + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/UniqueVariableNames.mjs b/node_modules/graphql/validation/rules/UniqueVariableNames.mjs new file mode 100644 index 000000000..a8eb04eca --- /dev/null +++ b/node_modules/graphql/validation/rules/UniqueVariableNames.mjs @@ -0,0 +1,27 @@ +import { GraphQLError } from '../../error/GraphQLError'; +export function duplicateVariableMessage(variableName) { + return "There can be only one variable named \"".concat(variableName, "\"."); +} +/** + * Unique variable names + * + * A GraphQL operation is only valid if all its variables are uniquely named. + */ + +export function UniqueVariableNames(context) { + var knownVariableNames = Object.create(null); + return { + OperationDefinition: function OperationDefinition() { + knownVariableNames = Object.create(null); + }, + VariableDefinition: function VariableDefinition(node) { + var variableName = node.variable.name.value; + + if (knownVariableNames[variableName]) { + context.reportError(new GraphQLError(duplicateVariableMessage(variableName), [knownVariableNames[variableName], node.variable.name])); + } else { + knownVariableNames[variableName] = node.variable.name; + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/ValuesOfCorrectType.js b/node_modules/graphql/validation/rules/ValuesOfCorrectType.js new file mode 100644 index 000000000..36e860f27 --- /dev/null +++ b/node_modules/graphql/validation/rules/ValuesOfCorrectType.js @@ -0,0 +1,190 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.badValueMessage = badValueMessage; +exports.badEnumValueMessage = badEnumValueMessage; +exports.requiredFieldMessage = requiredFieldMessage; +exports.unknownFieldMessage = unknownFieldMessage; +exports.ValuesOfCorrectType = ValuesOfCorrectType; + +var _objectValues = _interopRequireDefault(require("../../polyfills/objectValues")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _printer = require("../../language/printer"); + +var _definition = require("../../type/definition"); + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _isInvalid = _interopRequireDefault(require("../../jsutils/isInvalid")); + +var _keyMap = _interopRequireDefault(require("../../jsutils/keyMap")); + +var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean")); + +var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function badValueMessage(typeName, valueName, message) { + return "Expected type ".concat(typeName, ", found ").concat(valueName) + (message ? "; ".concat(message) : '.'); +} + +function badEnumValueMessage(typeName, valueName, suggestedValues) { + return "Expected type ".concat(typeName, ", found ").concat(valueName, ".") + (0, _didYouMean.default)('the enum value', suggestedValues); +} + +function requiredFieldMessage(typeName, fieldName, fieldTypeName) { + return "Field ".concat(typeName, ".").concat(fieldName, " of required type ").concat(fieldTypeName, " was not provided."); +} + +function unknownFieldMessage(typeName, fieldName, suggestedFields) { + return "Field \"".concat(fieldName, "\" is not defined by type ").concat(typeName, ".") + (0, _didYouMean.default)(suggestedFields); +} +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ + + +function ValuesOfCorrectType(context) { + return { + NullValue: function NullValue(node) { + var type = context.getInputType(); + + if ((0, _definition.isNonNullType)(type)) { + context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(type), (0, _printer.print)(node)), node)); + } + }, + ListValue: function ListValue(node) { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + var type = (0, _definition.getNullableType)(context.getParentInputType()); + + if (!(0, _definition.isListType)(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } + }, + ObjectValue: function ObjectValue(node) { + var type = (0, _definition.getNamedType)(context.getInputType()); + + if (!(0, _definition.isInputObjectType)(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } // Ensure every required field exists. + + + var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) { + return field.name.value; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = (0, _objectValues.default)(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fieldDef = _step.value; + var fieldNode = fieldNodeMap[fieldDef.name]; + + if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) { + var typeStr = (0, _inspect.default)(fieldDef.type); + context.reportError(new _GraphQLError.GraphQLError(requiredFieldMessage(type.name, fieldDef.name, typeStr), node)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + }, + ObjectField: function ObjectField(node) { + var parentType = (0, _definition.getNamedType)(context.getParentInputType()); + var fieldType = context.getInputType(); + + if (!fieldType && (0, _definition.isInputObjectType)(parentType)) { + var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields())); + context.reportError(new _GraphQLError.GraphQLError(unknownFieldMessage(parentType.name, node.name.value, suggestions), node)); + } + }, + EnumValue: function EnumValue(node) { + var type = (0, _definition.getNamedType)(context.getInputType()); + + if (!(0, _definition.isEnumType)(type)) { + isValidScalar(context, node); + } else if (!type.getValue(node.value)) { + context.reportError(new _GraphQLError.GraphQLError(badEnumValueMessage(type.name, (0, _printer.print)(node), enumTypeSuggestion(type, node)), node)); + } + }, + IntValue: function IntValue(node) { + return isValidScalar(context, node); + }, + FloatValue: function FloatValue(node) { + return isValidScalar(context, node); + }, + StringValue: function StringValue(node) { + return isValidScalar(context, node); + }, + BooleanValue: function BooleanValue(node) { + return isValidScalar(context, node); + } + }; +} +/** + * Any value literal may be a valid representation of a Scalar, depending on + * that scalar type. + */ + + +function isValidScalar(context, node) { + // Report any error at the full type expected by the location. + var locationType = context.getInputType(); + + if (!locationType) { + return; + } + + var type = (0, _definition.getNamedType)(locationType); + + if (!(0, _definition.isScalarType)(type)) { + var message = (0, _definition.isEnumType)(type) ? badEnumValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node), enumTypeSuggestion(type, node)) : badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node)); + context.reportError(new _GraphQLError.GraphQLError(message, node)); + return; + } // Scalars determine if a literal value is valid via parseLiteral() which + // may throw or return an invalid value to indicate failure. + + + try { + var parseResult = type.parseLiteral(node, undefined + /* variables */ + ); + + if ((0, _isInvalid.default)(parseResult)) { + context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node)), node)); + } + } catch (error) { + // Ensure a reference to the original error is maintained. + context.reportError(new _GraphQLError.GraphQLError(badValueMessage((0, _inspect.default)(locationType), (0, _printer.print)(node), error.message), node, undefined, undefined, undefined, error)); + } +} + +function enumTypeSuggestion(type, node) { + var allNames = type.getValues().map(function (value) { + return value.name; + }); + return (0, _suggestionList.default)((0, _printer.print)(node), allNames); +} diff --git a/node_modules/graphql/validation/rules/ValuesOfCorrectType.js.flow b/node_modules/graphql/validation/rules/ValuesOfCorrectType.js.flow new file mode 100644 index 000000000..1ea88a7a8 --- /dev/null +++ b/node_modules/graphql/validation/rules/ValuesOfCorrectType.js.flow @@ -0,0 +1,207 @@ +// @flow strict + +import objectValues from '../../polyfills/objectValues'; +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type ValueNode } from '../../language/ast'; +import { print } from '../../language/printer'; +import { type ASTVisitor } from '../../language/visitor'; +import { + isScalarType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isRequiredInputField, + getNullableType, + getNamedType, +} from '../../type/definition'; +import inspect from '../../jsutils/inspect'; +import isInvalid from '../../jsutils/isInvalid'; +import keyMap from '../../jsutils/keyMap'; +import didYouMean from '../../jsutils/didYouMean'; +import suggestionList from '../../jsutils/suggestionList'; + +export function badValueMessage( + typeName: string, + valueName: string, + message?: string, +): string { + return ( + `Expected type ${typeName}, found ${valueName}` + + (message ? `; ${message}` : '.') + ); +} + +export function badEnumValueMessage( + typeName: string, + valueName: string, + suggestedValues: $ReadOnlyArray, +) { + return ( + `Expected type ${typeName}, found ${valueName}.` + + didYouMean('the enum value', suggestedValues) + ); +} + +export function requiredFieldMessage( + typeName: string, + fieldName: string, + fieldTypeName: string, +): string { + return `Field ${typeName}.${fieldName} of required type ${fieldTypeName} was not provided.`; +} + +export function unknownFieldMessage( + typeName: string, + fieldName: string, + suggestedFields: $ReadOnlyArray, +): string { + return ( + `Field "${fieldName}" is not defined by type ${typeName}.` + + didYouMean(suggestedFields) + ); +} + +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ +export function ValuesOfCorrectType(context: ValidationContext): ASTVisitor { + return { + NullValue(node) { + const type = context.getInputType(); + if (isNonNullType(type)) { + context.reportError( + new GraphQLError(badValueMessage(inspect(type), print(node)), node), + ); + } + }, + ListValue(node) { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + const type = getNullableType(context.getParentInputType()); + if (!isListType(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } + }, + ObjectValue(node) { + const type = getNamedType(context.getInputType()); + if (!isInputObjectType(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } + // Ensure every required field exists. + const fieldNodeMap = keyMap(node.fields, field => field.name.value); + for (const fieldDef of objectValues(type.getFields())) { + const fieldNode = fieldNodeMap[fieldDef.name]; + if (!fieldNode && isRequiredInputField(fieldDef)) { + const typeStr = inspect(fieldDef.type); + context.reportError( + new GraphQLError( + requiredFieldMessage(type.name, fieldDef.name, typeStr), + node, + ), + ); + } + } + }, + ObjectField(node) { + const parentType = getNamedType(context.getParentInputType()); + const fieldType = context.getInputType(); + if (!fieldType && isInputObjectType(parentType)) { + const suggestions = suggestionList( + node.name.value, + Object.keys(parentType.getFields()), + ); + context.reportError( + new GraphQLError( + unknownFieldMessage(parentType.name, node.name.value, suggestions), + node, + ), + ); + } + }, + EnumValue(node) { + const type = getNamedType(context.getInputType()); + if (!isEnumType(type)) { + isValidScalar(context, node); + } else if (!type.getValue(node.value)) { + context.reportError( + new GraphQLError( + badEnumValueMessage( + type.name, + print(node), + enumTypeSuggestion(type, node), + ), + node, + ), + ); + } + }, + IntValue: node => isValidScalar(context, node), + FloatValue: node => isValidScalar(context, node), + StringValue: node => isValidScalar(context, node), + BooleanValue: node => isValidScalar(context, node), + }; +} + +/** + * Any value literal may be a valid representation of a Scalar, depending on + * that scalar type. + */ +function isValidScalar(context: ValidationContext, node: ValueNode): void { + // Report any error at the full type expected by the location. + const locationType = context.getInputType(); + if (!locationType) { + return; + } + + const type = getNamedType(locationType); + + if (!isScalarType(type)) { + const message = isEnumType(type) + ? badEnumValueMessage( + inspect(locationType), + print(node), + enumTypeSuggestion(type, node), + ) + : badValueMessage(inspect(locationType), print(node)); + context.reportError(new GraphQLError(message, node)); + return; + } + + // Scalars determine if a literal value is valid via parseLiteral() which + // may throw or return an invalid value to indicate failure. + try { + const parseResult = type.parseLiteral(node, undefined /* variables */); + if (isInvalid(parseResult)) { + context.reportError( + new GraphQLError( + badValueMessage(inspect(locationType), print(node)), + node, + ), + ); + } + } catch (error) { + // Ensure a reference to the original error is maintained. + context.reportError( + new GraphQLError( + badValueMessage(inspect(locationType), print(node), error.message), + node, + undefined, + undefined, + undefined, + error, + ), + ); + } +} + +function enumTypeSuggestion(type, node) { + const allNames = type.getValues().map(value => value.name); + return suggestionList(print(node), allNames); +} diff --git a/node_modules/graphql/validation/rules/ValuesOfCorrectType.mjs b/node_modules/graphql/validation/rules/ValuesOfCorrectType.mjs new file mode 100644 index 000000000..26c762e7f --- /dev/null +++ b/node_modules/graphql/validation/rules/ValuesOfCorrectType.mjs @@ -0,0 +1,163 @@ +import objectValues from '../../polyfills/objectValues'; +import { GraphQLError } from '../../error/GraphQLError'; +import { print } from '../../language/printer'; +import { isScalarType, isEnumType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, getNullableType, getNamedType } from '../../type/definition'; +import inspect from '../../jsutils/inspect'; +import isInvalid from '../../jsutils/isInvalid'; +import keyMap from '../../jsutils/keyMap'; +import didYouMean from '../../jsutils/didYouMean'; +import suggestionList from '../../jsutils/suggestionList'; +export function badValueMessage(typeName, valueName, message) { + return "Expected type ".concat(typeName, ", found ").concat(valueName) + (message ? "; ".concat(message) : '.'); +} +export function badEnumValueMessage(typeName, valueName, suggestedValues) { + return "Expected type ".concat(typeName, ", found ").concat(valueName, ".") + didYouMean('the enum value', suggestedValues); +} +export function requiredFieldMessage(typeName, fieldName, fieldTypeName) { + return "Field ".concat(typeName, ".").concat(fieldName, " of required type ").concat(fieldTypeName, " was not provided."); +} +export function unknownFieldMessage(typeName, fieldName, suggestedFields) { + return "Field \"".concat(fieldName, "\" is not defined by type ").concat(typeName, ".") + didYouMean(suggestedFields); +} +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ + +export function ValuesOfCorrectType(context) { + return { + NullValue: function NullValue(node) { + var type = context.getInputType(); + + if (isNonNullType(type)) { + context.reportError(new GraphQLError(badValueMessage(inspect(type), print(node)), node)); + } + }, + ListValue: function ListValue(node) { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + var type = getNullableType(context.getParentInputType()); + + if (!isListType(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } + }, + ObjectValue: function ObjectValue(node) { + var type = getNamedType(context.getInputType()); + + if (!isInputObjectType(type)) { + isValidScalar(context, node); + return false; // Don't traverse further. + } // Ensure every required field exists. + + + var fieldNodeMap = keyMap(node.fields, function (field) { + return field.name.value; + }); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = objectValues(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var fieldDef = _step.value; + var fieldNode = fieldNodeMap[fieldDef.name]; + + if (!fieldNode && isRequiredInputField(fieldDef)) { + var typeStr = inspect(fieldDef.type); + context.reportError(new GraphQLError(requiredFieldMessage(type.name, fieldDef.name, typeStr), node)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + }, + ObjectField: function ObjectField(node) { + var parentType = getNamedType(context.getParentInputType()); + var fieldType = context.getInputType(); + + if (!fieldType && isInputObjectType(parentType)) { + var suggestions = suggestionList(node.name.value, Object.keys(parentType.getFields())); + context.reportError(new GraphQLError(unknownFieldMessage(parentType.name, node.name.value, suggestions), node)); + } + }, + EnumValue: function EnumValue(node) { + var type = getNamedType(context.getInputType()); + + if (!isEnumType(type)) { + isValidScalar(context, node); + } else if (!type.getValue(node.value)) { + context.reportError(new GraphQLError(badEnumValueMessage(type.name, print(node), enumTypeSuggestion(type, node)), node)); + } + }, + IntValue: function IntValue(node) { + return isValidScalar(context, node); + }, + FloatValue: function FloatValue(node) { + return isValidScalar(context, node); + }, + StringValue: function StringValue(node) { + return isValidScalar(context, node); + }, + BooleanValue: function BooleanValue(node) { + return isValidScalar(context, node); + } + }; +} +/** + * Any value literal may be a valid representation of a Scalar, depending on + * that scalar type. + */ + +function isValidScalar(context, node) { + // Report any error at the full type expected by the location. + var locationType = context.getInputType(); + + if (!locationType) { + return; + } + + var type = getNamedType(locationType); + + if (!isScalarType(type)) { + var message = isEnumType(type) ? badEnumValueMessage(inspect(locationType), print(node), enumTypeSuggestion(type, node)) : badValueMessage(inspect(locationType), print(node)); + context.reportError(new GraphQLError(message, node)); + return; + } // Scalars determine if a literal value is valid via parseLiteral() which + // may throw or return an invalid value to indicate failure. + + + try { + var parseResult = type.parseLiteral(node, undefined + /* variables */ + ); + + if (isInvalid(parseResult)) { + context.reportError(new GraphQLError(badValueMessage(inspect(locationType), print(node)), node)); + } + } catch (error) { + // Ensure a reference to the original error is maintained. + context.reportError(new GraphQLError(badValueMessage(inspect(locationType), print(node), error.message), node, undefined, undefined, undefined, error)); + } +} + +function enumTypeSuggestion(type, node) { + var allNames = type.getValues().map(function (value) { + return value.name; + }); + return suggestionList(print(node), allNames); +} diff --git a/node_modules/graphql/validation/rules/VariablesAreInputTypes.js b/node_modules/graphql/validation/rules/VariablesAreInputTypes.js new file mode 100644 index 000000000..2ac903754 --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesAreInputTypes.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nonInputTypeOnVarMessage = nonInputTypeOnVarMessage; +exports.VariablesAreInputTypes = VariablesAreInputTypes; + +var _GraphQLError = require("../../error/GraphQLError"); + +var _printer = require("../../language/printer"); + +var _definition = require("../../type/definition"); + +var _typeFromAST = require("../../utilities/typeFromAST"); + +function nonInputTypeOnVarMessage(variableName, typeName) { + return "Variable \"$".concat(variableName, "\" cannot be non-input type \"").concat(typeName, "\"."); +} +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + */ + + +function VariablesAreInputTypes(context) { + return { + VariableDefinition: function VariableDefinition(node) { + var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type); // If the variable type is not an input type, return an error. + + if (type && !(0, _definition.isInputType)(type)) { + var variableName = node.variable.name.value; + context.reportError(new _GraphQLError.GraphQLError(nonInputTypeOnVarMessage(variableName, (0, _printer.print)(node.type)), node.type)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/VariablesAreInputTypes.js.flow b/node_modules/graphql/validation/rules/VariablesAreInputTypes.js.flow new file mode 100644 index 000000000..92ede7674 --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesAreInputTypes.js.flow @@ -0,0 +1,41 @@ +// @flow strict + +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { type VariableDefinitionNode } from '../../language/ast'; +import { print } from '../../language/printer'; +import { type ASTVisitor } from '../../language/visitor'; +import { isInputType } from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; + +export function nonInputTypeOnVarMessage( + variableName: string, + typeName: string, +): string { + return `Variable "$${variableName}" cannot be non-input type "${typeName}".`; +} + +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + */ +export function VariablesAreInputTypes(context: ValidationContext): ASTVisitor { + return { + VariableDefinition(node: VariableDefinitionNode): ?GraphQLError { + const type = typeFromAST(context.getSchema(), node.type); + + // If the variable type is not an input type, return an error. + if (type && !isInputType(type)) { + const variableName = node.variable.name.value; + context.reportError( + new GraphQLError( + nonInputTypeOnVarMessage(variableName, print(node.type)), + node.type, + ), + ); + } + }, + }; +} diff --git a/node_modules/graphql/validation/rules/VariablesAreInputTypes.mjs b/node_modules/graphql/validation/rules/VariablesAreInputTypes.mjs new file mode 100644 index 000000000..a75b20443 --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesAreInputTypes.mjs @@ -0,0 +1,26 @@ +import { GraphQLError } from '../../error/GraphQLError'; +import { print } from '../../language/printer'; +import { isInputType } from '../../type/definition'; +import { typeFromAST } from '../../utilities/typeFromAST'; +export function nonInputTypeOnVarMessage(variableName, typeName) { + return "Variable \"$".concat(variableName, "\" cannot be non-input type \"").concat(typeName, "\"."); +} +/** + * Variables are input types + * + * A GraphQL operation is only valid if all the variables it defines are of + * input types (scalar, enum, or input object). + */ + +export function VariablesAreInputTypes(context) { + return { + VariableDefinition: function VariableDefinition(node) { + var type = typeFromAST(context.getSchema(), node.type); // If the variable type is not an input type, return an error. + + if (type && !isInputType(type)) { + var variableName = node.variable.name.value; + context.reportError(new GraphQLError(nonInputTypeOnVarMessage(variableName, print(node.type)), node.type)); + } + } + }; +} diff --git a/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js new file mode 100644 index 000000000..d75a3731c --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js @@ -0,0 +1,109 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.badVarPosMessage = badVarPosMessage; +exports.VariablesInAllowedPosition = VariablesInAllowedPosition; + +var _inspect = _interopRequireDefault(require("../../jsutils/inspect")); + +var _GraphQLError = require("../../error/GraphQLError"); + +var _kinds = require("../../language/kinds"); + +var _definition = require("../../type/definition"); + +var _typeComparators = require("../../utilities/typeComparators"); + +var _typeFromAST = require("../../utilities/typeFromAST"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function badVarPosMessage(varName, varType, expectedType) { + return "Variable \"$".concat(varName, "\" of type \"").concat(varType, "\" used in position expecting type \"").concat(expectedType, "\"."); +} +/** + * Variables passed to field arguments conform to type + */ + + +function VariablesInAllowedPosition(context) { + var varDefMap = Object.create(null); + return { + OperationDefinition: { + enter: function enter() { + varDefMap = Object.create(null); + }, + leave: function leave(operation) { + var usages = context.getRecursiveVariableUsages(operation); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + var type = _ref2.type; + var defaultValue = _ref2.defaultValue; + var varName = node.name.value; + var varDef = varDefMap[varName]; + + if (varDef && type) { + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + var schema = context.getSchema(); + var varType = (0, _typeFromAST.typeFromAST)(schema, varDef.type); + + if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { + context.reportError(new _GraphQLError.GraphQLError(badVarPosMessage(varName, (0, _inspect.default)(varType), (0, _inspect.default)(type)), [varDef, node])); + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + }, + VariableDefinition: function VariableDefinition(node) { + varDefMap[node.variable.name.value] = node; + } + }; +} +/** + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. + */ + + +function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { + if ((0, _definition.isNonNullType)(locationType) && !(0, _definition.isNonNullType)(varType)) { + var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== _kinds.Kind.NULL; + var hasLocationDefaultValue = locationDefaultValue !== undefined; + + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + + var nullableLocationType = locationType.ofType; + return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, nullableLocationType); + } + + return (0, _typeComparators.isTypeSubTypeOf)(schema, varType, locationType); +} diff --git a/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js.flow b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js.flow new file mode 100644 index 000000000..b29c5665f --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.js.flow @@ -0,0 +1,99 @@ +// @flow strict + +import inspect from '../../jsutils/inspect'; +import { type ValidationContext } from '../ValidationContext'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { type ValueNode } from '../../language/ast'; +import { type ASTVisitor } from '../../language/visitor'; +import { type GraphQLType, isNonNullType } from '../../type/definition'; +import { isTypeSubTypeOf } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; +import { type GraphQLSchema } from '../../type/schema'; + +export function badVarPosMessage( + varName: string, + varType: string, + expectedType: string, +): string { + return `Variable "$${varName}" of type "${varType}" used in position expecting type "${expectedType}".`; +} + +/** + * Variables passed to field arguments conform to type + */ +export function VariablesInAllowedPosition( + context: ValidationContext, +): ASTVisitor { + let varDefMap = Object.create(null); + + return { + OperationDefinition: { + enter() { + varDefMap = Object.create(null); + }, + leave(operation) { + const usages = context.getRecursiveVariableUsages(operation); + + for (const { node, type, defaultValue } of usages) { + const varName = node.name.value; + const varDef = varDefMap[varName]; + if (varDef && type) { + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + const schema = context.getSchema(); + const varType = typeFromAST(schema, varDef.type); + if ( + varType && + !allowedVariableUsage( + schema, + varType, + varDef.defaultValue, + type, + defaultValue, + ) + ) { + context.reportError( + new GraphQLError( + badVarPosMessage(varName, inspect(varType), inspect(type)), + [varDef, node], + ), + ); + } + } + } + }, + }, + VariableDefinition(node) { + varDefMap[node.variable.name.value] = node; + }, + }; +} + +/** + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. + */ +function allowedVariableUsage( + schema: GraphQLSchema, + varType: GraphQLType, + varDefaultValue: ?ValueNode, + locationType: GraphQLType, + locationDefaultValue: ?mixed, +): boolean { + if (isNonNullType(locationType) && !isNonNullType(varType)) { + const hasNonNullVariableDefaultValue = + varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; + const hasLocationDefaultValue = locationDefaultValue !== undefined; + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + const nullableLocationType = locationType.ofType; + return isTypeSubTypeOf(schema, varType, nullableLocationType); + } + return isTypeSubTypeOf(schema, varType, locationType); +} diff --git a/node_modules/graphql/validation/rules/VariablesInAllowedPosition.mjs b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.mjs new file mode 100644 index 000000000..d7d8335a8 --- /dev/null +++ b/node_modules/graphql/validation/rules/VariablesInAllowedPosition.mjs @@ -0,0 +1,91 @@ +import inspect from '../../jsutils/inspect'; +import { GraphQLError } from '../../error/GraphQLError'; +import { Kind } from '../../language/kinds'; +import { isNonNullType } from '../../type/definition'; +import { isTypeSubTypeOf } from '../../utilities/typeComparators'; +import { typeFromAST } from '../../utilities/typeFromAST'; +export function badVarPosMessage(varName, varType, expectedType) { + return "Variable \"$".concat(varName, "\" of type \"").concat(varType, "\" used in position expecting type \"").concat(expectedType, "\"."); +} +/** + * Variables passed to field arguments conform to type + */ + +export function VariablesInAllowedPosition(context) { + var varDefMap = Object.create(null); + return { + OperationDefinition: { + enter: function enter() { + varDefMap = Object.create(null); + }, + leave: function leave(operation) { + var usages = context.getRecursiveVariableUsages(operation); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref2 = _step.value; + var node = _ref2.node; + var type = _ref2.type; + var defaultValue = _ref2.defaultValue; + var varName = node.name.value; + var varDef = varDefMap[varName]; + + if (varDef && type) { + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + var schema = context.getSchema(); + var varType = typeFromAST(schema, varDef.type); + + if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) { + context.reportError(new GraphQLError(badVarPosMessage(varName, inspect(varType), inspect(type)), [varDef, node])); + } + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + }, + VariableDefinition: function VariableDefinition(node) { + varDefMap[node.variable.name.value] = node; + } + }; +} +/** + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. + */ + +function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { + if (isNonNullType(locationType) && !isNonNullType(varType)) { + var hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; + var hasLocationDefaultValue = locationDefaultValue !== undefined; + + if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { + return false; + } + + var nullableLocationType = locationType.ofType; + return isTypeSubTypeOf(schema, varType, nullableLocationType); + } + + return isTypeSubTypeOf(schema, varType, locationType); +} diff --git a/node_modules/graphql/validation/specifiedRules.js b/node_modules/graphql/validation/specifiedRules.js new file mode 100644 index 000000000..ba12d055c --- /dev/null +++ b/node_modules/graphql/validation/specifiedRules.js @@ -0,0 +1,111 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.specifiedSDLRules = exports.specifiedRules = void 0; + +var _ExecutableDefinitions = require("./rules/ExecutableDefinitions"); + +var _UniqueOperationNames = require("./rules/UniqueOperationNames"); + +var _LoneAnonymousOperation = require("./rules/LoneAnonymousOperation"); + +var _SingleFieldSubscriptions = require("./rules/SingleFieldSubscriptions"); + +var _KnownTypeNames = require("./rules/KnownTypeNames"); + +var _FragmentsOnCompositeTypes = require("./rules/FragmentsOnCompositeTypes"); + +var _VariablesAreInputTypes = require("./rules/VariablesAreInputTypes"); + +var _ScalarLeafs = require("./rules/ScalarLeafs"); + +var _FieldsOnCorrectType = require("./rules/FieldsOnCorrectType"); + +var _UniqueFragmentNames = require("./rules/UniqueFragmentNames"); + +var _KnownFragmentNames = require("./rules/KnownFragmentNames"); + +var _NoUnusedFragments = require("./rules/NoUnusedFragments"); + +var _PossibleFragmentSpreads = require("./rules/PossibleFragmentSpreads"); + +var _NoFragmentCycles = require("./rules/NoFragmentCycles"); + +var _UniqueVariableNames = require("./rules/UniqueVariableNames"); + +var _NoUndefinedVariables = require("./rules/NoUndefinedVariables"); + +var _NoUnusedVariables = require("./rules/NoUnusedVariables"); + +var _KnownDirectives = require("./rules/KnownDirectives"); + +var _UniqueDirectivesPerLocation = require("./rules/UniqueDirectivesPerLocation"); + +var _KnownArgumentNames = require("./rules/KnownArgumentNames"); + +var _UniqueArgumentNames = require("./rules/UniqueArgumentNames"); + +var _ValuesOfCorrectType = require("./rules/ValuesOfCorrectType"); + +var _ProvidedRequiredArguments = require("./rules/ProvidedRequiredArguments"); + +var _VariablesInAllowedPosition = require("./rules/VariablesInAllowedPosition"); + +var _OverlappingFieldsCanBeMerged = require("./rules/OverlappingFieldsCanBeMerged"); + +var _UniqueInputFieldNames = require("./rules/UniqueInputFieldNames"); + +var _LoneSchemaDefinition = require("./rules/LoneSchemaDefinition"); + +var _UniqueOperationTypes = require("./rules/UniqueOperationTypes"); + +var _UniqueTypeNames = require("./rules/UniqueTypeNames"); + +var _UniqueEnumValueNames = require("./rules/UniqueEnumValueNames"); + +var _UniqueFieldDefinitionNames = require("./rules/UniqueFieldDefinitionNames"); + +var _UniqueDirectiveNames = require("./rules/UniqueDirectiveNames"); + +var _PossibleTypeExtensions = require("./rules/PossibleTypeExtensions"); + +// Spec Section: "Executable Definitions" +// Spec Section: "Operation Name Uniqueness" +// Spec Section: "Lone Anonymous Operation" +// Spec Section: "Subscriptions with Single Root Field" +// Spec Section: "Fragment Spread Type Existence" +// Spec Section: "Fragments on Composite Types" +// Spec Section: "Variables are Input Types" +// Spec Section: "Leaf Field Selections" +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +// Spec Section: "Fragment Name Uniqueness" +// Spec Section: "Fragment spread target defined" +// Spec Section: "Fragments must be used" +// Spec Section: "Fragment spread is possible" +// Spec Section: "Fragments must not form cycles" +// Spec Section: "Variable Uniqueness" +// Spec Section: "All Variable Used Defined" +// Spec Section: "All Variables Used" +// Spec Section: "Directives Are Defined" +// Spec Section: "Directives Are Unique Per Location" +// Spec Section: "Argument Names" +// Spec Section: "Argument Uniqueness" +// Spec Section: "Value Type Correctness" +// Spec Section: "Argument Optionality" +// Spec Section: "All Variable Usages Are Allowed" +// Spec Section: "Field Selection Merging" +// Spec Section: "Input Object Field Uniqueness" + +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ +var specifiedRules = Object.freeze([_ExecutableDefinitions.ExecutableDefinitions, _UniqueOperationNames.UniqueOperationNames, _LoneAnonymousOperation.LoneAnonymousOperation, _SingleFieldSubscriptions.SingleFieldSubscriptions, _KnownTypeNames.KnownTypeNames, _FragmentsOnCompositeTypes.FragmentsOnCompositeTypes, _VariablesAreInputTypes.VariablesAreInputTypes, _ScalarLeafs.ScalarLeafs, _FieldsOnCorrectType.FieldsOnCorrectType, _UniqueFragmentNames.UniqueFragmentNames, _KnownFragmentNames.KnownFragmentNames, _NoUnusedFragments.NoUnusedFragments, _PossibleFragmentSpreads.PossibleFragmentSpreads, _NoFragmentCycles.NoFragmentCycles, _UniqueVariableNames.UniqueVariableNames, _NoUndefinedVariables.NoUndefinedVariables, _NoUnusedVariables.NoUnusedVariables, _KnownDirectives.KnownDirectives, _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation, _KnownArgumentNames.KnownArgumentNames, _UniqueArgumentNames.UniqueArgumentNames, _ValuesOfCorrectType.ValuesOfCorrectType, _ProvidedRequiredArguments.ProvidedRequiredArguments, _VariablesInAllowedPosition.VariablesInAllowedPosition, _OverlappingFieldsCanBeMerged.OverlappingFieldsCanBeMerged, _UniqueInputFieldNames.UniqueInputFieldNames]); +exports.specifiedRules = specifiedRules; +// @internal +var specifiedSDLRules = Object.freeze([_LoneSchemaDefinition.LoneSchemaDefinition, _UniqueOperationTypes.UniqueOperationTypes, _UniqueTypeNames.UniqueTypeNames, _UniqueEnumValueNames.UniqueEnumValueNames, _UniqueFieldDefinitionNames.UniqueFieldDefinitionNames, _UniqueDirectiveNames.UniqueDirectiveNames, _KnownTypeNames.KnownTypeNames, _KnownDirectives.KnownDirectives, _UniqueDirectivesPerLocation.UniqueDirectivesPerLocation, _PossibleTypeExtensions.PossibleTypeExtensions, _KnownArgumentNames.KnownArgumentNamesOnDirectives, _UniqueArgumentNames.UniqueArgumentNames, _UniqueInputFieldNames.UniqueInputFieldNames, _ProvidedRequiredArguments.ProvidedRequiredArgumentsOnDirectives]); +exports.specifiedSDLRules = specifiedSDLRules; diff --git a/node_modules/graphql/validation/specifiedRules.js.flow b/node_modules/graphql/validation/specifiedRules.js.flow new file mode 100644 index 000000000..1d0c48788 --- /dev/null +++ b/node_modules/graphql/validation/specifiedRules.js.flow @@ -0,0 +1,146 @@ +// @flow strict + +// Spec Section: "Executable Definitions" +import { ExecutableDefinitions } from './rules/ExecutableDefinitions'; + +// Spec Section: "Operation Name Uniqueness" +import { UniqueOperationNames } from './rules/UniqueOperationNames'; + +// Spec Section: "Lone Anonymous Operation" +import { LoneAnonymousOperation } from './rules/LoneAnonymousOperation'; + +// Spec Section: "Subscriptions with Single Root Field" +import { SingleFieldSubscriptions } from './rules/SingleFieldSubscriptions'; + +// Spec Section: "Fragment Spread Type Existence" +import { KnownTypeNames } from './rules/KnownTypeNames'; + +// Spec Section: "Fragments on Composite Types" +import { FragmentsOnCompositeTypes } from './rules/FragmentsOnCompositeTypes'; + +// Spec Section: "Variables are Input Types" +import { VariablesAreInputTypes } from './rules/VariablesAreInputTypes'; + +// Spec Section: "Leaf Field Selections" +import { ScalarLeafs } from './rules/ScalarLeafs'; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +import { FieldsOnCorrectType } from './rules/FieldsOnCorrectType'; + +// Spec Section: "Fragment Name Uniqueness" +import { UniqueFragmentNames } from './rules/UniqueFragmentNames'; + +// Spec Section: "Fragment spread target defined" +import { KnownFragmentNames } from './rules/KnownFragmentNames'; + +// Spec Section: "Fragments must be used" +import { NoUnusedFragments } from './rules/NoUnusedFragments'; + +// Spec Section: "Fragment spread is possible" +import { PossibleFragmentSpreads } from './rules/PossibleFragmentSpreads'; + +// Spec Section: "Fragments must not form cycles" +import { NoFragmentCycles } from './rules/NoFragmentCycles'; + +// Spec Section: "Variable Uniqueness" +import { UniqueVariableNames } from './rules/UniqueVariableNames'; + +// Spec Section: "All Variable Used Defined" +import { NoUndefinedVariables } from './rules/NoUndefinedVariables'; + +// Spec Section: "All Variables Used" +import { NoUnusedVariables } from './rules/NoUnusedVariables'; + +// Spec Section: "Directives Are Defined" +import { KnownDirectives } from './rules/KnownDirectives'; + +// Spec Section: "Directives Are Unique Per Location" +import { UniqueDirectivesPerLocation } from './rules/UniqueDirectivesPerLocation'; + +// Spec Section: "Argument Names" +import { + KnownArgumentNames, + KnownArgumentNamesOnDirectives, // @internal +} from './rules/KnownArgumentNames'; + +// Spec Section: "Argument Uniqueness" +import { UniqueArgumentNames } from './rules/UniqueArgumentNames'; + +// Spec Section: "Value Type Correctness" +import { ValuesOfCorrectType } from './rules/ValuesOfCorrectType'; + +// Spec Section: "Argument Optionality" +import { + ProvidedRequiredArguments, + ProvidedRequiredArgumentsOnDirectives, // @internal +} from './rules/ProvidedRequiredArguments'; + +// Spec Section: "All Variable Usages Are Allowed" +import { VariablesInAllowedPosition } from './rules/VariablesInAllowedPosition'; + +// Spec Section: "Field Selection Merging" +import { OverlappingFieldsCanBeMerged } from './rules/OverlappingFieldsCanBeMerged'; + +// Spec Section: "Input Object Field Uniqueness" +import { UniqueInputFieldNames } from './rules/UniqueInputFieldNames'; + +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ +export const specifiedRules = Object.freeze([ + ExecutableDefinitions, + UniqueOperationNames, + LoneAnonymousOperation, + SingleFieldSubscriptions, + KnownTypeNames, + FragmentsOnCompositeTypes, + VariablesAreInputTypes, + ScalarLeafs, + FieldsOnCorrectType, + UniqueFragmentNames, + KnownFragmentNames, + NoUnusedFragments, + PossibleFragmentSpreads, + NoFragmentCycles, + UniqueVariableNames, + NoUndefinedVariables, + NoUnusedVariables, + KnownDirectives, + UniqueDirectivesPerLocation, + KnownArgumentNames, + UniqueArgumentNames, + ValuesOfCorrectType, + ProvidedRequiredArguments, + VariablesInAllowedPosition, + OverlappingFieldsCanBeMerged, + UniqueInputFieldNames, +]); + +import { LoneSchemaDefinition } from './rules/LoneSchemaDefinition'; +import { UniqueOperationTypes } from './rules/UniqueOperationTypes'; +import { UniqueTypeNames } from './rules/UniqueTypeNames'; +import { UniqueEnumValueNames } from './rules/UniqueEnumValueNames'; +import { UniqueFieldDefinitionNames } from './rules/UniqueFieldDefinitionNames'; +import { UniqueDirectiveNames } from './rules/UniqueDirectiveNames'; +import { PossibleTypeExtensions } from './rules/PossibleTypeExtensions'; + +// @internal +export const specifiedSDLRules = Object.freeze([ + LoneSchemaDefinition, + UniqueOperationTypes, + UniqueTypeNames, + UniqueEnumValueNames, + UniqueFieldDefinitionNames, + UniqueDirectiveNames, + KnownTypeNames, + KnownDirectives, + UniqueDirectivesPerLocation, + PossibleTypeExtensions, + KnownArgumentNamesOnDirectives, + UniqueArgumentNames, + UniqueInputFieldNames, + ProvidedRequiredArgumentsOnDirectives, +]); diff --git a/node_modules/graphql/validation/specifiedRules.mjs b/node_modules/graphql/validation/specifiedRules.mjs new file mode 100644 index 000000000..0c32da050 --- /dev/null +++ b/node_modules/graphql/validation/specifiedRules.mjs @@ -0,0 +1,71 @@ +// Spec Section: "Executable Definitions" +import { ExecutableDefinitions } from './rules/ExecutableDefinitions'; // Spec Section: "Operation Name Uniqueness" + +import { UniqueOperationNames } from './rules/UniqueOperationNames'; // Spec Section: "Lone Anonymous Operation" + +import { LoneAnonymousOperation } from './rules/LoneAnonymousOperation'; // Spec Section: "Subscriptions with Single Root Field" + +import { SingleFieldSubscriptions } from './rules/SingleFieldSubscriptions'; // Spec Section: "Fragment Spread Type Existence" + +import { KnownTypeNames } from './rules/KnownTypeNames'; // Spec Section: "Fragments on Composite Types" + +import { FragmentsOnCompositeTypes } from './rules/FragmentsOnCompositeTypes'; // Spec Section: "Variables are Input Types" + +import { VariablesAreInputTypes } from './rules/VariablesAreInputTypes'; // Spec Section: "Leaf Field Selections" + +import { ScalarLeafs } from './rules/ScalarLeafs'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" + +import { FieldsOnCorrectType } from './rules/FieldsOnCorrectType'; // Spec Section: "Fragment Name Uniqueness" + +import { UniqueFragmentNames } from './rules/UniqueFragmentNames'; // Spec Section: "Fragment spread target defined" + +import { KnownFragmentNames } from './rules/KnownFragmentNames'; // Spec Section: "Fragments must be used" + +import { NoUnusedFragments } from './rules/NoUnusedFragments'; // Spec Section: "Fragment spread is possible" + +import { PossibleFragmentSpreads } from './rules/PossibleFragmentSpreads'; // Spec Section: "Fragments must not form cycles" + +import { NoFragmentCycles } from './rules/NoFragmentCycles'; // Spec Section: "Variable Uniqueness" + +import { UniqueVariableNames } from './rules/UniqueVariableNames'; // Spec Section: "All Variable Used Defined" + +import { NoUndefinedVariables } from './rules/NoUndefinedVariables'; // Spec Section: "All Variables Used" + +import { NoUnusedVariables } from './rules/NoUnusedVariables'; // Spec Section: "Directives Are Defined" + +import { KnownDirectives } from './rules/KnownDirectives'; // Spec Section: "Directives Are Unique Per Location" + +import { UniqueDirectivesPerLocation } from './rules/UniqueDirectivesPerLocation'; // Spec Section: "Argument Names" + +import { KnownArgumentNames, KnownArgumentNamesOnDirectives } from // @internal +'./rules/KnownArgumentNames'; // Spec Section: "Argument Uniqueness" + +import { UniqueArgumentNames } from './rules/UniqueArgumentNames'; // Spec Section: "Value Type Correctness" + +import { ValuesOfCorrectType } from './rules/ValuesOfCorrectType'; // Spec Section: "Argument Optionality" + +import { ProvidedRequiredArguments, ProvidedRequiredArgumentsOnDirectives } from // @internal +'./rules/ProvidedRequiredArguments'; // Spec Section: "All Variable Usages Are Allowed" + +import { VariablesInAllowedPosition } from './rules/VariablesInAllowedPosition'; // Spec Section: "Field Selection Merging" + +import { OverlappingFieldsCanBeMerged } from './rules/OverlappingFieldsCanBeMerged'; // Spec Section: "Input Object Field Uniqueness" + +import { UniqueInputFieldNames } from './rules/UniqueInputFieldNames'; +/** + * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. + */ + +export var specifiedRules = Object.freeze([ExecutableDefinitions, UniqueOperationNames, LoneAnonymousOperation, SingleFieldSubscriptions, KnownTypeNames, FragmentsOnCompositeTypes, VariablesAreInputTypes, ScalarLeafs, FieldsOnCorrectType, UniqueFragmentNames, KnownFragmentNames, NoUnusedFragments, PossibleFragmentSpreads, NoFragmentCycles, UniqueVariableNames, NoUndefinedVariables, NoUnusedVariables, KnownDirectives, UniqueDirectivesPerLocation, KnownArgumentNames, UniqueArgumentNames, ValuesOfCorrectType, ProvidedRequiredArguments, VariablesInAllowedPosition, OverlappingFieldsCanBeMerged, UniqueInputFieldNames]); +import { LoneSchemaDefinition } from './rules/LoneSchemaDefinition'; +import { UniqueOperationTypes } from './rules/UniqueOperationTypes'; +import { UniqueTypeNames } from './rules/UniqueTypeNames'; +import { UniqueEnumValueNames } from './rules/UniqueEnumValueNames'; +import { UniqueFieldDefinitionNames } from './rules/UniqueFieldDefinitionNames'; +import { UniqueDirectiveNames } from './rules/UniqueDirectiveNames'; +import { PossibleTypeExtensions } from './rules/PossibleTypeExtensions'; // @internal + +export var specifiedSDLRules = Object.freeze([LoneSchemaDefinition, UniqueOperationTypes, UniqueTypeNames, UniqueEnumValueNames, UniqueFieldDefinitionNames, UniqueDirectiveNames, KnownTypeNames, KnownDirectives, UniqueDirectivesPerLocation, PossibleTypeExtensions, KnownArgumentNamesOnDirectives, UniqueArgumentNames, UniqueInputFieldNames, ProvidedRequiredArgumentsOnDirectives]); diff --git a/node_modules/graphql/validation/validate.js b/node_modules/graphql/validation/validate.js new file mode 100644 index 000000000..9cd9434fe --- /dev/null +++ b/node_modules/graphql/validation/validate.js @@ -0,0 +1,101 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.validateSDL = validateSDL; +exports.assertValidSDL = assertValidSDL; +exports.assertValidSDLExtension = assertValidSDLExtension; + +var _invariant = _interopRequireDefault(require("../jsutils/invariant")); + +var _visitor = require("../language/visitor"); + +var _validate = require("../type/validate"); + +var _TypeInfo = require("../utilities/TypeInfo"); + +var _specifiedRules = require("./specifiedRules"); + +var _ValidationContext = require("./ValidationContext"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rules is a function which returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. + */ +function validate(schema, documentAST) { + var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _specifiedRules.specifiedRules; + var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new _TypeInfo.TypeInfo(schema); + !documentAST ? (0, _invariant.default)(0, 'Must provide document') : void 0; // If the schema used for validation is invalid, throw an error. + + (0, _validate.assertValidSchema)(schema); + var context = new _ValidationContext.ValidationContext(schema, documentAST, typeInfo); // This uses a specialized visitor which runs multiple visitors in parallel, + // while maintaining the visitor skip and break API. + + var visitor = (0, _visitor.visitInParallel)(rules.map(function (rule) { + return rule(context); + })); // Visit the whole document with each instance of all provided rules. + + (0, _visitor.visit)(documentAST, (0, _visitor.visitWithTypeInfo)(typeInfo, visitor)); + return context.getErrors(); +} // @internal + + +function validateSDL(documentAST, schemaToExtend) { + var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _specifiedRules.specifiedSDLRules; + var context = new _ValidationContext.SDLValidationContext(documentAST, schemaToExtend); + var visitors = rules.map(function (rule) { + return rule(context); + }); + (0, _visitor.visit)(documentAST, (0, _visitor.visitInParallel)(visitors)); + return context.getErrors(); +} +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ + + +function assertValidSDL(documentAST) { + var errors = validateSDL(documentAST); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ + + +function assertValidSDLExtension(documentAST, schema) { + var errors = validateSDL(documentAST, schema); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} diff --git a/node_modules/graphql/validation/validate.js.flow b/node_modules/graphql/validation/validate.js.flow new file mode 100644 index 000000000..8df811a4b --- /dev/null +++ b/node_modules/graphql/validation/validate.js.flow @@ -0,0 +1,92 @@ +// @flow strict + +import invariant from '../jsutils/invariant'; +import { type GraphQLError } from '../error/GraphQLError'; +import { visit, visitInParallel, visitWithTypeInfo } from '../language/visitor'; +import { type DocumentNode } from '../language/ast'; +import { type GraphQLSchema } from '../type/schema'; +import { assertValidSchema } from '../type/validate'; +import { TypeInfo } from '../utilities/TypeInfo'; +import { specifiedRules, specifiedSDLRules } from './specifiedRules'; +import { + type SDLValidationRule, + type ValidationRule, + SDLValidationContext, + ValidationContext, +} from './ValidationContext'; + +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rules is a function which returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. + */ +export function validate( + schema: GraphQLSchema, + documentAST: DocumentNode, + rules?: $ReadOnlyArray = specifiedRules, + typeInfo?: TypeInfo = new TypeInfo(schema), +): $ReadOnlyArray { + invariant(documentAST, 'Must provide document'); + // If the schema used for validation is invalid, throw an error. + assertValidSchema(schema); + + const context = new ValidationContext(schema, documentAST, typeInfo); + // This uses a specialized visitor which runs multiple visitors in parallel, + // while maintaining the visitor skip and break API. + const visitor = visitInParallel(rules.map(rule => rule(context))); + // Visit the whole document with each instance of all provided rules. + visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); + return context.getErrors(); +} + +// @internal +export function validateSDL( + documentAST: DocumentNode, + schemaToExtend?: ?GraphQLSchema, + rules?: $ReadOnlyArray = specifiedSDLRules, +): $ReadOnlyArray { + const context = new SDLValidationContext(documentAST, schemaToExtend); + const visitors = rules.map(rule => rule(context)); + visit(documentAST, visitInParallel(visitors)); + return context.getErrors(); +} + +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export function assertValidSDL(documentAST: DocumentNode): void { + const errors = validateSDL(documentAST); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); + } +} + +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ +export function assertValidSDLExtension( + documentAST: DocumentNode, + schema: GraphQLSchema, +): void { + const errors = validateSDL(documentAST, schema); + if (errors.length !== 0) { + throw new Error(errors.map(error => error.message).join('\n\n')); + } +} diff --git a/node_modules/graphql/validation/validate.mjs b/node_modules/graphql/validation/validate.mjs new file mode 100644 index 000000000..c22dfa1a2 --- /dev/null +++ b/node_modules/graphql/validation/validate.mjs @@ -0,0 +1,81 @@ +import invariant from '../jsutils/invariant'; +import { visit, visitInParallel, visitWithTypeInfo } from '../language/visitor'; +import { assertValidSchema } from '../type/validate'; +import { TypeInfo } from '../utilities/TypeInfo'; +import { specifiedRules, specifiedSDLRules } from './specifiedRules'; +import { SDLValidationContext, ValidationContext } from './ValidationContext'; +/** + * Implements the "Validation" section of the spec. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the document is valid. + * + * A list of specific validation rules may be provided. If not provided, the + * default list of rules defined by the GraphQL specification will be used. + * + * Each validation rules is a function which returns a visitor + * (see the language/visitor API). Visitor methods are expected to return + * GraphQLErrors, or Arrays of GraphQLErrors when invalid. + * + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. + */ + +export function validate(schema, documentAST) { + var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedRules; + var typeInfo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new TypeInfo(schema); + !documentAST ? invariant(0, 'Must provide document') : void 0; // If the schema used for validation is invalid, throw an error. + + assertValidSchema(schema); + var context = new ValidationContext(schema, documentAST, typeInfo); // This uses a specialized visitor which runs multiple visitors in parallel, + // while maintaining the visitor skip and break API. + + var visitor = visitInParallel(rules.map(function (rule) { + return rule(context); + })); // Visit the whole document with each instance of all provided rules. + + visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); + return context.getErrors(); +} // @internal + +export function validateSDL(documentAST, schemaToExtend) { + var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedSDLRules; + var context = new SDLValidationContext(documentAST, schemaToExtend); + var visitors = rules.map(function (rule) { + return rule(context); + }); + visit(documentAST, visitInParallel(visitors)); + return context.getErrors(); +} +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ + +export function assertValidSDL(documentAST) { + var errors = validateSDL(documentAST); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} +/** + * Utility function which asserts a SDL document is valid by throwing an error + * if it is invalid. + * + * @internal + */ + +export function assertValidSDLExtension(documentAST, schema) { + var errors = validateSDL(documentAST, schema); + + if (errors.length !== 0) { + throw new Error(errors.map(function (error) { + return error.message; + }).join('\n\n')); + } +} diff --git a/node_modules/graphql/version.js b/node_modules/graphql/version.js new file mode 100644 index 000000000..941680310 --- /dev/null +++ b/node_modules/graphql/version.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.versionInfo = exports.version = void 0; + +/** + * Note: This file is autogenerated using "resources/gen-version.js" script and + * automatically updated by "yarn version" command. + */ + +/** + * A string containing the version of the GraphQL.js library + */ +var version = '14.4.2'; +/** + * An object containing the components of the GraphQL.js version string + */ + +exports.version = version; +var versionInfo = Object.freeze({ + major: 14, + minor: 4, + patch: 2, + preReleaseTag: null +}); +exports.versionInfo = versionInfo; diff --git a/node_modules/graphql/version.js.flow b/node_modules/graphql/version.js.flow new file mode 100644 index 000000000..e399104bb --- /dev/null +++ b/node_modules/graphql/version.js.flow @@ -0,0 +1,21 @@ +// @flow strict + +/** + * Note: This file is autogenerated using "resources/gen-version.js" script and + * automatically updated by "yarn version" command. + */ + +/** + * A string containing the version of the GraphQL.js library + */ +export const version = '14.4.2'; + +/** + * An object containing the components of the GraphQL.js version string + */ +export const versionInfo = Object.freeze({ + major: 14, + minor: 4, + patch: 2, + preReleaseTag: null, +}); diff --git a/node_modules/graphql/version.mjs b/node_modules/graphql/version.mjs new file mode 100644 index 000000000..f6ea0c5ab --- /dev/null +++ b/node_modules/graphql/version.mjs @@ -0,0 +1,19 @@ +/** + * Note: This file is autogenerated using "resources/gen-version.js" script and + * automatically updated by "yarn version" command. + */ + +/** + * A string containing the version of the GraphQL.js library + */ +export var version = '14.4.2'; +/** + * An object containing the components of the GraphQL.js version string + */ + +export var versionInfo = Object.freeze({ + major: 14, + minor: 4, + patch: 2, + preReleaseTag: null +}); diff --git a/node_modules/hoist-non-react-statics/CHANGELOG.md b/node_modules/hoist-non-react-statics/CHANGELOG.md new file mode 100644 index 000000000..ae4c8940a --- /dev/null +++ b/node_modules/hoist-non-react-statics/CHANGELOG.md @@ -0,0 +1,30 @@ +# 3.3.0 (January 23, 2019) +- Prevent hoisting of React.memo statics (#73) + +# 3.2.1 (December 3, 2018) +- Fixed `defaultProps`, `displayName` and `propTypes` being hoisted from `React.forwardRef` to `React.forwardRef`. ([#71]) + +# 3.2.0 (November 26, 2018) +- Added support for `getDerivedStateFromError`. ([#68]) +- Added support for React versions less than 0.14. ([#69]) + +# 3.1.0 (October 30, 2018) +- Added support for `contextType`. ([#62]) +- Reduced bundle size. ([e89c7a6]) +- Removed TypeScript definitions. ([#61]) + +# 3.0.1 (July 28, 2018) +- Fixed prop-types warnings. ([e0846fe]) + +# 3.0.0 (July 27, 2018) +- Dropped support for React versions less than 0.14. ([#55]) +- Added support for `React.forwardRef` components. ([#55]) + +[#55]: https://github.com/mridgway/hoist-non-react-statics/pull/55 +[#61]: https://github.com/mridgway/hoist-non-react-statics/pull/61 +[#62]: https://github.com/mridgway/hoist-non-react-statics/pull/62 +[#68]: https://github.com/mridgway/hoist-non-react-statics/pull/68 +[#69]: https://github.com/mridgway/hoist-non-react-statics/pull/69 +[#71]: https://github.com/mridgway/hoist-non-react-statics/pull/71 +[e0846fe]: https://github.com/mridgway/hoist-non-react-statics/commit/e0846feefbad8b34d300de9966ffd607aacb81a3 +[e89c7a6]: https://github.com/mridgway/hoist-non-react-statics/commit/e89c7a6168edc19eeadb2d149e600b888e8b0446 diff --git a/node_modules/hoist-non-react-statics/LICENSE.md b/node_modules/hoist-non-react-statics/LICENSE.md new file mode 100644 index 000000000..2464f59ec --- /dev/null +++ b/node_modules/hoist-non-react-statics/LICENSE.md @@ -0,0 +1,29 @@ +Software License Agreement (BSD License) +======================================== + +Copyright (c) 2015, Yahoo! Inc. All rights reserved. +---------------------------------------------------- + +Redistribution and use of this software in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Yahoo! Inc. nor the names of YUI's contributors may be + used to endorse or promote products derived from this software without + specific prior written permission of Yahoo! Inc. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/hoist-non-react-statics/README.md b/node_modules/hoist-non-react-statics/README.md new file mode 100644 index 000000000..24ea68871 --- /dev/null +++ b/node_modules/hoist-non-react-statics/README.md @@ -0,0 +1,55 @@ +# hoist-non-react-statics + +[![NPM version](https://badge.fury.io/js/hoist-non-react-statics.svg)](http://badge.fury.io/js/hoist-non-react-statics) +[![Build Status](https://img.shields.io/travis/mridgway/hoist-non-react-statics.svg)](https://travis-ci.org/mridgway/hoist-non-react-statics) +[![Coverage Status](https://img.shields.io/coveralls/mridgway/hoist-non-react-statics.svg)](https://coveralls.io/r/mridgway/hoist-non-react-statics?branch=master) +[![Dependency Status](https://img.shields.io/david/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics) +[![devDependency Status](https://img.shields.io/david/dev/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics#info=devDependencies) + +Copies non-react specific statics from a child component to a parent component. +Similar to `Object.assign`, but with React static keywords blacklisted from +being overridden. + +```bash +$ npm install --save hoist-non-react-statics +``` + +## Usage + +```js +import hoistNonReactStatics from 'hoist-non-react-statics'; + +hoistNonReactStatics(targetComponent, sourceComponent); +``` + +If you have specific statics that you don't want to be hoisted, you can also pass a third parameter to exclude them: + +```js +hoistNonReactStatics(targetComponent, sourceComponent, { myStatic: true, myOtherStatic: true }); +``` + +## What does this module do? + +See this [explanation](https://facebook.github.io/react/docs/higher-order-components.html#static-methods-must-be-copied-over) from the React docs. + +## Compatible React Versions + +Please use latest 3.x. Versions prior to 3.x will not support ForwardRefs. + +| hoist-non-react-statics Version | Compatible React Version | +|--------------------------|-------------------------------| +| 3.x | 0.13-16.x With ForwardRef Support | +| 2.x | 0.13-16.x Without ForwardRef Support | +| 1.x | 0.13-16.2 | + +## Browser Support + +This package uses `Object.defineProperty` which has a broken implementation in IE8. In order to use this package in IE8, you will need a polyfill that fixes this method. + +## License +This software is free to use under the Yahoo Inc. BSD license. +See the [LICENSE file][] for license text and copyright information. + +[LICENSE file]: https://github.com/mridgway/hoist-non-react-statics/blob/master/LICENSE.md + +Third-party open source code used are listed in our [package.json file]( https://github.com/mridgway/hoist-non-react-statics/blob/master/package.json). diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js new file mode 100644 index 000000000..145e2ac0d --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js @@ -0,0 +1,103 @@ +'use strict'; + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var ReactIs = require('react-is'); +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; + +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; + +var TYPE_STATICS = {}; +TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS; + +function getStatics(component) { + if (ReactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; + +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +} + +module.exports = hoistNonReactStatics; diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js new file mode 100644 index 000000000..17cace275 --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js @@ -0,0 +1,109 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.hoistNonReactStatics = factory()); +}(this, (function () { 'use strict'; + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var ReactIs = require('react-is'); +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; + +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; + +var TYPE_STATICS = {}; +TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS; + +function getStatics(component) { + if (ReactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; + +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +} + +return hoistNonReactStatics; + +}))); diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js new file mode 100644 index 000000000..748841e0c --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.hoistNonReactStatics=t()}(this,function(){"use strict";var t=require("react-is"),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},p={};function d(e){return t.isMemo(e)?o:p[e.$$typeof]||r}p[t.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var u=Object.defineProperty,l=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,O=Object.getPrototypeOf,P=Object.prototype;return function e(t,r,o){if("string"!=typeof r){if(P){var p=O(r);p&&p!==P&&e(t,p,o)}var n=l(r);m&&(n=n.concat(m(r)));for(var a=d(t),i=d(r),s=0;s", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + }, + "devDependencies": { + "babel": "^6.23.0", + "babel-cli": "^6.24.1", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-react-jsx-source": "^6.22.0", + "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.24.1", + "babel-preset-react": "^6.24.1", + "babel-register": "^6.24.1", + "chai": "^4.0.1", + "coveralls": "^2.11.1", + "create-react-class": "^15.5.3", + "eslint": "^4.13.1", + "istanbul": "^0.4.5", + "mocha": "^3.4.2", + "pre-commit": "^1.0.7", + "prop-types": "^15.6.2", + "react": "^16.7.0", + "rimraf": "^2.6.2", + "rollup": "^0.52.3", + "rollup-plugin-babel": "^3.0.4", + "rollup-plugin-uglify": "^2.0.1" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "keywords": [ + "react" + ] +} diff --git a/node_modules/hoist-non-react-statics/src/index.js b/node_modules/hoist-non-react-statics/src/index.js new file mode 100644 index 000000000..3058b6f7e --- /dev/null +++ b/node_modules/hoist-non-react-statics/src/index.js @@ -0,0 +1,101 @@ +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +const ReactIs = require('react-is'); +const REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; + +const KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +const FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; + +const MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true, +} + +const TYPE_STATICS = {}; +TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS; + +function getStatics(component) { + if (ReactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +const defineProperty = Object.defineProperty; +const getOwnPropertyNames = Object.getOwnPropertyNames; +const getOwnPropertySymbols = Object.getOwnPropertySymbols; +const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +const getPrototypeOf = Object.getPrototypeOf; +const objectPrototype = Object.prototype; + +export default function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components + + if (objectPrototype) { + const inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + let keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + const targetStatics = getStatics(targetComponent); + const sourceStatics = getStatics(sourceComponent); + + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (!KNOWN_STATICS[key] && + !(blacklist && blacklist[key]) && + !(sourceStatics && sourceStatics[key]) && + !(targetStatics && targetStatics[key]) + ) { + const descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +}; diff --git a/node_modules/iterall/LICENSE b/node_modules/iterall/LICENSE new file mode 100644 index 000000000..32653d22a --- /dev/null +++ b/node_modules/iterall/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2016 Lee Byron + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/iterall/README.md b/node_modules/iterall/README.md new file mode 100644 index 000000000..6a47da9da --- /dev/null +++ b/node_modules/iterall/README.md @@ -0,0 +1,808 @@ +# JavaScript [Iterators][] and [AsyncIterators][] for all! + +[![Build Status](https://travis-ci.org/leebyron/iterall.svg?branch=master)](https://travis-ci.org/leebyron/iterall) [![Coverage Status](https://coveralls.io/repos/github/leebyron/iterall/badge.svg?branch=master)](https://coveralls.io/github/leebyron/iterall?branch=master) ![710 bytes minified and gzipped](https://img.shields.io/badge/min%20gzip%20size-757%20B-blue.svg) + +`iterall` provides a few crucial utilities for implementing and working with +[Iterables][iterators], [Async Iterables][asynciterators] and +[Array-likes][array-like] in all JavaScript environments, even old versions of +Internet Explorer, in a tiny library weighing well under 1KB when minified +and gzipped. + +This is a library for libraries. If your library takes Arrays as input, accept +Iterables instead. If your library implements a new data-structure, make +it Iterable. + +When installed via `npm`, `iterall` comes complete with [Flow][] and +[TypeScript][] definition files. Don't want to take the dependency? Feel free to +copy code directly from this repository. + +```js +// Limited to only Arrays 😥 +if (Array.isArray(thing)) { + thing.forEach(function (item, i) { + console.log('Index: ' + i, item) + }) +} + +// Accepts all Iterables and Array-likes, in any JavaScript environment! 🎉 +var isCollection = require('iterall').isCollection +var forEach = require('iterall').forEach + +if (isCollection(thing)) { + forEach(thing, function (item, i) { + console.log('Index: ' + i, item) + }) +} + +// Accepts all AsyncIterators, in any JavaScript environment! ⏳ +var forAwaitEach = require('iterall').forAwaitEach + +forAwaitEach(thing, function (item, i) { + console.log('Index: ' + i, item) +}).then(function () { + console.log('Done') +}) +``` + +## Why use Iterators? + +For most of JavaScript's history it has provided two collection data-structures: +the `Object` and the `Array`. These collections can conceptually describe nearly +all data and so it's no suprise that libraries expecting lists of +things standardized on expecting and checking for an Array. This pattern even +resulted in the addition of a new method in ES5: [`Array.isArray()`][isarray]. + +As JavaScript applications grew in complexity, moved to the [server][nodejs] +where CPU is a constrained resource, faced new problems and implemented new +algorithms, new data-structures are often required. With options from +[linked lists][linked list] to [HAMTs][hamt] developers can use what is most +efficient and provides the right properties for their program. + +However none of these new data-structures can be used in libraries where an +`Array` is expected, which means developers are often stuck between abandoning +their favorite libraries or limiting their data-structure choices at the cost of +efficiency or usefulness. + +To enable many related data-structures to be used interchangably we need a +_[protocol][]_, and luckily for us ES2015 introduced the +[Iteration Protocols][iterators] to describe all list-like data-structures which +can be iterated. That includes not just the new-to-ES2015 [Map][] and [Set][] +collections but also existing ones like [arguments][], [NodeList][] and the +various [TypedArray][], all of which return `false` for [`Array.isArray()`][isarray] +and in ES2015 implement the [Iterator protocol][iterators]. + +While Iterators are defined in ES2015, they _do not require_ ES2015 to work +correctly. In fact, Iterators were first introduced in 2012 in [Firefox v17](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Iterator_property_and_iterator_symbol). Rather than using [`Symbol.iterator`][symbol.iterator], they used the property name `"@@iterator"` (in fact, the ECMAScript +spec still refers to well-known `Symbols` using this `@@` shorthand). By falling +back to use `"@@iterator"` when `Symbol.iterator` is not defined, Iterators can +be both safely defined and used by _any version of JavaScript_. + +Not only were Iterables defined in ES2015, they were also implemented by the +built-in data-structures including [Array][array#@@iterator]. Older JavaScript +environments do not implement `Array.prototype[@@iterator]()`, however this is +only a minor problem. JavaScript has another related and much older protocol: +[Array-like]. A value is "Array-like" if it has a numeric `length` property and +indexed access, but does not necessarily have methods like `.push()` or `.forEach()`. +Much like [`Array.from`][array.from], `iterall`'s `forEach()` and +`createIterator()` methods also accept collections which are not Iterable but +are Array-like. This means that `iterall` can be used with [Array][], +[arguments][], [NodeList][], [TypedArray][] and other Array-like collections +regardless of the JavaScript environment. + +When libraries only accept Arrays as input, they stick developers with a tough +choice: limit which data-structures can be used or limit the ability to use that +library. Accepting Iterables removes this false dichotomy, and allows libraries +to be more generally useful. There's no need to limit to ES2015 environments and +bleeding-edge browsers to accept `Iterable`. + +Only using Arrays can limit the efficiency and usefulness of your application +code, but custom data-structures can often feel like a fish out of water in +JavaScript programs, only working with code written specifically for it. +Protocols like `Iterable` helps these new data-structures work with more +libraries and built-in JavaScript behavior. There's no need to limit to ES2015 +environments and bleeding-edge browsers to implement `Iterable`. + +## Why use AsyncIterators? + +In the same way that `Iterator` provides a common interface for accessing many +different kinds of data-structures, `AsyncIterator` provides a common interface +over an asynchronous sequence of values (similar to Stream or Observable). + +Async Iterators are not yet an official part of JavaScript, however they're +a "Stage 3" proposal to be added, and browser vendors are +[working on adding support](https://bugs.chromium.org/p/v8/issues/detail?id=5855). +However, Async Iterators can be both safely defined and used today by +_any version of JavaScript_, by using the utilities in `iterall`. + +## FAQ + +> Aren't Iterables slower than Arrays? I want the highest performance possible. + +Arrays _are_ Iterables. Iterable is a protocol that Arrays adhere to in ES2015. +It's true that creating an Iterator and stepping through it can present some +overhead compared to a simple for-loop or `array.forEach`. However `iterall`'s +`forEach` will delegate directly to `array.forEach` and will use a for-loop for +Array-like objects, ensuring the best performance for Arrays while still +maintaining support for all Iterables. + +> Should my library functions also return Iterables instead of Arrays? Won't +> that be limiting? + +That could definitely be limiting if you return some generic Iterable where you +could have returned an Array, and (depending on context) I wouldn't recommend +you stop returning Arrays from functions if that's what you're doing today. +However if your functions are returning some collection data-structure that is +_not_ an Array, you should certainly consider having them implement the +Iterable protocol so they can be more widely useful. + +Here are a few examples: + +In [React][], render functions are expected to return view trees, where any +node (e.g. a `
    `) can have many children (e.g. many `
  • `). While it could +expect those children to always be represented as an Array, that would limit +React's usefulness - other data-structures couldn't be used. Instead, React +expects those children to be represented as an _Iterable_. That allows it to +continue to accept Arrays, but also accept many other data-structures. + +[Immutable.js][] implements many new kinds of data-structures (including [HAMT]) +all of which implement _Iterable_, which allows them to be used in many of +JavaScript's built-in functions, but also allows them to be used by many +libraries which accept Iterables, including React. Also, similar to +[`Array.from`][array.from], Immutable.js's constructors accept not only Arrays, +but any _Iterable_, allowing you to build any of these new data-structures from +any other data-structure. + +> Where are all the other functions like `map`, `filter`, and `reduce`? + +Those "higher order" collection functions are awesome, but they don't belong in +this library. Instead this library should be used as a basis for building such +a library (as it should be used for many other libraries). The `forEach` +function provided by `iterall` can be used as the underpinning for these. + +As an example: + +```js +function reduce (collection, reducer, initial) { + var reduced = initial + forEach(collection, function (item) { + reduced = reducer(reduced, item) + }) + return reduced +} +``` + +> How do I break out of a `forEach` or `forAwaitEach` loop early? + +While `for of` and `for await of` loops allow breaking out of a loop early with +a `break` statement, the `forEach()` and `forAwaitEach()` functions (much like +Array's `forEach`) do not support early breaking. + +Similar to the "higher order" functions described above, this library can be the +basis for this extended behavior. To support early break outs, you can use a +wrapping function supporting early breaking by throwing a `BREAK` sentinel value +from the callback and using a try/catch block to early break: + +```js +const BREAK = {} + +function forEachBreakable (collection, callback) { + try { + forEach(collection, callback) + } catch (error) { + if (error !== BREAK) { + throw error + } + } +} + +async function forAwaitEachBreakable (collection, callback) { + try { + await forAwaitEach(collection, callback) + } catch (error) { + if (error !== BREAK) { + throw error + } + } +} + +// Example usages: +forEachBreakable(obj, function (value) { + if (shouldBreakOn(value)) { + throw BREAK + } + console.log(value) +}) + +forAwaitEachBreakable(obj, async function (value) { + if (await shouldBreakOn(value)) { + throw BREAK + } + console.log(value) +}) +``` + +Note: This technique also works with the native Array `forEach` method! + + + +## API + + + +#### Table of Contents + +- [Iterable](#iterable) +- [Iterator](#iterator) +- [$$iterator](#iterator-1) +- [isIterable](#isiterable) +- [isArrayLike](#isarraylike) +- [isCollection](#iscollection) +- [getIterator](#getiterator) +- [getIteratorMethod](#getiteratormethod) +- [createIterator](#createiterator) +- [forEach](#foreach) +- [AsyncIterable](#asynciterable) +- [AsyncIterator](#asynciterator) +- [$$asyncIterator](#asynciterator-1) +- [isAsyncIterable](#isasynciterable) +- [getAsyncIterator](#getasynciterator) +- [getAsyncIteratorMethod](#getasynciteratormethod) +- [createAsyncIterator](#createasynciterator) +- [forAwaitEach](#forawaiteach) + +### Iterable + +- **See: [MDN Iteration protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)** + +[Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable) +is a _protocol_ which when implemented allows a JavaScript object to define +their iteration behavior, such as what values are looped over in a +[`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) +loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables) +implement the Iterable protocol, including `Array` and `Map`. + +While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface) +it can be utilized by any version of JavaScript. + +### Iterator + +- **See: [MDN Iteration protocols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator)** + +[Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator) +is a _protocol_ which describes a standard way to produce a sequence of +values, typically the values of the Iterable represented by this Iterator. + +While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) +it can be utilized by any version of JavaScript. + +### $$iterator + +A property name to be used as the name of an Iterable's method responsible +for producing an Iterator, referred to as `@@iterator`. Typically represents +the value `Symbol.iterator` but falls back to the string `"@@iterator"` when +`Symbol.iterator` is not defined. + +Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`, +but do not use it for accessing existing Iterables, instead use +[getIterator](#getiterator) or [isIterable](#isiterable). + +**Examples** + +```javascript +var $$iterator = require('iterall').$$iterator + +function Counter (to) { + this.to = to +} + +Counter.prototype[$$iterator] = function () { + return { + to: this.to, + num: 0, + next () { + if (this.num >= this.to) { + return { value: undefined, done: true } + } + return { value: this.num++, done: false } + } + } +} + +var counter = new Counter(3) +for (var number of counter) { + console.log(number) // 0 ... 1 ... 2 +} +``` + +### isIterable + +Returns true if the provided object implements the Iterator protocol via +either implementing a `Symbol.iterator` or `"@@iterator"` method. + +**Parameters** + +- `obj` A value which might implement the Iterable protocol. + +**Examples** + +```javascript +var isIterable = require('iterall').isIterable +isIterable([ 1, 2, 3 ]) // true +isIterable('ABC') // true +isIterable({ length: 1, 0: 'Alpha' }) // false +isIterable({ key: 'value' }) // false +isIterable(new Map()) // true +``` + +Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if Iterable. + +### isArrayLike + +Returns true if the provided object implements the Array-like protocol via +defining a positive-integer `length` property. + +**Parameters** + +- `obj` A value which might implement the Array-like protocol. + +**Examples** + +```javascript +var isArrayLike = require('iterall').isArrayLike +isArrayLike([ 1, 2, 3 ]) // true +isArrayLike('ABC') // true +isArrayLike({ length: 1, 0: 'Alpha' }) // true +isArrayLike({ key: 'value' }) // false +isArrayLike(new Map()) // false +``` + +Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if Array-like. + +### isCollection + +Returns true if the provided object is an Object (i.e. not a string literal) +and is either Iterable or Array-like. + +This may be used in place of [Array.isArray()][isarray] to determine if an +object should be iterated-over. It always excludes string literals and +includes Arrays (regardless of if it is Iterable). It also includes other +Array-like objects such as NodeList, TypedArray, and Buffer. + +**Parameters** + +- `obj` An Object value which might implement the Iterable or Array-like protocols. + +**Examples** + +```javascript +var isCollection = require('iterall').isCollection +isCollection([ 1, 2, 3 ]) // true +isCollection('ABC') // false +isCollection({ length: 1, 0: 'Alpha' }) // true +isCollection({ key: 'value' }) // false +isCollection(new Map()) // true +``` + +```javascript +var forEach = require('iterall').forEach +if (isCollection(obj)) { + forEach(obj, function (value) { + console.log(value) + }) +} +``` + +Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if Iterable or Array-like Object. + +### getIterator + +If the provided object implements the Iterator protocol, its Iterator object +is returned. Otherwise returns undefined. + +**Parameters** + +- `iterable` **[Iterable](#iterable)<T>** An Iterable object which is the source of an Iterator. + +**Examples** + +```javascript +var getIterator = require('iterall').getIterator +var iterator = getIterator([ 1, 2, 3 ]) +iterator.next() // { value: 1, done: false } +iterator.next() // { value: 2, done: false } +iterator.next() // { value: 3, done: false } +iterator.next() // { value: undefined, done: true } +``` + +Returns **[Iterator](#iterator)<T>** new Iterator instance. + +### getIteratorMethod + +If the provided object implements the Iterator protocol, the method +responsible for producing its Iterator object is returned. + +This is used in rare cases for performance tuning. This method must be called +with obj as the contextual this-argument. + +**Parameters** + +- `iterable` **[Iterable](#iterable)<T>** An Iterable object which defines an `@@iterator` method. + +**Examples** + +```javascript +var getIteratorMethod = require('iterall').getIteratorMethod +var myArray = [ 1, 2, 3 ] +var method = getIteratorMethod(myArray) +if (method) { + var iterator = method.call(myArray) +} +``` + +Returns **function (): [Iterator](#iterator)<T>** `@@iterator` method. + +### createIterator + +Similar to [getIterator](#getiterator), this method returns a new Iterator given an +Iterable. However it will also create an Iterator for a non-Iterable +Array-like collection, such as Array in a non-ES2015 environment. + +`createIterator` is complimentary to `forEach`, but allows a "pull"-based +iteration as opposed to `forEach`'s "push"-based iteration. + +`createIterator` produces an Iterator for Array-likes with the same behavior +as ArrayIteratorPrototype described in the ECMAScript specification, and +does _not_ skip over "holes". + +**Parameters** + +- `collection` **([Iterable](#iterable)<T> | {length: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)})** An Iterable or Array-like object to produce an Iterator. + +**Examples** + +```javascript +var createIterator = require('iterall').createIterator + +var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } +var iterator = createIterator(myArraylike) +iterator.next() // { value: 'Alpha', done: false } +iterator.next() // { value: 'Bravo', done: false } +iterator.next() // { value: 'Charlie', done: false } +iterator.next() // { value: undefined, done: true } +``` + +Returns **[Iterator](#iterator)<T>** new Iterator instance. + +### forEach + +Given an object which either implements the Iterable protocol or is +Array-like, iterate over it, calling the `callback` at each iteration. + +Use `forEach` where you would expect to use a `for ... of` loop in ES6. +However `forEach` adheres to the behavior of [Array#forEach][] described in +the ECMAScript specification, skipping over "holes" in Array-likes. It will +also delegate to a `forEach` method on `collection` if one is defined, +ensuring native performance for `Arrays`. + +Similar to [Array#forEach][], the `callback` function accepts three +arguments, and is provided with `thisArg` as the calling context. + +Note: providing an infinite Iterator to forEach will produce an error. + +[array#foreach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + +**Parameters** + +- `collection` **([Iterable](#iterable)<T> | {length: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)})** The Iterable or array to iterate over. +- `callback` **function (T, [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** Function to execute for each iteration, taking up to three arguments +- `thisArg` Optional. Value to use as `this` when executing `callback`. + +**Examples** + +```javascript +var forEach = require('iterall').forEach + +forEach(myIterable, function (value, index, iterable) { + console.log(value, index, iterable === myIterable) +}) +``` + +```javascript +// ES6: +for (let value of myIterable) { + console.log(value) +} + +// Any JavaScript environment: +forEach(myIterable, function (value) { + console.log(value) +}) +``` + +### AsyncIterable + +- **See: [Async Iteration Proposal](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface)** + +[AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface) +is a _protocol_ which when implemented allows a JavaScript object to define +an asynchronous iteration behavior, such as what values are looped over in +a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) +loop or `iterall`'s [forAwaitEach](#forawaiteach) function. + +While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) +it can be utilized by any version of JavaScript. + +### AsyncIterator + +- **See: [Async Iteration Proposal](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface)** + +[AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface) +is a _protocol_ which describes a standard way to produce and consume an +asynchronous sequence of values, typically the values of the +[AsyncIterable](#asynciterable) represented by this [AsyncIterator](#asynciterator). + +AsyncIterator is similar to Observable or Stream. Like an [Iterator](#iterator) it +also as a `next()` method, however instead of an IteratorResult, +calling this method returns a [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise) for a IteratorResult. + +While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) +it can be utilized by any version of JavaScript. + +### $$asyncIterator + +A property name to be used as the name of an AsyncIterable's method +responsible for producing an Iterator, referred to as `@@asyncIterator`. +Typically represents the value `Symbol.asyncIterator` but falls back to the +string `"@@asyncIterator"` when `Symbol.asyncIterator` is not defined. + +Use `$$asyncIterator` for defining new AsyncIterables instead of +`Symbol.asyncIterator`, but do not use it for accessing existing Iterables, +instead use [getAsyncIterator](#getasynciterator) or [isAsyncIterable](#isasynciterable). + +**Examples** + +```javascript +var $$asyncIterator = require('iterall').$$asyncIterator + +function Chirper (to) { + this.to = to +} + +Chirper.prototype[$$asyncIterator] = function () { + return { + to: this.to, + num: 0, + next () { + return new Promise(resolve => { + if (this.num >= this.to) { + resolve({ value: undefined, done: true }) + } else { + setTimeout(() => { + resolve({ value: this.num++, done: false }) + }, 1000) + } + }) + } + } +} + +var chirper = new Chirper(3) +for await (var number of chirper) { + console.log(number) // 0 ...wait... 1 ...wait... 2 +} +``` + +### isAsyncIterable + +Returns true if the provided object implements the AsyncIterator protocol via +either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. + +**Parameters** + +- `obj` A value which might implement the AsyncIterable protocol. + +**Examples** + +```javascript +var isAsyncIterable = require('iterall').isAsyncIterable +isAsyncIterable(myStream) // true +isAsyncIterable('ABC') // false +``` + +Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if AsyncIterable. + +### getAsyncIterator + +If the provided object implements the AsyncIterator protocol, its +AsyncIterator object is returned. Otherwise returns undefined. + +**Parameters** + +- `asyncIterable` **[AsyncIterable](#asynciterable)<T>** An AsyncIterable object which is the source of an AsyncIterator. + +**Examples** + +```javascript +var getAsyncIterator = require('iterall').getAsyncIterator +var asyncIterator = getAsyncIterator(myStream) +asyncIterator.next().then(console.log) // { value: 1, done: false } +asyncIterator.next().then(console.log) // { value: 2, done: false } +asyncIterator.next().then(console.log) // { value: 3, done: false } +asyncIterator.next().then(console.log) // { value: undefined, done: true } +``` + +Returns **[AsyncIterator](#asynciterator)<T>** new AsyncIterator instance. + +### getAsyncIteratorMethod + +If the provided object implements the AsyncIterator protocol, the method +responsible for producing its AsyncIterator object is returned. + +This is used in rare cases for performance tuning. This method must be called +with obj as the contextual this-argument. + +**Parameters** + +- `asyncIterable` **[AsyncIterable](#asynciterable)<T>** An AsyncIterable object which defines an `@@asyncIterator` method. + +**Examples** + +```javascript +var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod +var method = getAsyncIteratorMethod(myStream) +if (method) { + var asyncIterator = method.call(myStream) +} +``` + +Returns **function (): [AsyncIterator](#asynciterator)<T>** `@@asyncIterator` method. + +### createAsyncIterator + +Similar to [getAsyncIterator](#getasynciterator), this method returns a new AsyncIterator +given an AsyncIterable. However it will also create an AsyncIterator for a +non-async Iterable as well as non-Iterable Array-like collection, such as +Array in a pre-ES2015 environment. + +`createAsyncIterator` is complimentary to `forAwaitEach`, but allows a +buffering "pull"-based iteration as opposed to `forAwaitEach`'s +"push"-based iteration. + +`createAsyncIterator` produces an AsyncIterator for non-async Iterables as +described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects). + +> Note: Creating `AsyncIterator`s requires the existence of `Promise`. +> While `Promise` has been available in modern browsers for a number of +> years, legacy browsers (like IE 11) may require a polyfill. + +**Parameters** + +- `source` **([AsyncIterable](#asynciterable)<T> | [Iterable](#iterable)<T> | {length: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)})** An AsyncIterable, Iterable, or Array-like object to produce an Iterator. + +**Examples** + +```javascript +var createAsyncIterator = require('iterall').createAsyncIterator + +var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } +var iterator = createAsyncIterator(myArraylike) +iterator.next().then(console.log) // { value: 'Alpha', done: false } +iterator.next().then(console.log) // { value: 'Bravo', done: false } +iterator.next().then(console.log) // { value: 'Charlie', done: false } +iterator.next().then(console.log) // { value: undefined, done: true } +``` + +Returns **[AsyncIterator](#asynciterator)<T>** new AsyncIterator instance. + +### forAwaitEach + +Given an object which either implements the AsyncIterable protocol or is +Array-like, iterate over it, calling the `callback` at each iteration. + +Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop. + +Similar to [Array#forEach][], the `callback` function accepts three +arguments, and is provided with `thisArg` as the calling context. + +> Note: Using `forAwaitEach` requires the existence of `Promise`. +> While `Promise` has been available in modern browsers for a number of +> years, legacy browsers (like IE 11) may require a polyfill. + +**Parameters** + +- `source` **([AsyncIterable](#asynciterable)<T> | [Iterable](#iterable)<([Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<T> | T)> | {length: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)})** The AsyncIterable or array to iterate over. +- `callback` **function (T, [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** Function to execute for each iteration, taking up to three arguments +- `thisArg` Optional. Value to use as `this` when executing `callback`. + +**Examples** + +```javascript +var forAwaitEach = require('iterall').forAwaitEach + +forAwaitEach(myIterable, function (value, index, iterable) { + console.log(value, index, iterable === myIterable) +}) +``` + +```javascript +// ES2017: +for await (let value of myAsyncIterable) { + console.log(await doSomethingAsync(value)) +} +console.log('done') + +// Any JavaScript environment: +forAwaitEach(myAsyncIterable, function (value) { + return doSomethingAsync(value).then(console.log) +}).then(function () { + console.log('done') +}) +``` + +## Contributing + +Contributions are welcome and encouraged! + +Remember that this library is designed to be small, straight-forward, and +well-tested. The value of new additional features will be weighed against their +size. This library also seeks to leverage and mirror the +[ECMAScript specification][] in its behavior as much as possible and reasonable. + +This repository has far more documentation and explanation than code, and it is +expected that the majority of contributions will come in the form of improving +these. + + + +[arguments]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments + +[array#@@iterator]: (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator) + +[array-like]: http://www.2ality.com/2013/05/quirk-array-like-objects.html + +[array.from]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from + +[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array + +[ecmascript specification]: http://www.ecma-international.org/ecma-262/6.0/ + +[flow]: https://flowtype.org/ + +[hamt]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie + +[isarray]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray + +[iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + +[asynciterators]: https://tc39.github.io/proposal-async-iteration/ + +[linked list]: https://en.wikipedia.org/wiki/Linked_list + +[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map + +[nodejs]: https://nodejs.org/ + +[nodelist]: https://developer.mozilla.org/en-US/docs/Web/API/NodeList + +[protocol]: https://en.wikipedia.org/wiki/Protocol_(object-oriented_programming) + +[react]: https://facebook.github.io/react/ + +[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + +[symbol.iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator + +[typedarray]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray + +[typescript]: http://www.typescriptlang.org/ + +[immutable.js]: http://facebook.github.io/immutable-js/ diff --git a/node_modules/iterall/index.d.ts b/node_modules/iterall/index.d.ts new file mode 100644 index 000000000..e976c3194 --- /dev/null +++ b/node_modules/iterall/index.d.ts @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2016, Lee Byron + * All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Note: TypeScript already has built-in definitions for +// Iterable, Iterator, AsyncIterable, and AsyncIterator so they are not +// defined here. However you may need to configure TypeScript to include them. + +export var $$iterator: symbol + +export function isIterable(obj: any): obj is Iterable + +export function isArrayLike(obj: any): obj is { length: number } + +export function isCollection(obj: any): obj is Iterable | { length: number } + +export function getIterator( + iterable: Iterable +): Iterator +export function getIterator(iterable: any): void | Iterator + +export function getIteratorMethod( + iterable: Iterable +): () => Iterator +export function getIteratorMethod(iterable: any): void | (() => Iterator) + +export function createIterator( + collection: Iterable +): Iterator +export function createIterator(collection: { length: number }): Iterator +export function createIterator(collection: any): void | Iterator + +export function forEach>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any +): void +export function forEach( + collection: TCollection, + callbackFn: (value: any, index: number, collection: TCollection) => any, + thisArg?: any +): void + +export var $$asyncIterator: symbol + +export function isAsyncIterable(obj: any): obj is AsyncIterable + +export function getAsyncIterator( + asyncIterable: AsyncIterable +): AsyncIterator +export function getAsyncIterator( + asyncIterable: any +): void | AsyncIterator + +export function getAsyncIteratorMethod( + asyncIterable: AsyncIterable +): () => AsyncIterator +export function getAsyncIteratorMethod( + asyncIterable: any +): void | (() => AsyncIterator) + +export function createAsyncIterator( + collection: AsyncIterable | Iterable | TValue> +): AsyncIterator +export function createAsyncIterator( + collection: {length: number} +): AsyncIterator +export function createAsyncIterator( + collection: any +): void | AsyncIterator + +export function forAwaitEach>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any +): Promise +export function forAwaitEach | TValue>>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any +): Promise +export function forAwaitEach( + collection: TCollection, + callbackFn: (value: any, index: number, collection: TCollection) => any, + thisArg?: any +): Promise diff --git a/node_modules/iterall/index.js b/node_modules/iterall/index.js new file mode 100644 index 000000000..c80aecb61 --- /dev/null +++ b/node_modules/iterall/index.js @@ -0,0 +1,180 @@ +'use strict'; + +exports.isIterable = isIterable; +exports.isArrayLike = isArrayLike; +exports.isCollection = isCollection; +exports.getIterator = getIterator; +exports.getIteratorMethod = getIteratorMethod; +exports.createIterator = createIterator; +exports.forEach = forEach; +exports.isAsyncIterable = isAsyncIterable; +exports.getAsyncIterator = getAsyncIterator; +exports.getAsyncIteratorMethod = getAsyncIteratorMethod; +exports.createAsyncIterator = createAsyncIterator; +exports.forAwaitEach = forAwaitEach; + +var SYMBOL = typeof Symbol === 'function' ? Symbol : void 0; + +var SYMBOL_ITERATOR = SYMBOL && SYMBOL.iterator; + +var $$iterator = exports.$$iterator = SYMBOL_ITERATOR || '@@iterator'; + +function isIterable(obj) { + return !!getIteratorMethod(obj); +} + +function isArrayLike(obj) { + var length = obj != null && obj.length; + return typeof length === 'number' && length >= 0 && length % 1 === 0; +} + +function isCollection(obj) { + return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj)); +} + +function getIterator(iterable) { + var method = getIteratorMethod(iterable); + if (method) { + return method.call(iterable); + } +} + +function getIteratorMethod(iterable) { + if (iterable != null) { + var method = SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR] || iterable['@@iterator']; + if (typeof method === 'function') { + return method; + } + } +} + +function createIterator(collection) { + if (collection != null) { + var iterator = getIterator(collection); + if (iterator) { + return iterator; + } + if (isArrayLike(collection)) { + return new ArrayLikeIterator(collection); + } + } +} + +function ArrayLikeIterator(obj) { + this._o = obj; + this._i = 0; +} + +ArrayLikeIterator.prototype[$$iterator] = function () { + return this; +}; + +ArrayLikeIterator.prototype.next = function () { + if (this._o === void 0 || this._i >= this._o.length) { + this._o = void 0; + return { value: void 0, done: true }; + } + return { value: this._o[this._i++], done: false }; +}; + +function forEach(collection, callback, thisArg) { + if (collection != null) { + if (typeof collection.forEach === 'function') { + return collection.forEach(callback, thisArg); + } + var i = 0; + var iterator = getIterator(collection); + if (iterator) { + var step; + while (!(step = iterator.next()).done) { + callback.call(thisArg, step.value, i++, collection); + + if (i > 9999999) { + throw new TypeError('Near-infinite iteration.'); + } + } + } else if (isArrayLike(collection)) { + for (; i < collection.length; i++) { + if (collection.hasOwnProperty(i)) { + callback.call(thisArg, collection[i], i, collection); + } + } + } + } +} + +var SYMBOL_ASYNC_ITERATOR = SYMBOL && SYMBOL.asyncIterator; + +var $$asyncIterator = exports.$$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator'; + +function isAsyncIterable(obj) { + return !!getAsyncIteratorMethod(obj); +} + +function getAsyncIterator(asyncIterable) { + var method = getAsyncIteratorMethod(asyncIterable); + if (method) { + return method.call(asyncIterable); + } +} + +function getAsyncIteratorMethod(asyncIterable) { + if (asyncIterable != null) { + var method = SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR] || asyncIterable['@@asyncIterator']; + if (typeof method === 'function') { + return method; + } + } +} + +function createAsyncIterator(source) { + if (source != null) { + var asyncIterator = getAsyncIterator(source); + if (asyncIterator) { + return asyncIterator; + } + var iterator = createIterator(source); + if (iterator) { + return new AsyncFromSyncIterator(iterator); + } + } +} + +function AsyncFromSyncIterator(iterator) { + this._i = iterator; +} + +AsyncFromSyncIterator.prototype[$$asyncIterator] = function () { + return this; +}; + +AsyncFromSyncIterator.prototype.next = function () { + var step = this._i.next(); + return Promise.resolve(step.value).then(function (value) { + return { value: value, done: step.done }; + }); +}; + +function forAwaitEach(source, callback, thisArg) { + var asyncIterator = createAsyncIterator(source); + if (asyncIterator) { + var i = 0; + return new Promise(function (resolve, reject) { + function next() { + asyncIterator.next().then(function (step) { + if (!step.done) { + Promise.resolve(callback.call(thisArg, step.value, i++, source)).then(next).catch(reject); + } else { + resolve(); + } + + return null; + }).catch(reject); + + return null; + } + next(); + }); + } +} + diff --git a/node_modules/iterall/index.js.flow b/node_modules/iterall/index.js.flow new file mode 100644 index 000000000..fa3002a97 --- /dev/null +++ b/node_modules/iterall/index.js.flow @@ -0,0 +1,702 @@ +/** + * Copyright (c) 2016, Lee Byron + * All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @ignore + */ + +/** + * [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator) + * is a *protocol* which describes a standard way to produce a sequence of + * values, typically the values of the Iterable represented by this Iterator. + * + * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) + * it can be utilized by any version of JavaScript. + * + * @external Iterator + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator|MDN Iteration protocols} + */ + +/** + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable) + * is a *protocol* which when implemented allows a JavaScript object to define + * their iteration behavior, such as what values are looped over in a + * [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) + * loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables) + * implement the Iterable protocol, including `Array` and `Map`. + * + * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface) + * it can be utilized by any version of JavaScript. + * + * @external Iterable + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable|MDN Iteration protocols} + */ + +// In ES2015 environments, Symbol exists +var SYMBOL /*: any */ = typeof Symbol === 'function' ? Symbol : void 0 + +// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator +var SYMBOL_ITERATOR = SYMBOL && SYMBOL.iterator + +/** + * A property name to be used as the name of an Iterable's method responsible + * for producing an Iterator, referred to as `@@iterator`. Typically represents + * the value `Symbol.iterator` but falls back to the string `"@@iterator"` when + * `Symbol.iterator` is not defined. + * + * Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`, + * but do not use it for accessing existing Iterables, instead use + * {@link getIterator} or {@link isIterable}. + * + * @example + * + * var $$iterator = require('iterall').$$iterator + * + * function Counter (to) { + * this.to = to + * } + * + * Counter.prototype[$$iterator] = function () { + * return { + * to: this.to, + * num: 0, + * next () { + * if (this.num >= this.to) { + * return { value: undefined, done: true } + * } + * return { value: this.num++, done: false } + * } + * } + * } + * + * var counter = new Counter(3) + * for (var number of counter) { + * console.log(number) // 0 ... 1 ... 2 + * } + * + * @type {Symbol|string} + */ +/*:: declare export var $$iterator: '@@iterator'; */ +export var $$iterator = SYMBOL_ITERATOR || '@@iterator' + +/** + * Returns true if the provided object implements the Iterator protocol via + * either implementing a `Symbol.iterator` or `"@@iterator"` method. + * + * @example + * + * var isIterable = require('iterall').isIterable + * isIterable([ 1, 2, 3 ]) // true + * isIterable('ABC') // true + * isIterable({ length: 1, 0: 'Alpha' }) // false + * isIterable({ key: 'value' }) // false + * isIterable(new Map()) // true + * + * @param obj + * A value which might implement the Iterable protocol. + * @return {boolean} true if Iterable. + */ +/*:: declare export function isIterable(obj: any): boolean; */ +export function isIterable(obj) { + return !!getIteratorMethod(obj) +} + +/** + * Returns true if the provided object implements the Array-like protocol via + * defining a positive-integer `length` property. + * + * @example + * + * var isArrayLike = require('iterall').isArrayLike + * isArrayLike([ 1, 2, 3 ]) // true + * isArrayLike('ABC') // true + * isArrayLike({ length: 1, 0: 'Alpha' }) // true + * isArrayLike({ key: 'value' }) // false + * isArrayLike(new Map()) // false + * + * @param obj + * A value which might implement the Array-like protocol. + * @return {boolean} true if Array-like. + */ +/*:: declare export function isArrayLike(obj: any): boolean; */ +export function isArrayLike(obj) { + var length = obj != null && obj.length + return typeof length === 'number' && length >= 0 && length % 1 === 0 +} + +/** + * Returns true if the provided object is an Object (i.e. not a string literal) + * and is either Iterable or Array-like. + * + * This may be used in place of [Array.isArray()][isArray] to determine if an + * object should be iterated-over. It always excludes string literals and + * includes Arrays (regardless of if it is Iterable). It also includes other + * Array-like objects such as NodeList, TypedArray, and Buffer. + * + * @example + * + * var isCollection = require('iterall').isCollection + * isCollection([ 1, 2, 3 ]) // true + * isCollection('ABC') // false + * isCollection({ length: 1, 0: 'Alpha' }) // true + * isCollection({ key: 'value' }) // false + * isCollection(new Map()) // true + * + * @example + * + * var forEach = require('iterall').forEach + * if (isCollection(obj)) { + * forEach(obj, function (value) { + * console.log(value) + * }) + * } + * + * @param obj + * An Object value which might implement the Iterable or Array-like protocols. + * @return {boolean} true if Iterable or Array-like Object. + */ +/*:: declare export function isCollection(obj: any): boolean; */ +export function isCollection(obj) { + return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj)) +} + +/** + * If the provided object implements the Iterator protocol, its Iterator object + * is returned. Otherwise returns undefined. + * + * @example + * + * var getIterator = require('iterall').getIterator + * var iterator = getIterator([ 1, 2, 3 ]) + * iterator.next() // { value: 1, done: false } + * iterator.next() // { value: 2, done: false } + * iterator.next() // { value: 3, done: false } + * iterator.next() // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {Iterable} iterable + * An Iterable object which is the source of an Iterator. + * @return {Iterator} new Iterator instance. + */ +/*:: declare export var getIterator: + & (<+TValue>(iterable: Iterable) => Iterator) + & ((iterable: mixed) => void | Iterator); */ +export function getIterator(iterable) { + var method = getIteratorMethod(iterable) + if (method) { + return method.call(iterable) + } +} + +/** + * If the provided object implements the Iterator protocol, the method + * responsible for producing its Iterator object is returned. + * + * This is used in rare cases for performance tuning. This method must be called + * with obj as the contextual this-argument. + * + * @example + * + * var getIteratorMethod = require('iterall').getIteratorMethod + * var myArray = [ 1, 2, 3 ] + * var method = getIteratorMethod(myArray) + * if (method) { + * var iterator = method.call(myArray) + * } + * + * @template T the type of each iterated value + * @param {Iterable} iterable + * An Iterable object which defines an `@@iterator` method. + * @return {function(): Iterator} `@@iterator` method. + */ +/*:: declare export var getIteratorMethod: + & (<+TValue>(iterable: Iterable) => (() => Iterator)) + & ((iterable: mixed) => (void | (() => Iterator))); */ +export function getIteratorMethod(iterable) { + if (iterable != null) { + var method = + (SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR]) || iterable['@@iterator'] + if (typeof method === 'function') { + return method + } + } +} + +/** + * Similar to {@link getIterator}, this method returns a new Iterator given an + * Iterable. However it will also create an Iterator for a non-Iterable + * Array-like collection, such as Array in a non-ES2015 environment. + * + * `createIterator` is complimentary to `forEach`, but allows a "pull"-based + * iteration as opposed to `forEach`'s "push"-based iteration. + * + * `createIterator` produces an Iterator for Array-likes with the same behavior + * as ArrayIteratorPrototype described in the ECMAScript specification, and + * does *not* skip over "holes". + * + * @example + * + * var createIterator = require('iterall').createIterator + * + * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } + * var iterator = createIterator(myArraylike) + * iterator.next() // { value: 'Alpha', done: false } + * iterator.next() // { value: 'Bravo', done: false } + * iterator.next() // { value: 'Charlie', done: false } + * iterator.next() // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {Iterable|{ length: number }} collection + * An Iterable or Array-like object to produce an Iterator. + * @return {Iterator} new Iterator instance. + */ +/*:: declare export var createIterator: + & (<+TValue>(collection: Iterable) => Iterator) + & ((collection: {length: number}) => Iterator) + & ((collection: mixed) => (void | Iterator)); */ +export function createIterator(collection) { + if (collection != null) { + var iterator = getIterator(collection) + if (iterator) { + return iterator + } + if (isArrayLike(collection)) { + return new ArrayLikeIterator(collection) + } + } +} + +// When the object provided to `createIterator` is not Iterable but is +// Array-like, this simple Iterator is created. +function ArrayLikeIterator(obj) { + this._o = obj + this._i = 0 +} + +// Note: all Iterators are themselves Iterable. +ArrayLikeIterator.prototype[$$iterator] = function() { + return this +} + +// A simple state-machine determines the IteratorResult returned, yielding +// each value in the Array-like object in order of their indicies. +ArrayLikeIterator.prototype.next = function() { + if (this._o === void 0 || this._i >= this._o.length) { + this._o = void 0 + return { value: void 0, done: true } + } + return { value: this._o[this._i++], done: false } +} + +/** + * Given an object which either implements the Iterable protocol or is + * Array-like, iterate over it, calling the `callback` at each iteration. + * + * Use `forEach` where you would expect to use a `for ... of` loop in ES6. + * However `forEach` adheres to the behavior of [Array#forEach][] described in + * the ECMAScript specification, skipping over "holes" in Array-likes. It will + * also delegate to a `forEach` method on `collection` if one is defined, + * ensuring native performance for `Arrays`. + * + * Similar to [Array#forEach][], the `callback` function accepts three + * arguments, and is provided with `thisArg` as the calling context. + * + * Note: providing an infinite Iterator to forEach will produce an error. + * + * [Array#forEach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + * + * @example + * + * var forEach = require('iterall').forEach + * + * forEach(myIterable, function (value, index, iterable) { + * console.log(value, index, iterable === myIterable) + * }) + * + * @example + * + * // ES6: + * for (let value of myIterable) { + * console.log(value) + * } + * + * // Any JavaScript environment: + * forEach(myIterable, function (value) { + * console.log(value) + * }) + * + * @template T the type of each iterated value + * @param {Iterable|{ length: number }} collection + * The Iterable or array to iterate over. + * @param {function(T, number, object)} callback + * Function to execute for each iteration, taking up to three arguments + * @param [thisArg] + * Optional. Value to use as `this` when executing `callback`. + */ +/*:: declare export var forEach: + & (<+TValue, TCollection: Iterable>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any + ) => void) + & (( + collection: TCollection, + callbackFn: (value: mixed, index: number, collection: TCollection) => any, + thisArg?: any + ) => void); */ +export function forEach(collection, callback, thisArg) { + if (collection != null) { + if (typeof collection.forEach === 'function') { + return collection.forEach(callback, thisArg) + } + var i = 0 + var iterator = getIterator(collection) + if (iterator) { + var step + while (!(step = iterator.next()).done) { + callback.call(thisArg, step.value, i++, collection) + // Infinite Iterators could cause forEach to run forever. + // After a very large number of iterations, produce an error. + /* istanbul ignore if */ + if (i > 9999999) { + throw new TypeError('Near-infinite iteration.') + } + } + } else if (isArrayLike(collection)) { + for (; i < collection.length; i++) { + if (collection.hasOwnProperty(i)) { + callback.call(thisArg, collection[i], i, collection) + } + } + } + } +} + +///////////////////////////////////////////////////// +// // +// ASYNC ITERATORS // +// // +///////////////////////////////////////////////////// + +/** + * [AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface) + * is a *protocol* which when implemented allows a JavaScript object to define + * an asynchronous iteration behavior, such as what values are looped over in + * a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) + * loop or `iterall`'s {@link forAwaitEach} function. + * + * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) + * it can be utilized by any version of JavaScript. + * + * @external AsyncIterable + * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface|Async Iteration Proposal} + * @template T The type of each iterated value + * @property {function (): AsyncIterator} Symbol.asyncIterator + * A method which produces an AsyncIterator for this AsyncIterable. + */ + +/** + * [AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface) + * is a *protocol* which describes a standard way to produce and consume an + * asynchronous sequence of values, typically the values of the + * {@link AsyncIterable} represented by this {@link AsyncIterator}. + * + * AsyncIterator is similar to Observable or Stream. Like an {@link Iterator} it + * also as a `next()` method, however instead of an IteratorResult, + * calling this method returns a {@link Promise} for a IteratorResult. + * + * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) + * it can be utilized by any version of JavaScript. + * + * @external AsyncIterator + * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface|Async Iteration Proposal} + */ + +// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator +var SYMBOL_ASYNC_ITERATOR = SYMBOL && SYMBOL.asyncIterator + +/** + * A property name to be used as the name of an AsyncIterable's method + * responsible for producing an Iterator, referred to as `@@asyncIterator`. + * Typically represents the value `Symbol.asyncIterator` but falls back to the + * string `"@@asyncIterator"` when `Symbol.asyncIterator` is not defined. + * + * Use `$$asyncIterator` for defining new AsyncIterables instead of + * `Symbol.asyncIterator`, but do not use it for accessing existing Iterables, + * instead use {@link getAsyncIterator} or {@link isAsyncIterable}. + * + * @example + * + * var $$asyncIterator = require('iterall').$$asyncIterator + * + * function Chirper (to) { + * this.to = to + * } + * + * Chirper.prototype[$$asyncIterator] = function () { + * return { + * to: this.to, + * num: 0, + * next () { + * return new Promise(resolve => { + * if (this.num >= this.to) { + * resolve({ value: undefined, done: true }) + * } else { + * setTimeout(() => { + * resolve({ value: this.num++, done: false }) + * }, 1000) + * } + * }) + * } + * } + * } + * + * var chirper = new Chirper(3) + * for await (var number of chirper) { + * console.log(number) // 0 ...wait... 1 ...wait... 2 + * } + * + * @type {Symbol|string} + */ +/*:: declare export var $$asyncIterator: '@@asyncIterator'; */ +export var $$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator' + +/** + * Returns true if the provided object implements the AsyncIterator protocol via + * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. + * + * @example + * + * var isAsyncIterable = require('iterall').isAsyncIterable + * isAsyncIterable(myStream) // true + * isAsyncIterable('ABC') // false + * + * @param obj + * A value which might implement the AsyncIterable protocol. + * @return {boolean} true if AsyncIterable. + */ +/*:: declare export function isAsyncIterable(obj: any): boolean; */ +export function isAsyncIterable(obj) { + return !!getAsyncIteratorMethod(obj) +} + +/** + * If the provided object implements the AsyncIterator protocol, its + * AsyncIterator object is returned. Otherwise returns undefined. + * + * @example + * + * var getAsyncIterator = require('iterall').getAsyncIterator + * var asyncIterator = getAsyncIterator(myStream) + * asyncIterator.next().then(console.log) // { value: 1, done: false } + * asyncIterator.next().then(console.log) // { value: 2, done: false } + * asyncIterator.next().then(console.log) // { value: 3, done: false } + * asyncIterator.next().then(console.log) // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {AsyncIterable} asyncIterable + * An AsyncIterable object which is the source of an AsyncIterator. + * @return {AsyncIterator} new AsyncIterator instance. + */ +/*:: declare export var getAsyncIterator: + & (<+TValue>(asyncIterable: AsyncIterable) => AsyncIterator) + & ((asyncIterable: mixed) => (void | AsyncIterator)); */ +export function getAsyncIterator(asyncIterable) { + var method = getAsyncIteratorMethod(asyncIterable) + if (method) { + return method.call(asyncIterable) + } +} + +/** + * If the provided object implements the AsyncIterator protocol, the method + * responsible for producing its AsyncIterator object is returned. + * + * This is used in rare cases for performance tuning. This method must be called + * with obj as the contextual this-argument. + * + * @example + * + * var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod + * var method = getAsyncIteratorMethod(myStream) + * if (method) { + * var asyncIterator = method.call(myStream) + * } + * + * @template T the type of each iterated value + * @param {AsyncIterable} asyncIterable + * An AsyncIterable object which defines an `@@asyncIterator` method. + * @return {function(): AsyncIterator} `@@asyncIterator` method. + */ +/*:: declare export var getAsyncIteratorMethod: + & (<+TValue>(asyncIterable: AsyncIterable) => (() => AsyncIterator)) + & ((asyncIterable: mixed) => (void | (() => AsyncIterator))); */ +export function getAsyncIteratorMethod(asyncIterable) { + if (asyncIterable != null) { + var method = + (SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR]) || + asyncIterable['@@asyncIterator'] + if (typeof method === 'function') { + return method + } + } +} + +/** + * Similar to {@link getAsyncIterator}, this method returns a new AsyncIterator + * given an AsyncIterable. However it will also create an AsyncIterator for a + * non-async Iterable as well as non-Iterable Array-like collection, such as + * Array in a pre-ES2015 environment. + * + * `createAsyncIterator` is complimentary to `forAwaitEach`, but allows a + * buffering "pull"-based iteration as opposed to `forAwaitEach`'s + * "push"-based iteration. + * + * `createAsyncIterator` produces an AsyncIterator for non-async Iterables as + * described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects). + * + * > Note: Creating `AsyncIterator`s requires the existence of `Promise`. + * > While `Promise` has been available in modern browsers for a number of + * > years, legacy browsers (like IE 11) may require a polyfill. + * + * @example + * + * var createAsyncIterator = require('iterall').createAsyncIterator + * + * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } + * var iterator = createAsyncIterator(myArraylike) + * iterator.next().then(console.log) // { value: 'Alpha', done: false } + * iterator.next().then(console.log) // { value: 'Bravo', done: false } + * iterator.next().then(console.log) // { value: 'Charlie', done: false } + * iterator.next().then(console.log) // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {AsyncIterable|Iterable|{ length: number }} source + * An AsyncIterable, Iterable, or Array-like object to produce an Iterator. + * @return {AsyncIterator} new AsyncIterator instance. + */ +/*:: declare export var createAsyncIterator: + & (<+TValue>( + collection: Iterable | TValue> | AsyncIterable + ) => AsyncIterator) + & ((collection: {length: number}) => AsyncIterator) + & ((collection: mixed) => (void | AsyncIterator)); */ +export function createAsyncIterator(source) { + if (source != null) { + var asyncIterator = getAsyncIterator(source) + if (asyncIterator) { + return asyncIterator + } + var iterator = createIterator(source) + if (iterator) { + return new AsyncFromSyncIterator(iterator) + } + } +} + +// When the object provided to `createAsyncIterator` is not AsyncIterable but is +// sync Iterable, this simple wrapper is created. +function AsyncFromSyncIterator(iterator) { + this._i = iterator +} + +// Note: all AsyncIterators are themselves AsyncIterable. +AsyncFromSyncIterator.prototype[$$asyncIterator] = function() { + return this +} + +// A simple state-machine determines the IteratorResult returned, yielding +// each value in the Array-like object in order of their indicies. +AsyncFromSyncIterator.prototype.next = function() { + var step = this._i.next() + return Promise.resolve(step.value).then(function(value) { + return { value: value, done: step.done } + }) +} + +/** + * Given an object which either implements the AsyncIterable protocol or is + * Array-like, iterate over it, calling the `callback` at each iteration. + * + * Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop. + * + * Similar to [Array#forEach][], the `callback` function accepts three + * arguments, and is provided with `thisArg` as the calling context. + * + * > Note: Using `forAwaitEach` requires the existence of `Promise`. + * > While `Promise` has been available in modern browsers for a number of + * > years, legacy browsers (like IE 11) may require a polyfill. + * + * @example + * + * var forAwaitEach = require('iterall').forAwaitEach + * + * forAwaitEach(myIterable, function (value, index, iterable) { + * console.log(value, index, iterable === myIterable) + * }) + * + * @example + * + * // ES2017: + * for await (let value of myAsyncIterable) { + * console.log(await doSomethingAsync(value)) + * } + * console.log('done') + * + * // Any JavaScript environment: + * forAwaitEach(myAsyncIterable, function (value) { + * return doSomethingAsync(value).then(console.log) + * }).then(function () { + * console.log('done') + * }) + * + * @template T the type of each iterated value + * @param {AsyncIterable|Iterable | T>|{ length: number }} source + * The AsyncIterable or array to iterate over. + * @param {function(T, number, object)} callback + * Function to execute for each iteration, taking up to three arguments + * @param [thisArg] + * Optional. Value to use as `this` when executing `callback`. + */ +/*:: declare export var forAwaitEach: + & (<+TValue, TCollection: Iterable | TValue> | AsyncIterable>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any + ) => Promise) + & (( + collection: TCollection, + callbackFn: (value: mixed, index: number, collection: TCollection) => any, + thisArg?: any + ) => Promise); */ +export function forAwaitEach(source, callback, thisArg) { + var asyncIterator = createAsyncIterator(source) + if (asyncIterator) { + var i = 0 + return new Promise(function(resolve, reject) { + function next() { + asyncIterator + .next() + .then(function(step) { + if (!step.done) { + Promise.resolve(callback.call(thisArg, step.value, i++, source)) + .then(next) + .catch(reject) + } else { + resolve() + } + // Explicitly return null, silencing bluebird-style warnings. + return null + }) + .catch(reject) + // Explicitly return null, silencing bluebird-style warnings. + return null + } + next() + }) + } +} diff --git a/node_modules/iterall/index.mjs b/node_modules/iterall/index.mjs new file mode 100644 index 000000000..fa3002a97 --- /dev/null +++ b/node_modules/iterall/index.mjs @@ -0,0 +1,702 @@ +/** + * Copyright (c) 2016, Lee Byron + * All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @ignore + */ + +/** + * [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator) + * is a *protocol* which describes a standard way to produce a sequence of + * values, typically the values of the Iterable represented by this Iterator. + * + * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface) + * it can be utilized by any version of JavaScript. + * + * @external Iterator + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator|MDN Iteration protocols} + */ + +/** + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable) + * is a *protocol* which when implemented allows a JavaScript object to define + * their iteration behavior, such as what values are looped over in a + * [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) + * loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables) + * implement the Iterable protocol, including `Array` and `Map`. + * + * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface) + * it can be utilized by any version of JavaScript. + * + * @external Iterable + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable|MDN Iteration protocols} + */ + +// In ES2015 environments, Symbol exists +var SYMBOL /*: any */ = typeof Symbol === 'function' ? Symbol : void 0 + +// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator +var SYMBOL_ITERATOR = SYMBOL && SYMBOL.iterator + +/** + * A property name to be used as the name of an Iterable's method responsible + * for producing an Iterator, referred to as `@@iterator`. Typically represents + * the value `Symbol.iterator` but falls back to the string `"@@iterator"` when + * `Symbol.iterator` is not defined. + * + * Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`, + * but do not use it for accessing existing Iterables, instead use + * {@link getIterator} or {@link isIterable}. + * + * @example + * + * var $$iterator = require('iterall').$$iterator + * + * function Counter (to) { + * this.to = to + * } + * + * Counter.prototype[$$iterator] = function () { + * return { + * to: this.to, + * num: 0, + * next () { + * if (this.num >= this.to) { + * return { value: undefined, done: true } + * } + * return { value: this.num++, done: false } + * } + * } + * } + * + * var counter = new Counter(3) + * for (var number of counter) { + * console.log(number) // 0 ... 1 ... 2 + * } + * + * @type {Symbol|string} + */ +/*:: declare export var $$iterator: '@@iterator'; */ +export var $$iterator = SYMBOL_ITERATOR || '@@iterator' + +/** + * Returns true if the provided object implements the Iterator protocol via + * either implementing a `Symbol.iterator` or `"@@iterator"` method. + * + * @example + * + * var isIterable = require('iterall').isIterable + * isIterable([ 1, 2, 3 ]) // true + * isIterable('ABC') // true + * isIterable({ length: 1, 0: 'Alpha' }) // false + * isIterable({ key: 'value' }) // false + * isIterable(new Map()) // true + * + * @param obj + * A value which might implement the Iterable protocol. + * @return {boolean} true if Iterable. + */ +/*:: declare export function isIterable(obj: any): boolean; */ +export function isIterable(obj) { + return !!getIteratorMethod(obj) +} + +/** + * Returns true if the provided object implements the Array-like protocol via + * defining a positive-integer `length` property. + * + * @example + * + * var isArrayLike = require('iterall').isArrayLike + * isArrayLike([ 1, 2, 3 ]) // true + * isArrayLike('ABC') // true + * isArrayLike({ length: 1, 0: 'Alpha' }) // true + * isArrayLike({ key: 'value' }) // false + * isArrayLike(new Map()) // false + * + * @param obj + * A value which might implement the Array-like protocol. + * @return {boolean} true if Array-like. + */ +/*:: declare export function isArrayLike(obj: any): boolean; */ +export function isArrayLike(obj) { + var length = obj != null && obj.length + return typeof length === 'number' && length >= 0 && length % 1 === 0 +} + +/** + * Returns true if the provided object is an Object (i.e. not a string literal) + * and is either Iterable or Array-like. + * + * This may be used in place of [Array.isArray()][isArray] to determine if an + * object should be iterated-over. It always excludes string literals and + * includes Arrays (regardless of if it is Iterable). It also includes other + * Array-like objects such as NodeList, TypedArray, and Buffer. + * + * @example + * + * var isCollection = require('iterall').isCollection + * isCollection([ 1, 2, 3 ]) // true + * isCollection('ABC') // false + * isCollection({ length: 1, 0: 'Alpha' }) // true + * isCollection({ key: 'value' }) // false + * isCollection(new Map()) // true + * + * @example + * + * var forEach = require('iterall').forEach + * if (isCollection(obj)) { + * forEach(obj, function (value) { + * console.log(value) + * }) + * } + * + * @param obj + * An Object value which might implement the Iterable or Array-like protocols. + * @return {boolean} true if Iterable or Array-like Object. + */ +/*:: declare export function isCollection(obj: any): boolean; */ +export function isCollection(obj) { + return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj)) +} + +/** + * If the provided object implements the Iterator protocol, its Iterator object + * is returned. Otherwise returns undefined. + * + * @example + * + * var getIterator = require('iterall').getIterator + * var iterator = getIterator([ 1, 2, 3 ]) + * iterator.next() // { value: 1, done: false } + * iterator.next() // { value: 2, done: false } + * iterator.next() // { value: 3, done: false } + * iterator.next() // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {Iterable} iterable + * An Iterable object which is the source of an Iterator. + * @return {Iterator} new Iterator instance. + */ +/*:: declare export var getIterator: + & (<+TValue>(iterable: Iterable) => Iterator) + & ((iterable: mixed) => void | Iterator); */ +export function getIterator(iterable) { + var method = getIteratorMethod(iterable) + if (method) { + return method.call(iterable) + } +} + +/** + * If the provided object implements the Iterator protocol, the method + * responsible for producing its Iterator object is returned. + * + * This is used in rare cases for performance tuning. This method must be called + * with obj as the contextual this-argument. + * + * @example + * + * var getIteratorMethod = require('iterall').getIteratorMethod + * var myArray = [ 1, 2, 3 ] + * var method = getIteratorMethod(myArray) + * if (method) { + * var iterator = method.call(myArray) + * } + * + * @template T the type of each iterated value + * @param {Iterable} iterable + * An Iterable object which defines an `@@iterator` method. + * @return {function(): Iterator} `@@iterator` method. + */ +/*:: declare export var getIteratorMethod: + & (<+TValue>(iterable: Iterable) => (() => Iterator)) + & ((iterable: mixed) => (void | (() => Iterator))); */ +export function getIteratorMethod(iterable) { + if (iterable != null) { + var method = + (SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR]) || iterable['@@iterator'] + if (typeof method === 'function') { + return method + } + } +} + +/** + * Similar to {@link getIterator}, this method returns a new Iterator given an + * Iterable. However it will also create an Iterator for a non-Iterable + * Array-like collection, such as Array in a non-ES2015 environment. + * + * `createIterator` is complimentary to `forEach`, but allows a "pull"-based + * iteration as opposed to `forEach`'s "push"-based iteration. + * + * `createIterator` produces an Iterator for Array-likes with the same behavior + * as ArrayIteratorPrototype described in the ECMAScript specification, and + * does *not* skip over "holes". + * + * @example + * + * var createIterator = require('iterall').createIterator + * + * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } + * var iterator = createIterator(myArraylike) + * iterator.next() // { value: 'Alpha', done: false } + * iterator.next() // { value: 'Bravo', done: false } + * iterator.next() // { value: 'Charlie', done: false } + * iterator.next() // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {Iterable|{ length: number }} collection + * An Iterable or Array-like object to produce an Iterator. + * @return {Iterator} new Iterator instance. + */ +/*:: declare export var createIterator: + & (<+TValue>(collection: Iterable) => Iterator) + & ((collection: {length: number}) => Iterator) + & ((collection: mixed) => (void | Iterator)); */ +export function createIterator(collection) { + if (collection != null) { + var iterator = getIterator(collection) + if (iterator) { + return iterator + } + if (isArrayLike(collection)) { + return new ArrayLikeIterator(collection) + } + } +} + +// When the object provided to `createIterator` is not Iterable but is +// Array-like, this simple Iterator is created. +function ArrayLikeIterator(obj) { + this._o = obj + this._i = 0 +} + +// Note: all Iterators are themselves Iterable. +ArrayLikeIterator.prototype[$$iterator] = function() { + return this +} + +// A simple state-machine determines the IteratorResult returned, yielding +// each value in the Array-like object in order of their indicies. +ArrayLikeIterator.prototype.next = function() { + if (this._o === void 0 || this._i >= this._o.length) { + this._o = void 0 + return { value: void 0, done: true } + } + return { value: this._o[this._i++], done: false } +} + +/** + * Given an object which either implements the Iterable protocol or is + * Array-like, iterate over it, calling the `callback` at each iteration. + * + * Use `forEach` where you would expect to use a `for ... of` loop in ES6. + * However `forEach` adheres to the behavior of [Array#forEach][] described in + * the ECMAScript specification, skipping over "holes" in Array-likes. It will + * also delegate to a `forEach` method on `collection` if one is defined, + * ensuring native performance for `Arrays`. + * + * Similar to [Array#forEach][], the `callback` function accepts three + * arguments, and is provided with `thisArg` as the calling context. + * + * Note: providing an infinite Iterator to forEach will produce an error. + * + * [Array#forEach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach + * + * @example + * + * var forEach = require('iterall').forEach + * + * forEach(myIterable, function (value, index, iterable) { + * console.log(value, index, iterable === myIterable) + * }) + * + * @example + * + * // ES6: + * for (let value of myIterable) { + * console.log(value) + * } + * + * // Any JavaScript environment: + * forEach(myIterable, function (value) { + * console.log(value) + * }) + * + * @template T the type of each iterated value + * @param {Iterable|{ length: number }} collection + * The Iterable or array to iterate over. + * @param {function(T, number, object)} callback + * Function to execute for each iteration, taking up to three arguments + * @param [thisArg] + * Optional. Value to use as `this` when executing `callback`. + */ +/*:: declare export var forEach: + & (<+TValue, TCollection: Iterable>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any + ) => void) + & (( + collection: TCollection, + callbackFn: (value: mixed, index: number, collection: TCollection) => any, + thisArg?: any + ) => void); */ +export function forEach(collection, callback, thisArg) { + if (collection != null) { + if (typeof collection.forEach === 'function') { + return collection.forEach(callback, thisArg) + } + var i = 0 + var iterator = getIterator(collection) + if (iterator) { + var step + while (!(step = iterator.next()).done) { + callback.call(thisArg, step.value, i++, collection) + // Infinite Iterators could cause forEach to run forever. + // After a very large number of iterations, produce an error. + /* istanbul ignore if */ + if (i > 9999999) { + throw new TypeError('Near-infinite iteration.') + } + } + } else if (isArrayLike(collection)) { + for (; i < collection.length; i++) { + if (collection.hasOwnProperty(i)) { + callback.call(thisArg, collection[i], i, collection) + } + } + } + } +} + +///////////////////////////////////////////////////// +// // +// ASYNC ITERATORS // +// // +///////////////////////////////////////////////////// + +/** + * [AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface) + * is a *protocol* which when implemented allows a JavaScript object to define + * an asynchronous iteration behavior, such as what values are looped over in + * a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) + * loop or `iterall`'s {@link forAwaitEach} function. + * + * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) + * it can be utilized by any version of JavaScript. + * + * @external AsyncIterable + * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface|Async Iteration Proposal} + * @template T The type of each iterated value + * @property {function (): AsyncIterator} Symbol.asyncIterator + * A method which produces an AsyncIterator for this AsyncIterable. + */ + +/** + * [AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface) + * is a *protocol* which describes a standard way to produce and consume an + * asynchronous sequence of values, typically the values of the + * {@link AsyncIterable} represented by this {@link AsyncIterator}. + * + * AsyncIterator is similar to Observable or Stream. Like an {@link Iterator} it + * also as a `next()` method, however instead of an IteratorResult, + * calling this method returns a {@link Promise} for a IteratorResult. + * + * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/) + * it can be utilized by any version of JavaScript. + * + * @external AsyncIterator + * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface|Async Iteration Proposal} + */ + +// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator +var SYMBOL_ASYNC_ITERATOR = SYMBOL && SYMBOL.asyncIterator + +/** + * A property name to be used as the name of an AsyncIterable's method + * responsible for producing an Iterator, referred to as `@@asyncIterator`. + * Typically represents the value `Symbol.asyncIterator` but falls back to the + * string `"@@asyncIterator"` when `Symbol.asyncIterator` is not defined. + * + * Use `$$asyncIterator` for defining new AsyncIterables instead of + * `Symbol.asyncIterator`, but do not use it for accessing existing Iterables, + * instead use {@link getAsyncIterator} or {@link isAsyncIterable}. + * + * @example + * + * var $$asyncIterator = require('iterall').$$asyncIterator + * + * function Chirper (to) { + * this.to = to + * } + * + * Chirper.prototype[$$asyncIterator] = function () { + * return { + * to: this.to, + * num: 0, + * next () { + * return new Promise(resolve => { + * if (this.num >= this.to) { + * resolve({ value: undefined, done: true }) + * } else { + * setTimeout(() => { + * resolve({ value: this.num++, done: false }) + * }, 1000) + * } + * }) + * } + * } + * } + * + * var chirper = new Chirper(3) + * for await (var number of chirper) { + * console.log(number) // 0 ...wait... 1 ...wait... 2 + * } + * + * @type {Symbol|string} + */ +/*:: declare export var $$asyncIterator: '@@asyncIterator'; */ +export var $$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator' + +/** + * Returns true if the provided object implements the AsyncIterator protocol via + * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. + * + * @example + * + * var isAsyncIterable = require('iterall').isAsyncIterable + * isAsyncIterable(myStream) // true + * isAsyncIterable('ABC') // false + * + * @param obj + * A value which might implement the AsyncIterable protocol. + * @return {boolean} true if AsyncIterable. + */ +/*:: declare export function isAsyncIterable(obj: any): boolean; */ +export function isAsyncIterable(obj) { + return !!getAsyncIteratorMethod(obj) +} + +/** + * If the provided object implements the AsyncIterator protocol, its + * AsyncIterator object is returned. Otherwise returns undefined. + * + * @example + * + * var getAsyncIterator = require('iterall').getAsyncIterator + * var asyncIterator = getAsyncIterator(myStream) + * asyncIterator.next().then(console.log) // { value: 1, done: false } + * asyncIterator.next().then(console.log) // { value: 2, done: false } + * asyncIterator.next().then(console.log) // { value: 3, done: false } + * asyncIterator.next().then(console.log) // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {AsyncIterable} asyncIterable + * An AsyncIterable object which is the source of an AsyncIterator. + * @return {AsyncIterator} new AsyncIterator instance. + */ +/*:: declare export var getAsyncIterator: + & (<+TValue>(asyncIterable: AsyncIterable) => AsyncIterator) + & ((asyncIterable: mixed) => (void | AsyncIterator)); */ +export function getAsyncIterator(asyncIterable) { + var method = getAsyncIteratorMethod(asyncIterable) + if (method) { + return method.call(asyncIterable) + } +} + +/** + * If the provided object implements the AsyncIterator protocol, the method + * responsible for producing its AsyncIterator object is returned. + * + * This is used in rare cases for performance tuning. This method must be called + * with obj as the contextual this-argument. + * + * @example + * + * var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod + * var method = getAsyncIteratorMethod(myStream) + * if (method) { + * var asyncIterator = method.call(myStream) + * } + * + * @template T the type of each iterated value + * @param {AsyncIterable} asyncIterable + * An AsyncIterable object which defines an `@@asyncIterator` method. + * @return {function(): AsyncIterator} `@@asyncIterator` method. + */ +/*:: declare export var getAsyncIteratorMethod: + & (<+TValue>(asyncIterable: AsyncIterable) => (() => AsyncIterator)) + & ((asyncIterable: mixed) => (void | (() => AsyncIterator))); */ +export function getAsyncIteratorMethod(asyncIterable) { + if (asyncIterable != null) { + var method = + (SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR]) || + asyncIterable['@@asyncIterator'] + if (typeof method === 'function') { + return method + } + } +} + +/** + * Similar to {@link getAsyncIterator}, this method returns a new AsyncIterator + * given an AsyncIterable. However it will also create an AsyncIterator for a + * non-async Iterable as well as non-Iterable Array-like collection, such as + * Array in a pre-ES2015 environment. + * + * `createAsyncIterator` is complimentary to `forAwaitEach`, but allows a + * buffering "pull"-based iteration as opposed to `forAwaitEach`'s + * "push"-based iteration. + * + * `createAsyncIterator` produces an AsyncIterator for non-async Iterables as + * described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects). + * + * > Note: Creating `AsyncIterator`s requires the existence of `Promise`. + * > While `Promise` has been available in modern browsers for a number of + * > years, legacy browsers (like IE 11) may require a polyfill. + * + * @example + * + * var createAsyncIterator = require('iterall').createAsyncIterator + * + * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' } + * var iterator = createAsyncIterator(myArraylike) + * iterator.next().then(console.log) // { value: 'Alpha', done: false } + * iterator.next().then(console.log) // { value: 'Bravo', done: false } + * iterator.next().then(console.log) // { value: 'Charlie', done: false } + * iterator.next().then(console.log) // { value: undefined, done: true } + * + * @template T the type of each iterated value + * @param {AsyncIterable|Iterable|{ length: number }} source + * An AsyncIterable, Iterable, or Array-like object to produce an Iterator. + * @return {AsyncIterator} new AsyncIterator instance. + */ +/*:: declare export var createAsyncIterator: + & (<+TValue>( + collection: Iterable | TValue> | AsyncIterable + ) => AsyncIterator) + & ((collection: {length: number}) => AsyncIterator) + & ((collection: mixed) => (void | AsyncIterator)); */ +export function createAsyncIterator(source) { + if (source != null) { + var asyncIterator = getAsyncIterator(source) + if (asyncIterator) { + return asyncIterator + } + var iterator = createIterator(source) + if (iterator) { + return new AsyncFromSyncIterator(iterator) + } + } +} + +// When the object provided to `createAsyncIterator` is not AsyncIterable but is +// sync Iterable, this simple wrapper is created. +function AsyncFromSyncIterator(iterator) { + this._i = iterator +} + +// Note: all AsyncIterators are themselves AsyncIterable. +AsyncFromSyncIterator.prototype[$$asyncIterator] = function() { + return this +} + +// A simple state-machine determines the IteratorResult returned, yielding +// each value in the Array-like object in order of their indicies. +AsyncFromSyncIterator.prototype.next = function() { + var step = this._i.next() + return Promise.resolve(step.value).then(function(value) { + return { value: value, done: step.done } + }) +} + +/** + * Given an object which either implements the AsyncIterable protocol or is + * Array-like, iterate over it, calling the `callback` at each iteration. + * + * Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop. + * + * Similar to [Array#forEach][], the `callback` function accepts three + * arguments, and is provided with `thisArg` as the calling context. + * + * > Note: Using `forAwaitEach` requires the existence of `Promise`. + * > While `Promise` has been available in modern browsers for a number of + * > years, legacy browsers (like IE 11) may require a polyfill. + * + * @example + * + * var forAwaitEach = require('iterall').forAwaitEach + * + * forAwaitEach(myIterable, function (value, index, iterable) { + * console.log(value, index, iterable === myIterable) + * }) + * + * @example + * + * // ES2017: + * for await (let value of myAsyncIterable) { + * console.log(await doSomethingAsync(value)) + * } + * console.log('done') + * + * // Any JavaScript environment: + * forAwaitEach(myAsyncIterable, function (value) { + * return doSomethingAsync(value).then(console.log) + * }).then(function () { + * console.log('done') + * }) + * + * @template T the type of each iterated value + * @param {AsyncIterable|Iterable | T>|{ length: number }} source + * The AsyncIterable or array to iterate over. + * @param {function(T, number, object)} callback + * Function to execute for each iteration, taking up to three arguments + * @param [thisArg] + * Optional. Value to use as `this` when executing `callback`. + */ +/*:: declare export var forAwaitEach: + & (<+TValue, TCollection: Iterable | TValue> | AsyncIterable>( + collection: TCollection, + callbackFn: (value: TValue, index: number, collection: TCollection) => any, + thisArg?: any + ) => Promise) + & (( + collection: TCollection, + callbackFn: (value: mixed, index: number, collection: TCollection) => any, + thisArg?: any + ) => Promise); */ +export function forAwaitEach(source, callback, thisArg) { + var asyncIterator = createAsyncIterator(source) + if (asyncIterator) { + var i = 0 + return new Promise(function(resolve, reject) { + function next() { + asyncIterator + .next() + .then(function(step) { + if (!step.done) { + Promise.resolve(callback.call(thisArg, step.value, i++, source)) + .then(next) + .catch(reject) + } else { + resolve() + } + // Explicitly return null, silencing bluebird-style warnings. + return null + }) + .catch(reject) + // Explicitly return null, silencing bluebird-style warnings. + return null + } + next() + }) + } +} diff --git a/node_modules/iterall/package.json b/node_modules/iterall/package.json new file mode 100644 index 000000000..911c24c95 --- /dev/null +++ b/node_modules/iterall/package.json @@ -0,0 +1,20 @@ +{ + "name": "iterall", + "version": "1.2.2", + "description": "Minimal zero-dependency utilities for using JavaScript Iterables in all environments.", + "license": "MIT", + "author": "Lee Byron (http://leebyron.com/)", + "homepage": "https://github.com/leebyron/iterall", + "bugs": "https://github.com/leebyron/iterall/issues", + "repository": "github:leebyron/iterall", + "keywords": [ + "es6", + "iterator", + "iterable", + "polyfill", + "for-of" + ], + "main": "index", + "module": "index.mjs", + "typings": "index.d.ts" +} diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100644 index 000000000..755e6f6ec --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,151 @@ +### Version 4.0.0 (2018-01-28) ### + +- Added: Support for ES2018. The only change needed was recognizing the `s` + regex flag. +- Changed: _All_ tokens returned by the `matchToToken` function now have a + `closed` property. It is set to `undefined` for the tokens where “closed” + doesn’t make sense. This means that all tokens objects have the same shape, + which might improve performance. + +These are the breaking changes: + +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but + `['/a/s']`. (There are of course other variations of this.) +- Code that rely on some token objects not having the `closed` property could + now behave differently. + + +### Version 3.0.2 (2017-06-28) ### + +- No code changes. Just updates to the readme. + + +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100644 index 000000000..54aef52f3 --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100644 index 000000000..00cdf1634 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,240 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest ECMAScript version whose feature +set has been finalized. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, ECMAScript 2018 is supported. + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). Note: See also +the [ES2018](#es2018) section. + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also +look backwards. See the [ES2018](#es2018) section). + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + +### ES2018 ### + +ES2018 added some nice regex improvements to the language. + +- [Unicode property escapes] should allow telling names and invalid non-ASCII + characters apart without blowing up the regex size. +- [Lookbehind assertions] should allow matching telling division and regex + literals apart in more cases. +- [Named capture groups] might simplify some things. + +These things would be nice to do, but are not critical. They probably have to +wait until the oldest maintained Node.js LTS release supports those features. + +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100644 index 000000000..b23a4a0e7 --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100644 index 000000000..66752fab2 --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,30 @@ +{ + "name": "js-tokens", + "version": "4.0.0", + "author": "Simon Lydell", + "license": "MIT", + "description": "A regex that tokenizes JavaScript.", + "keywords": [ + "JavaScript", + "js", + "token", + "tokenize", + "regex" + ], + "files": [ + "index.js" + ], + "repository": "lydell/js-tokens", + "scripts": { + "test": "mocha --ui tdd", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "build": "node generate-index.js", + "dev": "npm run build && npm test" + }, + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + } +} diff --git a/node_modules/lodash.isequal/LICENSE b/node_modules/lodash.isequal/LICENSE new file mode 100644 index 000000000..c6f2f6145 --- /dev/null +++ b/node_modules/lodash.isequal/LICENSE @@ -0,0 +1,47 @@ +Copyright JS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.isequal/README.md b/node_modules/lodash.isequal/README.md new file mode 100644 index 000000000..742156512 --- /dev/null +++ b/node_modules/lodash.isequal/README.md @@ -0,0 +1,18 @@ +# lodash.isequal v4.5.0 + +The [Lodash](https://lodash.com/) method `_.isEqual` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isequal +``` + +In Node.js: +```js +var isEqual = require('lodash.isequal'); +``` + +See the [documentation](https://lodash.com/docs#isEqual) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.isequal) for more details. diff --git a/node_modules/lodash.isequal/index.js b/node_modules/lodash.isequal/index.js new file mode 100644 index 000000000..c24908305 --- /dev/null +++ b/node_modules/lodash.isequal/index.js @@ -0,0 +1,1848 @@ +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = isEqual; diff --git a/node_modules/lodash.isequal/package.json b/node_modules/lodash.isequal/package.json new file mode 100644 index 000000000..3b977cafa --- /dev/null +++ b/node_modules/lodash.isequal/package.json @@ -0,0 +1,16 @@ +{ + "name": "lodash.isequal", + "version": "4.5.0", + "description": "The Lodash method `_.isEqual` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, isequal", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/loose-envify/LICENSE b/node_modules/loose-envify/LICENSE new file mode 100644 index 000000000..fbafb4875 --- /dev/null +++ b/node_modules/loose-envify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Andres Suarez + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/loose-envify/README.md b/node_modules/loose-envify/README.md new file mode 100644 index 000000000..7f4e07b00 --- /dev/null +++ b/node_modules/loose-envify/README.md @@ -0,0 +1,45 @@ +# loose-envify + +[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) + +Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. + +## Gotchas + +* Doesn't handle broken syntax. +* Doesn't look inside embedded expressions in template strings. + - **this won't work:** + ```js + console.log(`the current env is ${process.env.NODE_ENV}`); + ``` +* Doesn't replace oddly-spaced or oddly-commented expressions. + - **this won't work:** + ```js + console.log(process./*won't*/env./*work*/NODE_ENV); + ``` + +## Usage/Options + +loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. + +## Benchmark + +``` +envify: + + $ for i in {1..5}; do node bench/bench.js 'envify'; done + 708ms + 727ms + 791ms + 719ms + 720ms + +loose-envify: + + $ for i in {1..5}; do node bench/bench.js '../'; done + 51ms + 52ms + 52ms + 52ms + 52ms +``` diff --git a/node_modules/loose-envify/cli.js b/node_modules/loose-envify/cli.js new file mode 100644 index 000000000..c0b63cb1d --- /dev/null +++ b/node_modules/loose-envify/cli.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; + +var looseEnvify = require('./'); +var fs = require('fs'); + +if (process.argv[2]) { + fs.createReadStream(process.argv[2], {encoding: 'utf8'}) + .pipe(looseEnvify(process.argv[2])) + .pipe(process.stdout); +} else { + process.stdin.resume() + process.stdin + .pipe(looseEnvify(__filename)) + .pipe(process.stdout); +} diff --git a/node_modules/loose-envify/custom.js b/node_modules/loose-envify/custom.js new file mode 100644 index 000000000..6389bfac5 --- /dev/null +++ b/node_modules/loose-envify/custom.js @@ -0,0 +1,4 @@ +// envify compatibility +'use strict'; + +module.exports = require('./loose-envify'); diff --git a/node_modules/loose-envify/index.js b/node_modules/loose-envify/index.js new file mode 100644 index 000000000..8cd8305dd --- /dev/null +++ b/node_modules/loose-envify/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./loose-envify')(process.env); diff --git a/node_modules/loose-envify/loose-envify.js b/node_modules/loose-envify/loose-envify.js new file mode 100644 index 000000000..b5a5be220 --- /dev/null +++ b/node_modules/loose-envify/loose-envify.js @@ -0,0 +1,36 @@ +'use strict'; + +var stream = require('stream'); +var util = require('util'); +var replace = require('./replace'); + +var jsonExtRe = /\.json$/; + +module.exports = function(rootEnv) { + rootEnv = rootEnv || process.env; + return function (file, trOpts) { + if (jsonExtRe.test(file)) { + return stream.PassThrough(); + } + var envs = trOpts ? [rootEnv, trOpts] : [rootEnv]; + return new LooseEnvify(envs); + }; +}; + +function LooseEnvify(envs) { + stream.Transform.call(this); + this._data = ''; + this._envs = envs; +} +util.inherits(LooseEnvify, stream.Transform); + +LooseEnvify.prototype._transform = function(buf, enc, cb) { + this._data += buf; + cb(); +}; + +LooseEnvify.prototype._flush = function(cb) { + var replaced = replace(this._data, this._envs); + this.push(replaced); + cb(); +}; diff --git a/node_modules/loose-envify/package.json b/node_modules/loose-envify/package.json new file mode 100644 index 000000000..5e3d0e277 --- /dev/null +++ b/node_modules/loose-envify/package.json @@ -0,0 +1,36 @@ +{ + "name": "loose-envify", + "version": "1.4.0", + "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST", + "keywords": [ + "environment", + "variables", + "browserify", + "browserify-transform", + "transform", + "source", + "configuration" + ], + "homepage": "https://github.com/zertosh/loose-envify", + "license": "MIT", + "author": "Andres Suarez ", + "main": "index.js", + "bin": { + "loose-envify": "cli.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/zertosh/loose-envify.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "devDependencies": { + "browserify": "^13.1.1", + "envify": "^3.4.0", + "tap": "^8.0.0" + } +} diff --git a/node_modules/loose-envify/replace.js b/node_modules/loose-envify/replace.js new file mode 100644 index 000000000..ec15e81c2 --- /dev/null +++ b/node_modules/loose-envify/replace.js @@ -0,0 +1,65 @@ +'use strict'; + +var jsTokens = require('js-tokens').default; + +var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/; +var spaceOrCommentRe = /^(?:\s|\/[/*])/; + +function replace(src, envs) { + if (!processEnvRe.test(src)) { + return src; + } + + var out = []; + var purge = envs.some(function(env) { + return env._ && env._.indexOf('purge') !== -1; + }); + + jsTokens.lastIndex = 0 + var parts = src.match(jsTokens); + + for (var i = 0; i < parts.length; i++) { + if (parts[i ] === 'process' && + parts[i + 1] === '.' && + parts[i + 2] === 'env' && + parts[i + 3] === '.') { + var prevCodeToken = getAdjacentCodeToken(-1, parts, i); + var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4); + var replacement = getReplacementString(envs, parts[i + 4], purge); + if (prevCodeToken !== '.' && + nextCodeToken !== '.' && + nextCodeToken !== '=' && + typeof replacement === 'string') { + out.push(replacement); + i += 4; + continue; + } + } + out.push(parts[i]); + } + + return out.join(''); +} + +function getAdjacentCodeToken(dir, parts, i) { + while (true) { + var part = parts[i += dir]; + if (!spaceOrCommentRe.test(part)) { + return part; + } + } +} + +function getReplacementString(envs, name, purge) { + for (var j = 0; j < envs.length; j++) { + var env = envs[j]; + if (typeof env[name] !== 'undefined') { + return JSON.stringify(env[name]); + } + } + if (purge) { + return 'undefined'; + } +} + +module.exports = replace; diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 000000000..0930cf889 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 000000000..503eb1e6d --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 000000000..1be09d35c --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/optimism/LICENSE b/node_modules/optimism/LICENSE new file mode 100644 index 000000000..d56df8489 --- /dev/null +++ b/node_modules/optimism/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Ben Newman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/optimism/README.md b/node_modules/optimism/README.md new file mode 100644 index 000000000..96a17f66a --- /dev/null +++ b/node_modules/optimism/README.md @@ -0,0 +1,3 @@ +# optimism   [![Build Status](https://travis-ci.org/benjamn/optimism.svg?branch=master)](https://travis-ci.org/benjamn/optimism) [![Greenkeeper badge](https://badges.greenkeeper.io/benjamn/optimism.svg)](https://greenkeeper.io/) + +Composable reactive caching with efficient invalidation. diff --git a/node_modules/optimism/lib/bundle.cjs.js b/node_modules/optimism/lib/bundle.cjs.js new file mode 100644 index 000000000..ae6a0fbd8 --- /dev/null +++ b/node_modules/optimism/lib/bundle.cjs.js @@ -0,0 +1,512 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var context = require('@wry/context'); + +function defaultDispose() { } +var Cache = /** @class */ (function () { + function Cache(max, dispose) { + if (max === void 0) { max = Infinity; } + if (dispose === void 0) { dispose = defaultDispose; } + this.max = max; + this.dispose = dispose; + this.map = new Map(); + this.newest = null; + this.oldest = null; + } + Cache.prototype.has = function (key) { + return this.map.has(key); + }; + Cache.prototype.get = function (key) { + var entry = this.getEntry(key); + return entry && entry.value; + }; + Cache.prototype.getEntry = function (key) { + var entry = this.map.get(key); + if (entry && entry !== this.newest) { + var older = entry.older, newer = entry.newer; + if (newer) { + newer.older = older; + } + if (older) { + older.newer = newer; + } + entry.older = this.newest; + entry.older.newer = entry; + entry.newer = null; + this.newest = entry; + if (entry === this.oldest) { + this.oldest = newer; + } + } + return entry; + }; + Cache.prototype.set = function (key, value) { + var entry = this.getEntry(key); + if (entry) { + return entry.value = value; + } + entry = { + key: key, + value: value, + newer: null, + older: this.newest + }; + if (this.newest) { + this.newest.newer = entry; + } + this.newest = entry; + this.oldest = this.oldest || entry; + this.map.set(key, entry); + return entry.value; + }; + Cache.prototype.clean = function () { + while (this.oldest && this.map.size > this.max) { + this.delete(this.oldest.key); + } + }; + Cache.prototype.delete = function (key) { + var entry = this.map.get(key); + if (entry) { + if (entry === this.newest) { + this.newest = entry.older; + } + if (entry === this.oldest) { + this.oldest = entry.newer; + } + if (entry.newer) { + entry.newer.older = entry.older; + } + if (entry.older) { + entry.older.newer = entry.newer; + } + this.map.delete(key); + this.dispose(entry.value, key); + return true; + } + return false; + }; + return Cache; +}()); + +var parentEntrySlot = new context.Slot(); + +var UNKNOWN_VALUE = Object.create(null); +var reusableEmptyArray = []; +var emptySetPool = []; +var POOL_TARGET_SIZE = 100; +// Since this package might be used browsers, we should avoid using the +// Node built-in assert module. +function assert(condition, optionalMessage) { + if (!condition) { + throw new Error(optionalMessage || "assertion failure"); + } +} +var Entry = /** @class */ (function () { + function Entry(fn, args) { + this.fn = fn; + this.args = args; + this.parents = new Set(); + this.childValues = new Map(); + // When this Entry has children that are dirty, this property becomes + // a Set containing other Entry objects, borrowed from emptySetPool. + // When the set becomes empty, it gets recycled back to emptySetPool. + this.dirtyChildren = null; + this.dirty = true; + this.recomputing = false; + this.value = UNKNOWN_VALUE; + ++Entry.count; + } + Entry.prototype.recompute = function () { + if (!rememberParent(this) && maybeReportOrphan(this)) { + // The recipient of the entry.reportOrphan callback decided to dispose + // of this orphan entry by calling entry.dispose(), so we don't need to + // (and should not) proceed with the recomputation. + return void 0; + } + return recomputeIfDirty(this); + }; + Entry.prototype.setDirty = function () { + if (this.dirty) + return; + this.dirty = true; + this.value = UNKNOWN_VALUE; + reportDirty(this); + // We can go ahead and unsubscribe here, since any further dirty + // notifications we receive will be redundant, and unsubscribing may + // free up some resources, e.g. file watchers. + maybeUnsubscribe(this); + }; + Entry.prototype.dispose = function () { + var _this = this; + forgetChildren(this).forEach(maybeReportOrphan); + maybeUnsubscribe(this); + // Because this entry has been kicked out of the cache (in index.js), + // we've lost the ability to find out if/when this entry becomes dirty, + // whether that happens through a subscription, because of a direct call + // to entry.setDirty(), or because one of its children becomes dirty. + // Because of this loss of future information, we have to assume the + // worst (that this entry might have become dirty very soon), so we must + // immediately mark this entry's parents as dirty. Normally we could + // just call entry.setDirty() rather than calling parent.setDirty() for + // each parent, but that would leave this entry in parent.childValues + // and parent.dirtyChildren, which would prevent the child from being + // truly forgotten. + this.parents.forEach(function (parent) { + parent.setDirty(); + forgetChild(parent, _this); + }); + }; + Entry.count = 0; + return Entry; +}()); +function rememberParent(child) { + var parent = parentEntrySlot.getValue(); + if (parent) { + child.parents.add(parent); + if (!parent.childValues.has(child)) { + parent.childValues.set(child, UNKNOWN_VALUE); + } + if (mightBeDirty(child)) { + reportDirtyChild(parent, child); + } + else { + reportCleanChild(parent, child); + } + return parent; + } +} +// This is the most important method of the Entry API, because it +// determines whether the cached entry.value can be returned immediately, +// or must be recomputed. The overall performance of the caching system +// depends on the truth of the following observations: (1) this.dirty is +// usually false, (2) this.dirtyChildren is usually null/empty, and thus +// (3) this.value is usally returned very quickly, without recomputation. +function recomputeIfDirty(entry) { + if (entry.dirty) { + // If this Entry is explicitly dirty because someone called + // entry.setDirty(), recompute. + return reallyRecompute(entry); + } + if (mightBeDirty(entry)) { + // Get fresh values for any dirty children, and if those values + // disagree with this.childValues, mark this Entry explicitly dirty. + entry.dirtyChildren.forEach(function (child) { + assert(entry.childValues.has(child)); + try { + recomputeIfDirty(child); + } + catch (e) { + entry.setDirty(); + } + }); + if (entry.dirty) { + // If this Entry has become explicitly dirty after comparing the fresh + // values of its dirty children against this.childValues, recompute. + return reallyRecompute(entry); + } + } + assert(entry.value !== UNKNOWN_VALUE); + return entry.value; +} +function reallyRecompute(entry) { + assert(!entry.recomputing, "already recomputing"); + entry.recomputing = true; + // Since this recomputation is likely to re-remember some of this + // entry's children, we forget our children here but do not call + // maybeReportOrphan until after the recomputation finishes. + var originalChildren = forgetChildren(entry); + var threw = true; + try { + parentEntrySlot.withValue(entry, function () { + entry.value = entry.fn.apply(null, entry.args); + }); + threw = false; + } + finally { + entry.recomputing = false; + if (threw || !maybeSubscribe(entry)) { + // Mark this Entry dirty if entry.fn threw or we failed to + // resubscribe. This is important because, if we have a subscribe + // function and it failed, then we're going to miss important + // notifications about the potential dirtiness of entry.value. + entry.setDirty(); + } + else { + // If we successfully recomputed entry.value and did not fail to + // (re)subscribe, then this Entry is no longer explicitly dirty. + setClean(entry); + } + } + // Now that we've had a chance to re-remember any children that were + // involved in the recomputation, we can safely report any orphan + // children that remain. + originalChildren.forEach(maybeReportOrphan); + return entry.value; +} +function mightBeDirty(entry) { + return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size); +} +function setClean(entry) { + entry.dirty = false; + if (mightBeDirty(entry)) { + // This Entry may still have dirty children, in which case we can't + // let our parents know we're clean just yet. + return; + } + reportClean(entry); +} +function reportDirty(child) { + child.parents.forEach(function (parent) { return reportDirtyChild(parent, child); }); +} +function reportClean(child) { + child.parents.forEach(function (parent) { return reportCleanChild(parent, child); }); +} +// Let a parent Entry know that one of its children may be dirty. +function reportDirtyChild(parent, child) { + // Must have called rememberParent(child) before calling + // reportDirtyChild(parent, child). + assert(parent.childValues.has(child)); + assert(mightBeDirty(child)); + if (!parent.dirtyChildren) { + parent.dirtyChildren = emptySetPool.pop() || new Set; + } + else if (parent.dirtyChildren.has(child)) { + // If we already know this child is dirty, then we must have already + // informed our own parents that we are dirty, so we can terminate + // the recursion early. + return; + } + parent.dirtyChildren.add(child); + reportDirty(parent); +} +// Let a parent Entry know that one of its children is no longer dirty. +function reportCleanChild(parent, child) { + // Must have called rememberChild(child) before calling + // reportCleanChild(parent, child). + assert(parent.childValues.has(child)); + assert(!mightBeDirty(child)); + var childValue = parent.childValues.get(child); + if (childValue === UNKNOWN_VALUE) { + parent.childValues.set(child, child.value); + } + else if (childValue !== child.value) { + parent.setDirty(); + } + removeDirtyChild(parent, child); + if (mightBeDirty(parent)) { + return; + } + reportClean(parent); +} +function removeDirtyChild(parent, child) { + var dc = parent.dirtyChildren; + if (dc) { + dc.delete(child); + if (dc.size === 0) { + if (emptySetPool.length < POOL_TARGET_SIZE) { + emptySetPool.push(dc); + } + parent.dirtyChildren = null; + } + } +} +// If the given entry has a reportOrphan method, and no remaining parents, +// call entry.reportOrphan and return true iff it returns true. The +// reportOrphan function should return true to indicate entry.dispose() +// has been called, and the entry has been removed from any other caches +// (see index.js for the only current example). +function maybeReportOrphan(entry) { + return entry.parents.size === 0 && + typeof entry.reportOrphan === "function" && + entry.reportOrphan() === true; +} +// Removes all children from this entry and returns an array of the +// removed children. +function forgetChildren(parent) { + var children = reusableEmptyArray; + if (parent.childValues.size > 0) { + children = []; + parent.childValues.forEach(function (value, child) { + forgetChild(parent, child); + children.push(child); + }); + } + // After we forget all our children, this.dirtyChildren must be empty + // and therefore must have been reset to null. + assert(parent.dirtyChildren === null); + return children; +} +function forgetChild(parent, child) { + child.parents.delete(parent); + parent.childValues.delete(child); + removeDirtyChild(parent, child); +} +function maybeSubscribe(entry) { + if (typeof entry.subscribe === "function") { + try { + maybeUnsubscribe(entry); // Prevent double subscriptions. + entry.unsubscribe = entry.subscribe.apply(null, entry.args); + } + catch (e) { + // If this Entry has a subscribe function and it threw an exception + // (or an unsubscribe function it previously returned now throws), + // return false to indicate that we were not able to subscribe (or + // unsubscribe), and this Entry should remain dirty. + entry.setDirty(); + return false; + } + } + // Returning true indicates either that there was no entry.subscribe + // function or that it succeeded. + return true; +} +function maybeUnsubscribe(entry) { + var unsubscribe = entry.unsubscribe; + if (typeof unsubscribe === "function") { + entry.unsubscribe = void 0; + unsubscribe(); + } +} + +// A trie data structure that holds object keys weakly, yet can also hold +// non-object keys, unlike the native `WeakMap`. +var KeyTrie = /** @class */ (function () { + function KeyTrie(weakness) { + this.weakness = weakness; + } + KeyTrie.prototype.lookup = function () { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i] = arguments[_i]; + } + return this.lookupArray(array); + }; + KeyTrie.prototype.lookupArray = function (array) { + var node = this; + array.forEach(function (key) { return node = node.getChildTrie(key); }); + return node.data || (node.data = Object.create(null)); + }; + KeyTrie.prototype.getChildTrie = function (key) { + var map = this.weakness && isObjRef(key) + ? this.weak || (this.weak = new WeakMap()) + : this.strong || (this.strong = new Map()); + var child = map.get(key); + if (!child) + map.set(key, child = new KeyTrie(this.weakness)); + return child; + }; + return KeyTrie; +}()); +function isObjRef(value) { + switch (typeof value) { + case "object": + if (value === null) + break; + // Fall through to return true... + case "function": + return true; + } + return false; +} + +// The defaultMakeCacheKey function is remarkably powerful, because it gives +// a unique object for any shallow-identical list of arguments. If you need +// to implement a custom makeCacheKey function, you may find it helpful to +// delegate the final work to defaultMakeCacheKey, which is why we export it +// here. However, you may want to avoid defaultMakeCacheKey if your runtime +// does not support WeakMap, or you have the ability to return a string key. +// In those cases, just write your own custom makeCacheKey functions. +var keyTrie = new KeyTrie(typeof WeakMap === "function"); +function defaultMakeCacheKey() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return keyTrie.lookupArray(args); +} +function wrap(originalFunction, options) { + if (options === void 0) { options = Object.create(null); } + var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); }); + var disposable = !!options.disposable; + var makeCacheKey = options.makeCacheKey || defaultMakeCacheKey; + function optimistic() { + if (disposable && !parentEntrySlot.hasValue()) { + // If there's no current parent computation, and this wrapped + // function is disposable (meaning we don't care about entry.value, + // just dependency tracking), then we can short-cut everything else + // in this function, because entry.recompute() is going to recycle + // the entry object without recomputing anything, anyway. + return void 0; + } + var key = makeCacheKey.apply(null, arguments); + if (!key) { + return originalFunction.apply(null, arguments); + } + var args = Array.prototype.slice.call(arguments); + var entry = cache.get(key); + if (entry) { + entry.args = args; + } + else { + entry = new Entry(originalFunction, args); + cache.set(key, entry); + entry.subscribe = options.subscribe; + if (disposable) { + entry.reportOrphan = function () { return cache.delete(key); }; + } + } + var value = entry.recompute(); + // Move this entry to the front of the least-recently used queue, + // since we just finished computing its value. + cache.set(key, entry); + // Clean up any excess entries in the cache, but only if there is no + // active parent entry, meaning we're not in the middle of a larger + // computation that might be flummoxed by the cleaning. + if (!parentEntrySlot.hasValue()) { + cache.clean(); + } + // If options.disposable is truthy, the caller of wrap is telling us + // they don't care about the result of entry.recompute(), so we should + // avoid returning the value, so it won't be accidentally used. + return disposable ? void 0 : value; + } + optimistic.dirty = function () { + var key = makeCacheKey.apply(null, arguments); + var child = key && cache.get(key); + if (child) { + child.setDirty(); + } + }; + return optimistic; +} + +Object.defineProperty(exports, 'asyncFromGen', { + enumerable: true, + get: function () { + return context.asyncFromGen; + } +}); +Object.defineProperty(exports, 'bindContext', { + enumerable: true, + get: function () { + return context.bind; + } +}); +Object.defineProperty(exports, 'noContext', { + enumerable: true, + get: function () { + return context.noContext; + } +}); +Object.defineProperty(exports, 'setTimeout', { + enumerable: true, + get: function () { + return context.setTimeout; + } +}); +exports.KeyTrie = KeyTrie; +exports.defaultMakeCacheKey = defaultMakeCacheKey; +exports.wrap = wrap; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/optimism/lib/bundle.cjs.js.map b/node_modules/optimism/lib/bundle.cjs.js.map new file mode 100644 index 000000000..b10629db6 --- /dev/null +++ b/node_modules/optimism/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs.js","sources":["../src/cache.ts","../src/context.ts","../src/entry.ts","../src/key-trie.ts","../src/index.ts"],"sourcesContent":["interface Node {\n key: K;\n value: V;\n newer: Node | null;\n older: Node | null;\n}\n\nfunction defaultDispose() {}\n\nexport class Cache {\n private map = new Map>();\n private newest: Node | null = null;\n private oldest: Node | null = null;\n\n constructor(\n private max = Infinity,\n public dispose: (value: V, key: K) => void = defaultDispose,\n ) {}\n\n public has(key: K) {\n return this.map.has(key);\n }\n\n public get(key: K) {\n const entry = this.getEntry(key);\n return entry && entry.value;\n }\n\n private getEntry(key: K): Node | void {\n const entry = this.map.get(key);\n\n if (entry && entry !== this.newest) {\n const { older, newer } = entry;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = this.newest;\n entry.older!.newer = entry;\n\n entry.newer = null;\n this.newest = entry;\n\n if (entry === this.oldest) {\n this.oldest = newer;\n }\n }\n\n return entry;\n }\n\n public set(key: K, value: V) {\n let entry = this.getEntry(key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n }\n\n public clean() {\n while (this.oldest && this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n\n public delete(key: K) {\n const entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n this.dispose(entry.value, key);\n\n return true;\n }\n\n return false;\n }\n}\n","import { AnyEntry } from \"./entry\";\nimport { Slot } from \"@wry/context\";\n\nexport const parentEntrySlot = new Slot();\n\nexport {\n bind as bindContext,\n noContext,\n setTimeout,\n asyncFromGen,\n} from \"@wry/context\";\n","import { parentEntrySlot } from \"./context\";\nimport { OptimisticWrapOptions } from \"./index\";\n\nconst UNKNOWN_VALUE = Object.create(null);\nconst reusableEmptyArray: AnyEntry[] = [];\nconst emptySetPool: Set[] = [];\nconst POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition: any, optionalMessage?: string) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nexport type AnyEntry = Entry;\n\nexport class Entry {\n public static count = 0;\n\n public subscribe: OptimisticWrapOptions[\"subscribe\"];\n public unsubscribe?: () => any;\n public reportOrphan?: (this: Entry) => any;\n\n public readonly parents = new Set();\n public readonly childValues = new Map();\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n public dirtyChildren: Set | null = null;\n\n public dirty = true;\n public recomputing = false;\n public value: TValue = UNKNOWN_VALUE;\n\n constructor(\n public readonly fn: (...args: TArgs) => TValue,\n public args: TArgs,\n ) {\n ++Entry.count;\n }\n\n public recompute(): TValue {\n if (! rememberParent(this) && maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispose(), so we don't need to\n // (and should not) proceed with the recomputation.\n return void 0 as any;\n }\n\n return recomputeIfDirty(this);\n }\n\n public setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n maybeUnsubscribe(this);\n }\n\n public dispose() {\n forgetChildren(this).forEach(maybeReportOrphan);\n maybeUnsubscribe(this);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n this.parents.forEach(parent => {\n parent.setDirty();\n forgetChild(parent, this);\n });\n }\n}\n\nfunction rememberParent(child: AnyEntry) {\n const parent = parentEntrySlot.getValue();\n if (parent) {\n child.parents.add(parent);\n\n if (! parent.childValues.has(child)) {\n parent.childValues.set(child, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(child)) {\n reportDirtyChild(parent, child);\n } else {\n reportCleanChild(parent, child);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry: AnyEntry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren!.forEach(child => {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry: AnyEntry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n const originalChildren = forgetChildren(entry);\n\n let threw = true;\n try {\n parentEntrySlot.withValue(entry, () => {\n entry.value = entry.fn.apply(null, entry.args);\n });\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n if (threw || ! maybeSubscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nfunction mightBeDirty(entry: AnyEntry) {\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\n}\n\nfunction setClean(entry: AnyEntry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(child: AnyEntry) {\n child.parents.forEach(parent => reportDirtyChild(parent, child));\n}\n\nfunction reportClean(child: AnyEntry) {\n child.parents.forEach(parent => reportCleanChild(parent, child));\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(parent.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! parent.dirtyChildren) {\n parent.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (parent.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n parent.dirtyChildren.add(child);\n reportDirty(parent);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(parent.childValues.has(child));\n assert(! mightBeDirty(child));\n\n const childValue = parent.childValues.get(child);\n if (childValue === UNKNOWN_VALUE) {\n parent.childValues.set(child, child.value);\n } else if (childValue !== child.value) {\n parent.setDirty();\n }\n\n removeDirtyChild(parent, child);\n\n if (mightBeDirty(parent)) {\n return;\n }\n\n reportClean(parent);\n}\n\nfunction removeDirtyChild(parent: AnyEntry, child: AnyEntry) {\n const dc = parent.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n parent.dirtyChildren = null;\n }\n }\n}\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry: AnyEntry) {\n return entry.parents.size === 0 &&\n typeof entry.reportOrphan === \"function\" &&\n entry.reportOrphan() === true;\n}\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(parent: AnyEntry) {\n let children = reusableEmptyArray;\n\n if (parent.childValues.size > 0) {\n children = [];\n parent.childValues.forEach((value, child) => {\n forgetChild(parent, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefore must have been reset to null.\n assert(parent.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(parent: AnyEntry, child: AnyEntry) {\n child.parents.delete(parent);\n parent.childValues.delete(child);\n removeDirtyChild(parent, child);\n}\n\nfunction maybeSubscribe(entry: AnyEntry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n maybeUnsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction maybeUnsubscribe(entry: AnyEntry) {\n const { unsubscribe } = entry;\n if (typeof unsubscribe === \"function\") {\n entry.unsubscribe = void 0;\n unsubscribe();\n }\n}\n","// A trie data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nexport class KeyTrie {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n private weak?: WeakMap>;\n private strong?: Map>;\n private data?: K;\n\n constructor(private readonly weakness: boolean) {}\n\n public lookup(...array: T): K {\n return this.lookupArray(array);\n }\n\n public lookupArray(array: T): K {\n let node: KeyTrie = this;\n array.forEach(key => node = node.getChildTrie(key));\n return node.data || (node.data = Object.create(null));\n }\n\n private getChildTrie(key: any) {\n const map = this.weakness && isObjRef(key)\n ? this.weak || (this.weak = new WeakMap>())\n : this.strong || (this.strong = new Map>());\n let child = map.get(key);\n if (!child) map.set(key, child = new KeyTrie(this.weakness));\n return child;\n }\n}\n\nfunction isObjRef(value: any) {\n switch (typeof value) {\n case \"object\":\n if (value === null) break;\n // Fall through to return true...\n case \"function\":\n return true;\n }\n return false;\n}\n","import { Cache } from \"./cache\";\nimport { Entry } from \"./entry\";\nimport { parentEntrySlot } from \"./context\";\nimport { KeyTrie } from \"./key-trie\";\n\n// These helper functions are important for making optimism work with\n// asynchronous code. In order to register parent-child dependencies,\n// optimism needs to know about any currently active parent computations.\n// In ordinary synchronous code, the parent context is implicit in the\n// execution stack, but asynchronous code requires some extra guidance in\n// order to propagate context from one async task segment to the next.\nexport {\n bindContext,\n noContext,\n setTimeout,\n asyncFromGen,\n} from \"./context\";\n\n// Since the Cache uses a Map internally, any value or object reference can\n// be safely used as a key, though common types include object and string.\nexport type TCacheKey = any;\n\n// The defaultMakeCacheKey function is remarkably powerful, because it gives\n// a unique object for any shallow-identical list of arguments. If you need\n// to implement a custom makeCacheKey function, you may find it helpful to\n// delegate the final work to defaultMakeCacheKey, which is why we export it\n// here. However, you may want to avoid defaultMakeCacheKey if your runtime\n// does not support WeakMap, or you have the ability to return a string key.\n// In those cases, just write your own custom makeCacheKey functions.\nconst keyTrie = new KeyTrie(typeof WeakMap === \"function\");\nexport function defaultMakeCacheKey(...args: any[]) {\n return keyTrie.lookupArray(args);\n}\n\n// If you're paranoid about memory leaks, or you want to avoid using WeakMap\n// under the hood, but you still need the behavior of defaultMakeCacheKey,\n// import this constructor to create your own tries.\nexport { KeyTrie }\n\nexport type OptimisticWrapperFunction<\n TArgs extends any[],\n TResult,\n> = ((...args: TArgs) => TResult) & {\n // The .dirty(...) method of an optimistic function takes exactly the\n // same parameter types as the original function.\n dirty: (...args: TArgs) => void;\n};\n\nexport type OptimisticWrapOptions = {\n // The maximum number of cache entries that should be retained before the\n // cache begins evicting the oldest ones.\n max?: number;\n // If a wrapped function is \"disposable,\" then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n disposable?: boolean;\n // The makeCacheKey function takes the same arguments that were passed to\n // the wrapper function and returns a single value that can be used as a key\n // in a Map to identify the cached result.\n makeCacheKey?: (...args: TArgs) => TCacheKey;\n // If provided, the subscribe function should either return an unsubscribe\n // function or return nothing.\n subscribe?: (...args: TArgs) => (() => any) | undefined;\n};\n\nexport function wrap<\n TArgs extends any[],\n TResult,\n>(\n originalFunction: (...args: TArgs) => TResult,\n options: OptimisticWrapOptions = Object.create(null),\n) {\n const cache = new Cache>(\n options.max || Math.pow(2, 16),\n entry => entry.dispose(),\n );\n\n const disposable = !! options.disposable;\n const makeCacheKey = options.makeCacheKey || defaultMakeCacheKey;\n\n function optimistic(): TResult {\n if (disposable && ! parentEntrySlot.hasValue()) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return void 0 as any;\n }\n\n const key = makeCacheKey.apply(null, arguments as any);\n if (! key) {\n return originalFunction.apply(null, arguments as any);\n }\n\n const args = Array.prototype.slice.call(arguments) as TArgs;\n\n let entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n entry = new Entry(originalFunction, args);\n cache.set(key, entry);\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = () => cache.delete(key);\n }\n }\n\n const value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if there is no\n // active parent entry, meaning we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (! parentEntrySlot.hasValue()) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n return disposable ? void 0 as any : value;\n }\n\n optimistic.dirty = function () {\n const key = makeCacheKey.apply(null, arguments as any);\n const child = key && cache.get(key);\n if (child) {\n child.setDirty();\n }\n };\n\n return optimistic as OptimisticWrapperFunction;\n}\n"],"names":["Slot"],"mappings":";;;;;;AAOA,SAAS,cAAc,MAAK;AAE5B;IAKE,eACU,GAAc,EACf,OAAoD;QADnD,oBAAA,EAAA,cAAc;QACf,wBAAA,EAAA,wBAAoD;QADnD,QAAG,GAAH,GAAG,CAAW;QACf,YAAO,GAAP,OAAO,CAA6C;QANrD,QAAG,GAAG,IAAI,GAAG,EAAiB,CAAC;QAC/B,WAAM,GAAsB,IAAI,CAAC;QACjC,WAAM,GAAsB,IAAI,CAAC;KAKrC;IAEG,mBAAG,GAAV,UAAW,GAAM;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC1B;IAEM,mBAAG,GAAV,UAAW,GAAM;QACf,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC;KAC7B;IAEO,wBAAQ,GAAhB,UAAiB,GAAM;QACrB,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE;YAC1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,CAAC;QACvD,IAAM,KAAK,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,QAAQ,EAAE,CAAC;SAClB;KACF,CAAC;IAEF,OAAO,UAAuD,CAAC;CAChE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/optimism/lib/bundle.esm.js b/node_modules/optimism/lib/bundle.esm.js new file mode 100644 index 000000000..790475b44 --- /dev/null +++ b/node_modules/optimism/lib/bundle.esm.js @@ -0,0 +1,483 @@ +import { Slot } from '@wry/context'; +export { asyncFromGen, bind as bindContext, noContext, setTimeout } from '@wry/context'; + +function defaultDispose() { } +var Cache = /** @class */ (function () { + function Cache(max, dispose) { + if (max === void 0) { max = Infinity; } + if (dispose === void 0) { dispose = defaultDispose; } + this.max = max; + this.dispose = dispose; + this.map = new Map(); + this.newest = null; + this.oldest = null; + } + Cache.prototype.has = function (key) { + return this.map.has(key); + }; + Cache.prototype.get = function (key) { + var entry = this.getEntry(key); + return entry && entry.value; + }; + Cache.prototype.getEntry = function (key) { + var entry = this.map.get(key); + if (entry && entry !== this.newest) { + var older = entry.older, newer = entry.newer; + if (newer) { + newer.older = older; + } + if (older) { + older.newer = newer; + } + entry.older = this.newest; + entry.older.newer = entry; + entry.newer = null; + this.newest = entry; + if (entry === this.oldest) { + this.oldest = newer; + } + } + return entry; + }; + Cache.prototype.set = function (key, value) { + var entry = this.getEntry(key); + if (entry) { + return entry.value = value; + } + entry = { + key: key, + value: value, + newer: null, + older: this.newest + }; + if (this.newest) { + this.newest.newer = entry; + } + this.newest = entry; + this.oldest = this.oldest || entry; + this.map.set(key, entry); + return entry.value; + }; + Cache.prototype.clean = function () { + while (this.oldest && this.map.size > this.max) { + this.delete(this.oldest.key); + } + }; + Cache.prototype.delete = function (key) { + var entry = this.map.get(key); + if (entry) { + if (entry === this.newest) { + this.newest = entry.older; + } + if (entry === this.oldest) { + this.oldest = entry.newer; + } + if (entry.newer) { + entry.newer.older = entry.older; + } + if (entry.older) { + entry.older.newer = entry.newer; + } + this.map.delete(key); + this.dispose(entry.value, key); + return true; + } + return false; + }; + return Cache; +}()); + +var parentEntrySlot = new Slot(); + +var UNKNOWN_VALUE = Object.create(null); +var reusableEmptyArray = []; +var emptySetPool = []; +var POOL_TARGET_SIZE = 100; +// Since this package might be used browsers, we should avoid using the +// Node built-in assert module. +function assert(condition, optionalMessage) { + if (!condition) { + throw new Error(optionalMessage || "assertion failure"); + } +} +var Entry = /** @class */ (function () { + function Entry(fn, args) { + this.fn = fn; + this.args = args; + this.parents = new Set(); + this.childValues = new Map(); + // When this Entry has children that are dirty, this property becomes + // a Set containing other Entry objects, borrowed from emptySetPool. + // When the set becomes empty, it gets recycled back to emptySetPool. + this.dirtyChildren = null; + this.dirty = true; + this.recomputing = false; + this.value = UNKNOWN_VALUE; + ++Entry.count; + } + Entry.prototype.recompute = function () { + if (!rememberParent(this) && maybeReportOrphan(this)) { + // The recipient of the entry.reportOrphan callback decided to dispose + // of this orphan entry by calling entry.dispose(), so we don't need to + // (and should not) proceed with the recomputation. + return void 0; + } + return recomputeIfDirty(this); + }; + Entry.prototype.setDirty = function () { + if (this.dirty) + return; + this.dirty = true; + this.value = UNKNOWN_VALUE; + reportDirty(this); + // We can go ahead and unsubscribe here, since any further dirty + // notifications we receive will be redundant, and unsubscribing may + // free up some resources, e.g. file watchers. + maybeUnsubscribe(this); + }; + Entry.prototype.dispose = function () { + var _this = this; + forgetChildren(this).forEach(maybeReportOrphan); + maybeUnsubscribe(this); + // Because this entry has been kicked out of the cache (in index.js), + // we've lost the ability to find out if/when this entry becomes dirty, + // whether that happens through a subscription, because of a direct call + // to entry.setDirty(), or because one of its children becomes dirty. + // Because of this loss of future information, we have to assume the + // worst (that this entry might have become dirty very soon), so we must + // immediately mark this entry's parents as dirty. Normally we could + // just call entry.setDirty() rather than calling parent.setDirty() for + // each parent, but that would leave this entry in parent.childValues + // and parent.dirtyChildren, which would prevent the child from being + // truly forgotten. + this.parents.forEach(function (parent) { + parent.setDirty(); + forgetChild(parent, _this); + }); + }; + Entry.count = 0; + return Entry; +}()); +function rememberParent(child) { + var parent = parentEntrySlot.getValue(); + if (parent) { + child.parents.add(parent); + if (!parent.childValues.has(child)) { + parent.childValues.set(child, UNKNOWN_VALUE); + } + if (mightBeDirty(child)) { + reportDirtyChild(parent, child); + } + else { + reportCleanChild(parent, child); + } + return parent; + } +} +// This is the most important method of the Entry API, because it +// determines whether the cached entry.value can be returned immediately, +// or must be recomputed. The overall performance of the caching system +// depends on the truth of the following observations: (1) this.dirty is +// usually false, (2) this.dirtyChildren is usually null/empty, and thus +// (3) this.value is usally returned very quickly, without recomputation. +function recomputeIfDirty(entry) { + if (entry.dirty) { + // If this Entry is explicitly dirty because someone called + // entry.setDirty(), recompute. + return reallyRecompute(entry); + } + if (mightBeDirty(entry)) { + // Get fresh values for any dirty children, and if those values + // disagree with this.childValues, mark this Entry explicitly dirty. + entry.dirtyChildren.forEach(function (child) { + assert(entry.childValues.has(child)); + try { + recomputeIfDirty(child); + } + catch (e) { + entry.setDirty(); + } + }); + if (entry.dirty) { + // If this Entry has become explicitly dirty after comparing the fresh + // values of its dirty children against this.childValues, recompute. + return reallyRecompute(entry); + } + } + assert(entry.value !== UNKNOWN_VALUE); + return entry.value; +} +function reallyRecompute(entry) { + assert(!entry.recomputing, "already recomputing"); + entry.recomputing = true; + // Since this recomputation is likely to re-remember some of this + // entry's children, we forget our children here but do not call + // maybeReportOrphan until after the recomputation finishes. + var originalChildren = forgetChildren(entry); + var threw = true; + try { + parentEntrySlot.withValue(entry, function () { + entry.value = entry.fn.apply(null, entry.args); + }); + threw = false; + } + finally { + entry.recomputing = false; + if (threw || !maybeSubscribe(entry)) { + // Mark this Entry dirty if entry.fn threw or we failed to + // resubscribe. This is important because, if we have a subscribe + // function and it failed, then we're going to miss important + // notifications about the potential dirtiness of entry.value. + entry.setDirty(); + } + else { + // If we successfully recomputed entry.value and did not fail to + // (re)subscribe, then this Entry is no longer explicitly dirty. + setClean(entry); + } + } + // Now that we've had a chance to re-remember any children that were + // involved in the recomputation, we can safely report any orphan + // children that remain. + originalChildren.forEach(maybeReportOrphan); + return entry.value; +} +function mightBeDirty(entry) { + return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size); +} +function setClean(entry) { + entry.dirty = false; + if (mightBeDirty(entry)) { + // This Entry may still have dirty children, in which case we can't + // let our parents know we're clean just yet. + return; + } + reportClean(entry); +} +function reportDirty(child) { + child.parents.forEach(function (parent) { return reportDirtyChild(parent, child); }); +} +function reportClean(child) { + child.parents.forEach(function (parent) { return reportCleanChild(parent, child); }); +} +// Let a parent Entry know that one of its children may be dirty. +function reportDirtyChild(parent, child) { + // Must have called rememberParent(child) before calling + // reportDirtyChild(parent, child). + assert(parent.childValues.has(child)); + assert(mightBeDirty(child)); + if (!parent.dirtyChildren) { + parent.dirtyChildren = emptySetPool.pop() || new Set; + } + else if (parent.dirtyChildren.has(child)) { + // If we already know this child is dirty, then we must have already + // informed our own parents that we are dirty, so we can terminate + // the recursion early. + return; + } + parent.dirtyChildren.add(child); + reportDirty(parent); +} +// Let a parent Entry know that one of its children is no longer dirty. +function reportCleanChild(parent, child) { + // Must have called rememberChild(child) before calling + // reportCleanChild(parent, child). + assert(parent.childValues.has(child)); + assert(!mightBeDirty(child)); + var childValue = parent.childValues.get(child); + if (childValue === UNKNOWN_VALUE) { + parent.childValues.set(child, child.value); + } + else if (childValue !== child.value) { + parent.setDirty(); + } + removeDirtyChild(parent, child); + if (mightBeDirty(parent)) { + return; + } + reportClean(parent); +} +function removeDirtyChild(parent, child) { + var dc = parent.dirtyChildren; + if (dc) { + dc.delete(child); + if (dc.size === 0) { + if (emptySetPool.length < POOL_TARGET_SIZE) { + emptySetPool.push(dc); + } + parent.dirtyChildren = null; + } + } +} +// If the given entry has a reportOrphan method, and no remaining parents, +// call entry.reportOrphan and return true iff it returns true. The +// reportOrphan function should return true to indicate entry.dispose() +// has been called, and the entry has been removed from any other caches +// (see index.js for the only current example). +function maybeReportOrphan(entry) { + return entry.parents.size === 0 && + typeof entry.reportOrphan === "function" && + entry.reportOrphan() === true; +} +// Removes all children from this entry and returns an array of the +// removed children. +function forgetChildren(parent) { + var children = reusableEmptyArray; + if (parent.childValues.size > 0) { + children = []; + parent.childValues.forEach(function (value, child) { + forgetChild(parent, child); + children.push(child); + }); + } + // After we forget all our children, this.dirtyChildren must be empty + // and therefore must have been reset to null. + assert(parent.dirtyChildren === null); + return children; +} +function forgetChild(parent, child) { + child.parents.delete(parent); + parent.childValues.delete(child); + removeDirtyChild(parent, child); +} +function maybeSubscribe(entry) { + if (typeof entry.subscribe === "function") { + try { + maybeUnsubscribe(entry); // Prevent double subscriptions. + entry.unsubscribe = entry.subscribe.apply(null, entry.args); + } + catch (e) { + // If this Entry has a subscribe function and it threw an exception + // (or an unsubscribe function it previously returned now throws), + // return false to indicate that we were not able to subscribe (or + // unsubscribe), and this Entry should remain dirty. + entry.setDirty(); + return false; + } + } + // Returning true indicates either that there was no entry.subscribe + // function or that it succeeded. + return true; +} +function maybeUnsubscribe(entry) { + var unsubscribe = entry.unsubscribe; + if (typeof unsubscribe === "function") { + entry.unsubscribe = void 0; + unsubscribe(); + } +} + +// A trie data structure that holds object keys weakly, yet can also hold +// non-object keys, unlike the native `WeakMap`. +var KeyTrie = /** @class */ (function () { + function KeyTrie(weakness) { + this.weakness = weakness; + } + KeyTrie.prototype.lookup = function () { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i] = arguments[_i]; + } + return this.lookupArray(array); + }; + KeyTrie.prototype.lookupArray = function (array) { + var node = this; + array.forEach(function (key) { return node = node.getChildTrie(key); }); + return node.data || (node.data = Object.create(null)); + }; + KeyTrie.prototype.getChildTrie = function (key) { + var map = this.weakness && isObjRef(key) + ? this.weak || (this.weak = new WeakMap()) + : this.strong || (this.strong = new Map()); + var child = map.get(key); + if (!child) + map.set(key, child = new KeyTrie(this.weakness)); + return child; + }; + return KeyTrie; +}()); +function isObjRef(value) { + switch (typeof value) { + case "object": + if (value === null) + break; + // Fall through to return true... + case "function": + return true; + } + return false; +} + +// The defaultMakeCacheKey function is remarkably powerful, because it gives +// a unique object for any shallow-identical list of arguments. If you need +// to implement a custom makeCacheKey function, you may find it helpful to +// delegate the final work to defaultMakeCacheKey, which is why we export it +// here. However, you may want to avoid defaultMakeCacheKey if your runtime +// does not support WeakMap, or you have the ability to return a string key. +// In those cases, just write your own custom makeCacheKey functions. +var keyTrie = new KeyTrie(typeof WeakMap === "function"); +function defaultMakeCacheKey() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return keyTrie.lookupArray(args); +} +function wrap(originalFunction, options) { + if (options === void 0) { options = Object.create(null); } + var cache = new Cache(options.max || Math.pow(2, 16), function (entry) { return entry.dispose(); }); + var disposable = !!options.disposable; + var makeCacheKey = options.makeCacheKey || defaultMakeCacheKey; + function optimistic() { + if (disposable && !parentEntrySlot.hasValue()) { + // If there's no current parent computation, and this wrapped + // function is disposable (meaning we don't care about entry.value, + // just dependency tracking), then we can short-cut everything else + // in this function, because entry.recompute() is going to recycle + // the entry object without recomputing anything, anyway. + return void 0; + } + var key = makeCacheKey.apply(null, arguments); + if (!key) { + return originalFunction.apply(null, arguments); + } + var args = Array.prototype.slice.call(arguments); + var entry = cache.get(key); + if (entry) { + entry.args = args; + } + else { + entry = new Entry(originalFunction, args); + cache.set(key, entry); + entry.subscribe = options.subscribe; + if (disposable) { + entry.reportOrphan = function () { return cache.delete(key); }; + } + } + var value = entry.recompute(); + // Move this entry to the front of the least-recently used queue, + // since we just finished computing its value. + cache.set(key, entry); + // Clean up any excess entries in the cache, but only if there is no + // active parent entry, meaning we're not in the middle of a larger + // computation that might be flummoxed by the cleaning. + if (!parentEntrySlot.hasValue()) { + cache.clean(); + } + // If options.disposable is truthy, the caller of wrap is telling us + // they don't care about the result of entry.recompute(), so we should + // avoid returning the value, so it won't be accidentally used. + return disposable ? void 0 : value; + } + optimistic.dirty = function () { + var key = makeCacheKey.apply(null, arguments); + var child = key && cache.get(key); + if (child) { + child.setDirty(); + } + }; + return optimistic; +} + +export { KeyTrie, defaultMakeCacheKey, wrap }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/optimism/lib/bundle.esm.js.map b/node_modules/optimism/lib/bundle.esm.js.map new file mode 100644 index 000000000..7ceadea0a --- /dev/null +++ b/node_modules/optimism/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/cache.ts","../src/context.ts","../src/entry.ts","../src/key-trie.ts","../src/index.ts"],"sourcesContent":["interface Node {\n key: K;\n value: V;\n newer: Node | null;\n older: Node | null;\n}\n\nfunction defaultDispose() {}\n\nexport class Cache {\n private map = new Map>();\n private newest: Node | null = null;\n private oldest: Node | null = null;\n\n constructor(\n private max = Infinity,\n public dispose: (value: V, key: K) => void = defaultDispose,\n ) {}\n\n public has(key: K) {\n return this.map.has(key);\n }\n\n public get(key: K) {\n const entry = this.getEntry(key);\n return entry && entry.value;\n }\n\n private getEntry(key: K): Node | void {\n const entry = this.map.get(key);\n\n if (entry && entry !== this.newest) {\n const { older, newer } = entry;\n\n if (newer) {\n newer.older = older;\n }\n\n if (older) {\n older.newer = newer;\n }\n\n entry.older = this.newest;\n entry.older!.newer = entry;\n\n entry.newer = null;\n this.newest = entry;\n\n if (entry === this.oldest) {\n this.oldest = newer;\n }\n }\n\n return entry;\n }\n\n public set(key: K, value: V) {\n let entry = this.getEntry(key);\n if (entry) {\n return entry.value = value;\n }\n\n entry = {\n key: key,\n value: value,\n newer: null,\n older: this.newest\n };\n\n if (this.newest) {\n this.newest.newer = entry;\n }\n\n this.newest = entry;\n this.oldest = this.oldest || entry;\n\n this.map.set(key, entry);\n\n return entry.value;\n }\n\n public clean() {\n while (this.oldest && this.map.size > this.max) {\n this.delete(this.oldest.key);\n }\n }\n\n public delete(key: K) {\n const entry = this.map.get(key);\n if (entry) {\n if (entry === this.newest) {\n this.newest = entry.older;\n }\n\n if (entry === this.oldest) {\n this.oldest = entry.newer;\n }\n\n if (entry.newer) {\n entry.newer.older = entry.older;\n }\n\n if (entry.older) {\n entry.older.newer = entry.newer;\n }\n\n this.map.delete(key);\n this.dispose(entry.value, key);\n\n return true;\n }\n\n return false;\n }\n}\n","import { AnyEntry } from \"./entry\";\nimport { Slot } from \"@wry/context\";\n\nexport const parentEntrySlot = new Slot();\n\nexport {\n bind as bindContext,\n noContext,\n setTimeout,\n asyncFromGen,\n} from \"@wry/context\";\n","import { parentEntrySlot } from \"./context\";\nimport { OptimisticWrapOptions } from \"./index\";\n\nconst UNKNOWN_VALUE = Object.create(null);\nconst reusableEmptyArray: AnyEntry[] = [];\nconst emptySetPool: Set[] = [];\nconst POOL_TARGET_SIZE = 100;\n\n// Since this package might be used browsers, we should avoid using the\n// Node built-in assert module.\nfunction assert(condition: any, optionalMessage?: string) {\n if (! condition) {\n throw new Error(optionalMessage || \"assertion failure\");\n }\n}\n\nexport type AnyEntry = Entry;\n\nexport class Entry {\n public static count = 0;\n\n public subscribe: OptimisticWrapOptions[\"subscribe\"];\n public unsubscribe?: () => any;\n public reportOrphan?: (this: Entry) => any;\n\n public readonly parents = new Set();\n public readonly childValues = new Map();\n\n // When this Entry has children that are dirty, this property becomes\n // a Set containing other Entry objects, borrowed from emptySetPool.\n // When the set becomes empty, it gets recycled back to emptySetPool.\n public dirtyChildren: Set | null = null;\n\n public dirty = true;\n public recomputing = false;\n public value: TValue = UNKNOWN_VALUE;\n\n constructor(\n public readonly fn: (...args: TArgs) => TValue,\n public args: TArgs,\n ) {\n ++Entry.count;\n }\n\n public recompute(): TValue {\n if (! rememberParent(this) && maybeReportOrphan(this)) {\n // The recipient of the entry.reportOrphan callback decided to dispose\n // of this orphan entry by calling entry.dispose(), so we don't need to\n // (and should not) proceed with the recomputation.\n return void 0 as any;\n }\n\n return recomputeIfDirty(this);\n }\n\n public setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value = UNKNOWN_VALUE;\n reportDirty(this);\n // We can go ahead and unsubscribe here, since any further dirty\n // notifications we receive will be redundant, and unsubscribing may\n // free up some resources, e.g. file watchers.\n maybeUnsubscribe(this);\n }\n\n public dispose() {\n forgetChildren(this).forEach(maybeReportOrphan);\n maybeUnsubscribe(this);\n\n // Because this entry has been kicked out of the cache (in index.js),\n // we've lost the ability to find out if/when this entry becomes dirty,\n // whether that happens through a subscription, because of a direct call\n // to entry.setDirty(), or because one of its children becomes dirty.\n // Because of this loss of future information, we have to assume the\n // worst (that this entry might have become dirty very soon), so we must\n // immediately mark this entry's parents as dirty. Normally we could\n // just call entry.setDirty() rather than calling parent.setDirty() for\n // each parent, but that would leave this entry in parent.childValues\n // and parent.dirtyChildren, which would prevent the child from being\n // truly forgotten.\n this.parents.forEach(parent => {\n parent.setDirty();\n forgetChild(parent, this);\n });\n }\n}\n\nfunction rememberParent(child: AnyEntry) {\n const parent = parentEntrySlot.getValue();\n if (parent) {\n child.parents.add(parent);\n\n if (! parent.childValues.has(child)) {\n parent.childValues.set(child, UNKNOWN_VALUE);\n }\n\n if (mightBeDirty(child)) {\n reportDirtyChild(parent, child);\n } else {\n reportCleanChild(parent, child);\n }\n\n return parent;\n }\n}\n\n// This is the most important method of the Entry API, because it\n// determines whether the cached entry.value can be returned immediately,\n// or must be recomputed. The overall performance of the caching system\n// depends on the truth of the following observations: (1) this.dirty is\n// usually false, (2) this.dirtyChildren is usually null/empty, and thus\n// (3) this.value is usally returned very quickly, without recomputation.\nfunction recomputeIfDirty(entry: AnyEntry) {\n if (entry.dirty) {\n // If this Entry is explicitly dirty because someone called\n // entry.setDirty(), recompute.\n return reallyRecompute(entry);\n }\n\n if (mightBeDirty(entry)) {\n // Get fresh values for any dirty children, and if those values\n // disagree with this.childValues, mark this Entry explicitly dirty.\n entry.dirtyChildren!.forEach(child => {\n assert(entry.childValues.has(child));\n try {\n recomputeIfDirty(child);\n } catch (e) {\n entry.setDirty();\n }\n });\n\n if (entry.dirty) {\n // If this Entry has become explicitly dirty after comparing the fresh\n // values of its dirty children against this.childValues, recompute.\n return reallyRecompute(entry);\n }\n }\n\n assert(entry.value !== UNKNOWN_VALUE);\n\n return entry.value;\n}\n\nfunction reallyRecompute(entry: AnyEntry) {\n assert(! entry.recomputing, \"already recomputing\");\n entry.recomputing = true;\n\n // Since this recomputation is likely to re-remember some of this\n // entry's children, we forget our children here but do not call\n // maybeReportOrphan until after the recomputation finishes.\n const originalChildren = forgetChildren(entry);\n\n let threw = true;\n try {\n parentEntrySlot.withValue(entry, () => {\n entry.value = entry.fn.apply(null, entry.args);\n });\n threw = false;\n\n } finally {\n entry.recomputing = false;\n\n if (threw || ! maybeSubscribe(entry)) {\n // Mark this Entry dirty if entry.fn threw or we failed to\n // resubscribe. This is important because, if we have a subscribe\n // function and it failed, then we're going to miss important\n // notifications about the potential dirtiness of entry.value.\n entry.setDirty();\n } else {\n // If we successfully recomputed entry.value and did not fail to\n // (re)subscribe, then this Entry is no longer explicitly dirty.\n setClean(entry);\n }\n }\n\n // Now that we've had a chance to re-remember any children that were\n // involved in the recomputation, we can safely report any orphan\n // children that remain.\n originalChildren.forEach(maybeReportOrphan);\n\n return entry.value;\n}\n\nfunction mightBeDirty(entry: AnyEntry) {\n return entry.dirty || !!(entry.dirtyChildren && entry.dirtyChildren.size);\n}\n\nfunction setClean(entry: AnyEntry) {\n entry.dirty = false;\n\n if (mightBeDirty(entry)) {\n // This Entry may still have dirty children, in which case we can't\n // let our parents know we're clean just yet.\n return;\n }\n\n reportClean(entry);\n}\n\nfunction reportDirty(child: AnyEntry) {\n child.parents.forEach(parent => reportDirtyChild(parent, child));\n}\n\nfunction reportClean(child: AnyEntry) {\n child.parents.forEach(parent => reportCleanChild(parent, child));\n}\n\n// Let a parent Entry know that one of its children may be dirty.\nfunction reportDirtyChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberParent(child) before calling\n // reportDirtyChild(parent, child).\n assert(parent.childValues.has(child));\n assert(mightBeDirty(child));\n\n if (! parent.dirtyChildren) {\n parent.dirtyChildren = emptySetPool.pop() || new Set;\n\n } else if (parent.dirtyChildren.has(child)) {\n // If we already know this child is dirty, then we must have already\n // informed our own parents that we are dirty, so we can terminate\n // the recursion early.\n return;\n }\n\n parent.dirtyChildren.add(child);\n reportDirty(parent);\n}\n\n// Let a parent Entry know that one of its children is no longer dirty.\nfunction reportCleanChild(parent: AnyEntry, child: AnyEntry) {\n // Must have called rememberChild(child) before calling\n // reportCleanChild(parent, child).\n assert(parent.childValues.has(child));\n assert(! mightBeDirty(child));\n\n const childValue = parent.childValues.get(child);\n if (childValue === UNKNOWN_VALUE) {\n parent.childValues.set(child, child.value);\n } else if (childValue !== child.value) {\n parent.setDirty();\n }\n\n removeDirtyChild(parent, child);\n\n if (mightBeDirty(parent)) {\n return;\n }\n\n reportClean(parent);\n}\n\nfunction removeDirtyChild(parent: AnyEntry, child: AnyEntry) {\n const dc = parent.dirtyChildren;\n if (dc) {\n dc.delete(child);\n if (dc.size === 0) {\n if (emptySetPool.length < POOL_TARGET_SIZE) {\n emptySetPool.push(dc);\n }\n parent.dirtyChildren = null;\n }\n }\n}\n\n// If the given entry has a reportOrphan method, and no remaining parents,\n// call entry.reportOrphan and return true iff it returns true. The\n// reportOrphan function should return true to indicate entry.dispose()\n// has been called, and the entry has been removed from any other caches\n// (see index.js for the only current example).\nfunction maybeReportOrphan(entry: AnyEntry) {\n return entry.parents.size === 0 &&\n typeof entry.reportOrphan === \"function\" &&\n entry.reportOrphan() === true;\n}\n\n// Removes all children from this entry and returns an array of the\n// removed children.\nfunction forgetChildren(parent: AnyEntry) {\n let children = reusableEmptyArray;\n\n if (parent.childValues.size > 0) {\n children = [];\n parent.childValues.forEach((value, child) => {\n forgetChild(parent, child);\n children.push(child);\n });\n }\n\n // After we forget all our children, this.dirtyChildren must be empty\n // and therefore must have been reset to null.\n assert(parent.dirtyChildren === null);\n\n return children;\n}\n\nfunction forgetChild(parent: AnyEntry, child: AnyEntry) {\n child.parents.delete(parent);\n parent.childValues.delete(child);\n removeDirtyChild(parent, child);\n}\n\nfunction maybeSubscribe(entry: AnyEntry) {\n if (typeof entry.subscribe === \"function\") {\n try {\n maybeUnsubscribe(entry); // Prevent double subscriptions.\n entry.unsubscribe = entry.subscribe.apply(null, entry.args);\n } catch (e) {\n // If this Entry has a subscribe function and it threw an exception\n // (or an unsubscribe function it previously returned now throws),\n // return false to indicate that we were not able to subscribe (or\n // unsubscribe), and this Entry should remain dirty.\n entry.setDirty();\n return false;\n }\n }\n\n // Returning true indicates either that there was no entry.subscribe\n // function or that it succeeded.\n return true;\n}\n\nfunction maybeUnsubscribe(entry: AnyEntry) {\n const { unsubscribe } = entry;\n if (typeof unsubscribe === \"function\") {\n entry.unsubscribe = void 0;\n unsubscribe();\n }\n}\n","// A trie data structure that holds object keys weakly, yet can also hold\n// non-object keys, unlike the native `WeakMap`.\nexport class KeyTrie {\n // Since a `WeakMap` cannot hold primitive values as keys, we need a\n // backup `Map` instance to hold primitive keys. Both `this._weakMap`\n // and `this._strongMap` are lazily initialized.\n private weak?: WeakMap>;\n private strong?: Map>;\n private data?: K;\n\n constructor(private readonly weakness: boolean) {}\n\n public lookup(...array: T): K {\n return this.lookupArray(array);\n }\n\n public lookupArray(array: T): K {\n let node: KeyTrie = this;\n array.forEach(key => node = node.getChildTrie(key));\n return node.data || (node.data = Object.create(null));\n }\n\n private getChildTrie(key: any) {\n const map = this.weakness && isObjRef(key)\n ? this.weak || (this.weak = new WeakMap>())\n : this.strong || (this.strong = new Map>());\n let child = map.get(key);\n if (!child) map.set(key, child = new KeyTrie(this.weakness));\n return child;\n }\n}\n\nfunction isObjRef(value: any) {\n switch (typeof value) {\n case \"object\":\n if (value === null) break;\n // Fall through to return true...\n case \"function\":\n return true;\n }\n return false;\n}\n","import { Cache } from \"./cache\";\nimport { Entry } from \"./entry\";\nimport { parentEntrySlot } from \"./context\";\nimport { KeyTrie } from \"./key-trie\";\n\n// These helper functions are important for making optimism work with\n// asynchronous code. In order to register parent-child dependencies,\n// optimism needs to know about any currently active parent computations.\n// In ordinary synchronous code, the parent context is implicit in the\n// execution stack, but asynchronous code requires some extra guidance in\n// order to propagate context from one async task segment to the next.\nexport {\n bindContext,\n noContext,\n setTimeout,\n asyncFromGen,\n} from \"./context\";\n\n// Since the Cache uses a Map internally, any value or object reference can\n// be safely used as a key, though common types include object and string.\nexport type TCacheKey = any;\n\n// The defaultMakeCacheKey function is remarkably powerful, because it gives\n// a unique object for any shallow-identical list of arguments. If you need\n// to implement a custom makeCacheKey function, you may find it helpful to\n// delegate the final work to defaultMakeCacheKey, which is why we export it\n// here. However, you may want to avoid defaultMakeCacheKey if your runtime\n// does not support WeakMap, or you have the ability to return a string key.\n// In those cases, just write your own custom makeCacheKey functions.\nconst keyTrie = new KeyTrie(typeof WeakMap === \"function\");\nexport function defaultMakeCacheKey(...args: any[]) {\n return keyTrie.lookupArray(args);\n}\n\n// If you're paranoid about memory leaks, or you want to avoid using WeakMap\n// under the hood, but you still need the behavior of defaultMakeCacheKey,\n// import this constructor to create your own tries.\nexport { KeyTrie }\n\nexport type OptimisticWrapperFunction<\n TArgs extends any[],\n TResult,\n> = ((...args: TArgs) => TResult) & {\n // The .dirty(...) method of an optimistic function takes exactly the\n // same parameter types as the original function.\n dirty: (...args: TArgs) => void;\n};\n\nexport type OptimisticWrapOptions = {\n // The maximum number of cache entries that should be retained before the\n // cache begins evicting the oldest ones.\n max?: number;\n // If a wrapped function is \"disposable,\" then its creator does not\n // care about its return value, and it should be removed from the cache\n // immediately when it no longer has any parents that depend on it.\n disposable?: boolean;\n // The makeCacheKey function takes the same arguments that were passed to\n // the wrapper function and returns a single value that can be used as a key\n // in a Map to identify the cached result.\n makeCacheKey?: (...args: TArgs) => TCacheKey;\n // If provided, the subscribe function should either return an unsubscribe\n // function or return nothing.\n subscribe?: (...args: TArgs) => (() => any) | undefined;\n};\n\nexport function wrap<\n TArgs extends any[],\n TResult,\n>(\n originalFunction: (...args: TArgs) => TResult,\n options: OptimisticWrapOptions = Object.create(null),\n) {\n const cache = new Cache>(\n options.max || Math.pow(2, 16),\n entry => entry.dispose(),\n );\n\n const disposable = !! options.disposable;\n const makeCacheKey = options.makeCacheKey || defaultMakeCacheKey;\n\n function optimistic(): TResult {\n if (disposable && ! parentEntrySlot.hasValue()) {\n // If there's no current parent computation, and this wrapped\n // function is disposable (meaning we don't care about entry.value,\n // just dependency tracking), then we can short-cut everything else\n // in this function, because entry.recompute() is going to recycle\n // the entry object without recomputing anything, anyway.\n return void 0 as any;\n }\n\n const key = makeCacheKey.apply(null, arguments as any);\n if (! key) {\n return originalFunction.apply(null, arguments as any);\n }\n\n const args = Array.prototype.slice.call(arguments) as TArgs;\n\n let entry = cache.get(key);\n if (entry) {\n entry.args = args;\n } else {\n entry = new Entry(originalFunction, args);\n cache.set(key, entry);\n entry.subscribe = options.subscribe;\n if (disposable) {\n entry.reportOrphan = () => cache.delete(key);\n }\n }\n\n const value = entry.recompute();\n\n // Move this entry to the front of the least-recently used queue,\n // since we just finished computing its value.\n cache.set(key, entry);\n\n // Clean up any excess entries in the cache, but only if there is no\n // active parent entry, meaning we're not in the middle of a larger\n // computation that might be flummoxed by the cleaning.\n if (! parentEntrySlot.hasValue()) {\n cache.clean();\n }\n\n // If options.disposable is truthy, the caller of wrap is telling us\n // they don't care about the result of entry.recompute(), so we should\n // avoid returning the value, so it won't be accidentally used.\n return disposable ? void 0 as any : value;\n }\n\n optimistic.dirty = function () {\n const key = makeCacheKey.apply(null, arguments as any);\n const child = key && cache.get(key);\n if (child) {\n child.setDirty();\n }\n };\n\n return optimistic as OptimisticWrapperFunction;\n}\n"],"names":[],"mappings":";;;AAOA,SAAS,cAAc,MAAK;AAE5B;IAKE,eACU,GAAc,EACf,OAAoD;QADnD,oBAAA,EAAA,cAAc;QACf,wBAAA,EAAA,wBAAoD;QADnD,QAAG,GAAH,GAAG,CAAW;QACf,YAAO,GAAP,OAAO,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B,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACpC,IAAI,UAAU,EAAE;gBACd,KAAK,CAAC,YAAY,GAAG,cAAM,OAAA,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,GAAA,CAAC;aAC9C;SACF;QAED,IAAM,KAAK,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;;;QAIhC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;;;;QAKtB,IAAI,CAAE,eAAe,CAAC,QAAQ,EAAE,EAAE;YAChC,KAAK,CAAC,KAAK,EAAE,CAAC;SACf;;;;QAKD,OAAO,UAAU,GAAG,KAAK,CAAQ,GAAG,KAAK,CAAC;KAC3C;IAED,UAAU,CAAC,KAAK,GAAG;QACjB,IAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,SAAgB,CAAC,CAAC;QACvD,IAAM,KAAK,GAAG,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,QAAQ,EAAE,CAAC;SAClB;KACF,CAAC;IAEF,OAAO,UAAuD,CAAC;CAChE;;;;"} \ No newline at end of file diff --git a/node_modules/optimism/lib/cache.d.ts b/node_modules/optimism/lib/cache.d.ts new file mode 100644 index 000000000..5de861224 --- /dev/null +++ b/node_modules/optimism/lib/cache.d.ts @@ -0,0 +1,14 @@ +export declare class Cache { + private max; + dispose: (value: V, key: K) => void; + private map; + private newest; + private oldest; + constructor(max?: number, dispose?: (value: V, key: K) => void); + has(key: K): boolean; + get(key: K): void | V; + private getEntry; + set(key: K, value: V): V; + clean(): void; + delete(key: K): boolean; +} diff --git a/node_modules/optimism/lib/context.d.ts b/node_modules/optimism/lib/context.d.ts new file mode 100644 index 000000000..f41db1df0 --- /dev/null +++ b/node_modules/optimism/lib/context.d.ts @@ -0,0 +1,7 @@ +export declare const parentEntrySlot: { + readonly id: string; + hasValue(): boolean; + getValue(): import("./entry").Entry | undefined; + withValue(value: import("./entry").Entry, callback: (this: TThis, ...args: TArgs) => TResult, args?: TArgs | undefined, thisArg?: TThis | undefined): TResult; +}; +export { bind as bindContext, noContext, setTimeout, asyncFromGen, } from "@wry/context"; diff --git a/node_modules/optimism/lib/entry.d.ts b/node_modules/optimism/lib/entry.d.ts new file mode 100644 index 000000000..79a5b2c25 --- /dev/null +++ b/node_modules/optimism/lib/entry.d.ts @@ -0,0 +1,20 @@ +import { OptimisticWrapOptions } from "./index"; +export declare type AnyEntry = Entry; +export declare class Entry { + readonly fn: (...args: TArgs) => TValue; + args: TArgs; + static count: number; + subscribe: OptimisticWrapOptions["subscribe"]; + unsubscribe?: () => any; + reportOrphan?: (this: Entry) => any; + readonly parents: Set>; + readonly childValues: Map, any>; + dirtyChildren: Set | null; + dirty: boolean; + recomputing: boolean; + value: TValue; + constructor(fn: (...args: TArgs) => TValue, args: TArgs); + recompute(): TValue; + setDirty(): void; + dispose(): void; +} diff --git a/node_modules/optimism/lib/index.d.ts b/node_modules/optimism/lib/index.d.ts new file mode 100644 index 000000000..a8215382b --- /dev/null +++ b/node_modules/optimism/lib/index.d.ts @@ -0,0 +1,15 @@ +import { KeyTrie } from "./key-trie"; +export { bindContext, noContext, setTimeout, asyncFromGen, } from "./context"; +export declare type TCacheKey = any; +export declare function defaultMakeCacheKey(...args: any[]): any; +export { KeyTrie }; +export declare type OptimisticWrapperFunction = ((...args: TArgs) => TResult) & { + dirty: (...args: TArgs) => void; +}; +export declare type OptimisticWrapOptions = { + max?: number; + disposable?: boolean; + makeCacheKey?: (...args: TArgs) => TCacheKey; + subscribe?: (...args: TArgs) => (() => any) | undefined; +}; +export declare function wrap(originalFunction: (...args: TArgs) => TResult, options?: OptimisticWrapOptions): OptimisticWrapperFunction; diff --git a/node_modules/optimism/lib/key-trie.d.ts b/node_modules/optimism/lib/key-trie.d.ts new file mode 100644 index 000000000..ffe171b27 --- /dev/null +++ b/node_modules/optimism/lib/key-trie.d.ts @@ -0,0 +1,10 @@ +export declare class KeyTrie { + private readonly weakness; + private weak?; + private strong?; + private data?; + constructor(weakness: boolean); + lookup(...array: T): K; + lookupArray(array: T): K; + private getChildTrie; +} diff --git a/node_modules/optimism/package.json b/node_modules/optimism/package.json new file mode 100644 index 000000000..8766ac306 --- /dev/null +++ b/node_modules/optimism/package.json @@ -0,0 +1,52 @@ +{ + "name": "optimism", + "version": "0.9.6", + "author": "Ben Newman ", + "description": "Composable reactive caching with efficient invalidation.", + "keywords": [ + "caching", + "cache", + "invalidation", + "reactive", + "reactivity", + "dependency", + "tracking", + "tracker", + "memoization" + ], + "main": "lib/bundle.cjs.js", + "module": "lib/bundle.esm.js", + "types": "lib/index.d.ts", + "license": "MIT", + "homepage": "https://github.com/benjamn/optimism#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/benjamn/optimism.git" + }, + "bugs": { + "url": "https://github.com/benjamn/optimism/issues" + }, + "scripts": { + "build": "npm run clean && tsc --emitDeclarationOnly && rollup -c", + "clean": "rimraf lib", + "mocha": "mocha --require source-map-support/register --reporter spec --full-trace test.js", + "prepublish": "npm run build", + "test": "npm run build && npm run mocha" + }, + "devDependencies": { + "@types/mocha": "5.2.7", + "@types/node": "12.0.10", + "fibers": "4.0.1", + "mocha": "6.1.4", + "reify": "0.20.6", + "rimraf": "2.6.3", + "rollup": "1.16.2", + "rollup-plugin-typescript2": "0.21.2", + "source-map-support": "0.5.12", + "tslib": "1.10.0", + "typescript": "3.5.2" + }, + "dependencies": { + "@wry/context": "^0.4.0" + } +} diff --git a/node_modules/optimism/test.js b/node_modules/optimism/test.js new file mode 100644 index 000000000..6c909ce87 --- /dev/null +++ b/node_modules/optimism/test.js @@ -0,0 +1,8 @@ +describe("Compiled to CommonJS", function () { + require("./lib/tests/bundle.cjs.js"); +}); + +describe("Compiled to ECMAScript module syntax", function () { + require("reify/node"); // Enable ESM syntax. + require("./lib/tests/bundle.esm.js"); +}); diff --git a/node_modules/prop-types/CHANGELOG.md b/node_modules/prop-types/CHANGELOG.md new file mode 100644 index 000000000..025d2f40e --- /dev/null +++ b/node_modules/prop-types/CHANGELOG.md @@ -0,0 +1,92 @@ +## 15.7.2 +* [Fix] ensure nullish values in `oneOf` do not crash ([#256](https://github.com/facebook/prop-types/issues/256)) +* [Fix] move `loose-envify` back to production deps, for browerify usage ([#203](https://github.com/facebook/prop-types/issues/203)) + +## 15.7.1 +* [Fix] avoid template literal syntax ([#255](https://github.com/facebook/prop-types/issues/255), [#254](https://github.com/facebook/prop-types/issues/254)) + +## 15.7.0 +* [New] Add `.elementType` ([#211](https://github.com/facebook/prop-types/pull/211)) +* [New] add `PropTypes.resetWarningCache` ([#178](https://github.com/facebook/prop-types/pull/178)) +* `oneOf`: improve warning when multiple arguments are supplied ([#244](https://github.com/facebook/prop-types/pull/244)) +* Fix `oneOf` when used with Symbols ([#224](https://github.com/facebook/prop-types/pull/224)) +* Avoid relying on `hasOwnProperty` being present on values' prototypes ([#112](https://github.com/facebook/prop-types/pull/112), [#187](https://github.com/facebook/prop-types/pull/187)) +* Improve readme ([#248](https://github.com/facebook/prop-types/pull/248), [#233](https://github.com/facebook/prop-types/pull/233)) +* Clean up mistaken runtime dep, swap envify for loose-envify ([#204](https://github.com/facebook/prop-types/pull/204)) + +## 15.6.2 +* Remove the `fbjs` dependency by inlining some helpers from it ([#194](https://github.com/facebook/prop-types/pull/194))) + +## 15.6.1 +* Fix an issue where outdated BSD license headers were still present in the published bundle [#162](https://github.com/facebook/prop-types/issues/162) + +## 15.6.0 + +* Switch from BSD + Patents to MIT license +* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/facebook/prop-types/pull/41) and [#87](https://github.com/facebook/prop-types/pull/87)) + +## 15.5.10 + +* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/facebook/prop-types/pull/50)) + +## 15.5.9 + +* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/facebook/prop-types/pull/45)) + +## 15.5.8 + +* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/facebook/prop-types/pull/26)) + +## 15.5.7 + +* **Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/facebook/prop-types/pull/20)) +* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/facebook/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/facebook/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4)) + +## 15.5.6 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/facebook/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a)) + +## 15.5.5 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/facebook/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a)) + +## 15.5.4 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/facebook/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8)) +* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/facebook/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a)) +* Remove the accidentally included typechecking code from the production build. + +## 15.5.3 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/facebook/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace)) + +## 15.5.2 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/facebook/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d)) + + +## 15.5.1 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove accidental uncompiled ES6 syntax in the published package. ([@acdlite](https://github.com/acdlite) in [e191963](https://github.com/facebook/react/commit/e1919638b39dd65eedd250a8bb649773ca61b6f1)) + +## 15.5.0 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Initial release. + +## Before 15.5.0 + +PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md) diff --git a/node_modules/prop-types/LICENSE b/node_modules/prop-types/LICENSE new file mode 100644 index 000000000..188fb2b0b --- /dev/null +++ b/node_modules/prop-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-present, Facebook, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/prop-types/README.md b/node_modules/prop-types/README.md new file mode 100644 index 000000000..1a23c9d98 --- /dev/null +++ b/node_modules/prop-types/README.md @@ -0,0 +1,296 @@ +# prop-types [![Build Status](https://travis-ci.com/facebook/prop-types.svg?branch=master)](https://travis-ci.org/facebook/prop-types) + +Runtime type checking for React props and similar objects. + +You can use prop-types to document the intended types of properties passed to +components. React (and potentially other libraries—see the checkPropTypes() +reference below) will check props passed to your components against those +definitions, and warn in development if they don’t match. + +## Installation + +```shell +npm install --save prop-types +``` + +## Importing + +```js +import PropTypes from 'prop-types'; // ES6 +var PropTypes = require('prop-types'); // ES5 with npm +``` + +### CDN + +If you prefer to exclude `prop-types` from your application and use it +globally via `window.PropTypes`, the `prop-types` package provides +single-file distributions, which are hosted on the following CDNs: + +* [**unpkg**](https://unpkg.com/prop-types/) +```html + + + + + +``` + +* [**cdnjs**](https://cdnjs.com/libraries/prop-types) +```html + + + + + +``` + +To load a specific version of `prop-types` replace `15.6.0` with the version number. + +## Usage + +PropTypes was originally exposed as part of the React core module, and is +commonly used with React components. +Here is an example of using PropTypes with a React component, which also +documents the different validators provided: + +```js +import React from 'react'; +import PropTypes from 'prop-types'; + +class MyComponent extends React.Component { + render() { + // ... do things with the props + } +} + +MyComponent.propTypes = { + // You can declare that a prop is a specific JS primitive. By default, these + // are all optional. + optionalArray: PropTypes.array, + optionalBool: PropTypes.bool, + optionalFunc: PropTypes.func, + optionalNumber: PropTypes.number, + optionalObject: PropTypes.object, + optionalString: PropTypes.string, + optionalSymbol: PropTypes.symbol, + + // Anything that can be rendered: numbers, strings, elements or an array + // (or fragment) containing these types. + optionalNode: PropTypes.node, + + // A React element (ie. ). + optionalElement: PropTypes.element, + + // A React element type (ie. MyComponent). + optionalElementType: PropTypes.elementType, + + // You can also declare that a prop is an instance of a class. This uses + // JS's instanceof operator. + optionalMessage: PropTypes.instanceOf(Message), + + // You can ensure that your prop is limited to specific values by treating + // it as an enum. + optionalEnum: PropTypes.oneOf(['News', 'Photos']), + + // An object that could be one of many types + optionalUnion: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number, + PropTypes.instanceOf(Message) + ]), + + // An array of a certain type + optionalArrayOf: PropTypes.arrayOf(PropTypes.number), + + // An object with property values of a certain type + optionalObjectOf: PropTypes.objectOf(PropTypes.number), + + // You can chain any of the above with `isRequired` to make sure a warning + // is shown if the prop isn't provided. + + // An object taking on a particular shape + optionalObjectWithShape: PropTypes.shape({ + optionalProperty: PropTypes.string, + requiredProperty: PropTypes.number.isRequired + }), + + // An object with warnings on extra properties + optionalObjectWithStrictShape: PropTypes.exact({ + optionalProperty: PropTypes.string, + requiredProperty: PropTypes.number.isRequired + }), + + requiredFunc: PropTypes.func.isRequired, + + // A value of any data type + requiredAny: PropTypes.any.isRequired, + + // You can also specify a custom validator. It should return an Error + // object if the validation fails. Don't `console.warn` or throw, as this + // won't work inside `oneOfType`. + customProp: function(props, propName, componentName) { + if (!/matchme/.test(props[propName])) { + return new Error( + 'Invalid prop `' + propName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }, + + // You can also supply a custom validator to `arrayOf` and `objectOf`. + // It should return an Error object if the validation fails. The validator + // will be called for each key in the array or object. The first two + // arguments of the validator are the array or object itself, and the + // current item's key. + customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) { + if (!/matchme/.test(propValue[key])) { + return new Error( + 'Invalid prop `' + propFullName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }) +}; +``` + +Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information. + +## Migrating from React.PropTypes + +Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`. + +Note that this blog posts **mentions a codemod script that performs the conversion automatically**. + +There are also important notes below. + +## How to Depend on This Package? + +For apps, we recommend putting it in `dependencies` with a caret range. +For example: + +```js + "dependencies": { + "prop-types": "^15.5.7" + } +``` + +For libraries, we *also* recommend leaving it in `dependencies`: + +```js + "dependencies": { + "prop-types": "^15.5.7" + }, + "peerDependencies": { + "react": "^15.5.0" + } +``` + +**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version. + +Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages. + +For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React. + +## Compatibility + +### React 0.14 + +This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade. + +```shell +# ATTENTION: Only run this if you still use React 0.14! +npm install --save react@^0.14.9 react-dom@^0.14.9 +``` + +### React 15+ + +This package is compatible with **React 15.3.0** and higher. + +``` +npm install --save react@^15.3.0 react-dom@^15.3.0 +``` + +### What happens on other React versions? + +It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14. + +## Difference from `React.PropTypes`: Don’t Call Validator Functions + +First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details. + +Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on. + +When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size. + +Code like this is still fine: + +```js +MyComponent.propTypes = { + myProp: PropTypes.bool +}; +``` + +However, code like this will not work with the `prop-types` package: + +```js +// Will not work with `prop-types` package! +var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop'); +``` + +It will throw an error: + +``` +Calling PropTypes validators directly is not supported by the `prop-types` package. +Use PropTypes.checkPropTypes() to call them. +``` + +(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).) + +This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16. + +**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function: + +```js +// Works with standalone PropTypes +PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent'); +``` +See below for more info. + +**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case. + +If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users. + +## PropTypes.checkPropTypes + +React will automatically check the propTypes you set on the component, but if +you are using PropTypes without React then you may want to manually call +`PropTypes.checkPropTypes`, like so: + +```js +const myPropTypes = { + name: PropTypes.string, + age: PropTypes.number, + // ... define your prop validations +}; + +const props = { + name: 'hello', // is valid + age: 'world', // not valid +}; + +// Let's say your component is called 'MyComponent' + +// Works with standalone PropTypes +PropTypes.checkPropTypes(myPropTypes, props, 'age', 'MyComponent'); +// This will warn as follows: +// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to +// `MyComponent`, expected `number`. +``` + +## PropTypes.resetWarningCache() + +`PropTypes.checkPropTypes(...)` only `console.error.log(...)`s a given message once. To reset the cache while testing call `PropTypes.resetWarningCache()` + +### License + +prop-types is [MIT licensed](./LICENSE). diff --git a/node_modules/prop-types/checkPropTypes.js b/node_modules/prop-types/checkPropTypes.js new file mode 100644 index 000000000..49111df95 --- /dev/null +++ b/node_modules/prop-types/checkPropTypes.js @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +/** + * Resets warning cache when testing. + * + * @private + */ +checkPropTypes.resetWarningCache = function() { + if (process.env.NODE_ENV !== 'production') { + loggedTypeFailures = {}; + } +} + +module.exports = checkPropTypes; diff --git a/node_modules/prop-types/factory.js b/node_modules/prop-types/factory.js new file mode 100644 index 000000000..abdf8e6dc --- /dev/null +++ b/node_modules/prop-types/factory.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = require('./factoryWithTypeCheckers'); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; diff --git a/node_modules/prop-types/factoryWithThrowingShims.js b/node_modules/prop-types/factoryWithThrowingShims.js new file mode 100644 index 000000000..e5b2f9ce0 --- /dev/null +++ b/node_modules/prop-types/factoryWithThrowingShims.js @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +function emptyFunction() {} +function emptyFunctionWithReset() {} +emptyFunctionWithReset.resetWarningCache = emptyFunction; + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/node_modules/prop-types/factoryWithTypeCheckers.js b/node_modules/prop-types/factoryWithTypeCheckers.js new file mode 100644 index 000000000..3711f0b6e --- /dev/null +++ b/node_modules/prop-types/factoryWithTypeCheckers.js @@ -0,0 +1,591 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactIs = require('react-is'); +var assign = require('object-assign'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +var has = Function.call.bind(Object.prototype.hasOwnProperty); +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (process.env.NODE_ENV !== 'production') { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/node_modules/prop-types/index.js b/node_modules/prop-types/index.js new file mode 100644 index 000000000..e9ef51d6f --- /dev/null +++ b/node_modules/prop-types/index.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (process.env.NODE_ENV !== 'production') { + var ReactIs = require('react-is'); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} diff --git a/node_modules/prop-types/lib/ReactPropTypesSecret.js b/node_modules/prop-types/lib/ReactPropTypesSecret.js new file mode 100644 index 000000000..f54525e7f --- /dev/null +++ b/node_modules/prop-types/lib/ReactPropTypesSecret.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; diff --git a/node_modules/prop-types/node_modules/.bin/loose-envify b/node_modules/prop-types/node_modules/.bin/loose-envify new file mode 100644 index 000000000..d96b00239 --- /dev/null +++ b/node_modules/prop-types/node_modules/.bin/loose-envify @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../../../loose-envify/cli.js" "$@" + ret=$? +else + node "$basedir/../../../loose-envify/cli.js" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/prop-types/node_modules/.bin/loose-envify.cmd b/node_modules/prop-types/node_modules/.bin/loose-envify.cmd new file mode 100644 index 000000000..0bd27344f --- /dev/null +++ b/node_modules/prop-types/node_modules/.bin/loose-envify.cmd @@ -0,0 +1,7 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\..\..\loose-envify\cli.js" %* +) ELSE ( + @SETLOCAL + @SET PATHEXT=%PATHEXT:;.JS;=;% + node "%~dp0\..\..\..\loose-envify\cli.js" %* +) \ No newline at end of file diff --git a/node_modules/prop-types/package.json b/node_modules/prop-types/package.json new file mode 100644 index 000000000..2675a422c --- /dev/null +++ b/node_modules/prop-types/package.json @@ -0,0 +1,58 @@ +{ + "name": "prop-types", + "version": "15.7.2", + "description": "Runtime type checking for React props and similar objects.", + "main": "index.js", + "license": "MIT", + "files": [ + "LICENSE", + "README.md", + "checkPropTypes.js", + "factory.js", + "factoryWithThrowingShims.js", + "factoryWithTypeCheckers.js", + "index.js", + "prop-types.js", + "prop-types.min.js", + "lib" + ], + "repository": "facebook/prop-types", + "keywords": [ + "react" + ], + "bugs": { + "url": "https://github.com/facebook/prop-types/issues" + }, + "homepage": "https://facebook.github.io/react/", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + }, + "scripts": { + "pretest": "npm run lint", + "lint": "eslint .", + "test": "npm run tests-only", + "tests-only": "jest", + "umd": "NODE_ENV=development browserify index.js -t loose-envify --standalone PropTypes -o prop-types.js", + "umd-min": "NODE_ENV=production browserify index.js -t loose-envify -t uglifyify --standalone PropTypes -p bundle-collapser/plugin -o | uglifyjs --compress unused,dead_code -o prop-types.min.js", + "build": "yarn umd && yarn umd-min", + "prepublish": "yarn build" + }, + "devDependencies": { + "babel-jest": "^19.0.0", + "babel-preset-react": "^6.24.1", + "browserify": "^16.2.3", + "bundle-collapser": "^1.2.1", + "eslint": "^5.13.0", + "jest": "^19.0.2", + "react": "^15.5.1", + "uglifyify": "^3.0.4", + "uglifyjs": "^2.4.10" + }, + "browserify": { + "transform": [ + "loose-envify" + ] + } +} diff --git a/node_modules/prop-types/prop-types.js b/node_modules/prop-types/prop-types.js new file mode 100644 index 000000000..867d6993c --- /dev/null +++ b/node_modules/prop-types/prop-types.js @@ -0,0 +1,1337 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"object-assign":6,"react-is":10}],4:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if ("development" !== 'production') { + var ReactIs = require('react-is'); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} + +},{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3,"react-is":10}],5:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +},{}],6:[function(require,module,exports){ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +},{}],7:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],8:[function(require,module,exports){ +(function (process){ +/** @license React v16.8.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + + + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + })(); +} + +}).call(this,require('_process')) +},{"_process":7}],9:[function(require,module,exports){ +/** @license React v16.8.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): +60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; +exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; +exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; +exports.isSuspense=function(a){return t(a)===p}; + +},{}],10:[function(require,module,exports){ +(function (process){ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-is.production.min.js'); +} else { + module.exports = require('./cjs/react-is.development.js'); +} + +}).call(this,require('_process')) +},{"./cjs/react-is.development.js":8,"./cjs/react-is.production.min.js":9,"_process":7}]},{},[4])(4) +}); \ No newline at end of file diff --git a/node_modules/prop-types/prop-types.min.js b/node_modules/prop-types/prop-types.min.js new file mode 100644 index 000000000..c90243315 --- /dev/null +++ b/node_modules/prop-types/prop-types.min.js @@ -0,0 +1 @@ +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.PropTypes=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o) => React.ReactElement | null; +} +declare const ApolloConsumer: React.StatelessComponent; +export default ApolloConsumer; diff --git a/node_modules/react-apollo/ApolloConsumer.js b/node_modules/react-apollo/ApolloConsumer.js new file mode 100644 index 000000000..3be760958 --- /dev/null +++ b/node_modules/react-apollo/ApolloConsumer.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +var ApolloContext_1 = require("./ApolloContext"); +var ts_invariant_1 = require("ts-invariant"); +var ApolloConsumer = function (props, legacyContext) { + function finish(context) { + if (!context || !context.client) { + throw new ts_invariant_1.InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + } + return ApolloContext_1.ApolloContext ? (React.createElement(ApolloContext_1.ApolloContext.Consumer, null, finish)) : (finish(legacyContext)); +}; +ApolloConsumer.contextTypes = { + client: PropTypes.object.isRequired, +}; +ApolloConsumer.propTypes = { + children: PropTypes.func.isRequired, +}; +exports.default = ApolloConsumer; +//# sourceMappingURL=ApolloConsumer.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/ApolloConsumer.js.map b/node_modules/react-apollo/ApolloConsumer.js.map new file mode 100644 index 000000000..060fe0946 --- /dev/null +++ b/node_modules/react-apollo/ApolloConsumer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloConsumer.js","sourceRoot":"","sources":["../src/ApolloConsumer.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AAExC,iDAAgD;AAChD,6CAA8C;AAM9C,IAAM,cAAc,GAClB,UAAC,KAAK,EAAE,aAAa;IACnB,SAAS,MAAM,CAAC,OAAY;QAC1B,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/B,MAAM,IAAI,6BAAc,CACtB,4DAA4D;gBAC5D,iDAAiD,CAClD,CAAC;SACH;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,6BAAa,CAAC,CAAC,CAAC,CACrB,oBAAC,6BAAa,CAAC,QAAQ,QACpB,MAAM,CACgB,CAC1B,CAAC,CAAC,CAAC,CAEF,MAAM,CAAC,aAAa,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAEJ,cAAc,CAAC,YAAY,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AAEF,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AAEF,kBAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/node_modules/react-apollo/ApolloContext.d.ts b/node_modules/react-apollo/ApolloContext.d.ts new file mode 100644 index 000000000..f7fa7a07a --- /dev/null +++ b/node_modules/react-apollo/ApolloContext.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import ApolloClient from 'apollo-client'; +import { DocumentNode } from 'graphql'; +export interface ApolloContextValue { + client?: ApolloClient; + operations?: Map; +} +export declare const ApolloContext: React.Context; diff --git a/node_modules/react-apollo/ApolloContext.js b/node_modules/react-apollo/ApolloContext.js new file mode 100644 index 000000000..1317349ac --- /dev/null +++ b/node_modules/react-apollo/ApolloContext.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +exports.ApolloContext = React.createContext && + React.createContext(undefined); +//# sourceMappingURL=ApolloContext.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/ApolloContext.js.map b/node_modules/react-apollo/ApolloContext.js.map new file mode 100644 index 000000000..ec94d7590 --- /dev/null +++ b/node_modules/react-apollo/ApolloContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloContext.js","sourceRoot":"","sources":["../src/ApolloContext.ts"],"names":[],"mappings":";;;AAAA,mDAA+B;AASlB,QAAA,aAAa,GAAG,KAAK,CAAC,aAAa;IAC9C,KAAK,CAAC,aAAa,CAAiC,SAAS,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/react-apollo/ApolloProvider.d.ts b/node_modules/react-apollo/ApolloProvider.d.ts new file mode 100644 index 000000000..fd9697d0e --- /dev/null +++ b/node_modules/react-apollo/ApolloProvider.d.ts @@ -0,0 +1,25 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import { Component } from 'react'; +import ApolloClient from 'apollo-client'; +export interface ApolloProviderProps { + client: ApolloClient; + children: React.ReactNode; +} +export default class ApolloProvider extends Component> { + static propTypes: { + client: PropTypes.Validator; + children: PropTypes.Validator; + }; + static childContextTypes: { + client: PropTypes.Validator; + operations: PropTypes.Requireable; + }; + private operations; + constructor(props: ApolloProviderProps, context: any); + getChildContext(): { + client: ApolloClient; + operations: any; + }; + render(): {} | null | undefined; +} diff --git a/node_modules/react-apollo/ApolloProvider.js b/node_modules/react-apollo/ApolloProvider.js new file mode 100644 index 000000000..302d59053 --- /dev/null +++ b/node_modules/react-apollo/ApolloProvider.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +var react_1 = require("react"); +var ApolloContext_1 = require("./ApolloContext"); +var ts_invariant_1 = require("ts-invariant"); +var ApolloProvider = (function (_super) { + tslib_1.__extends(ApolloProvider, _super); + function ApolloProvider(props, context) { + var _this = _super.call(this, props, context) || this; + _this.operations = new Map(); + ts_invariant_1.invariant(props.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + if (!props.client.__operations_cache__) { + props.client.__operations_cache__ = _this.operations; + } + return _this; + } + ApolloProvider.prototype.getChildContext = function () { + return { + client: this.props.client, + operations: this.props.client.__operations_cache__, + }; + }; + ApolloProvider.prototype.render = function () { + return ApolloContext_1.ApolloContext ? (React.createElement(ApolloContext_1.ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children); + }; + ApolloProvider.propTypes = { + client: PropTypes.object.isRequired, + children: PropTypes.node.isRequired, + }; + ApolloProvider.childContextTypes = { + client: PropTypes.object.isRequired, + operations: PropTypes.object, + }; + return ApolloProvider; +}(react_1.Component)); +exports.default = ApolloProvider; +//# sourceMappingURL=ApolloProvider.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/ApolloProvider.js.map b/node_modules/react-apollo/ApolloProvider.js.map new file mode 100644 index 000000000..7a628313f --- /dev/null +++ b/node_modules/react-apollo/ApolloProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApolloProvider.js","sourceRoot":"","sources":["../src/ApolloProvider.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AACxC,+BAAkC;AAGlC,iDAAgD;AAEhD,6CAAyC;AAOzC;IAAoD,0CAAsC;IAaxF,wBAAY,KAAkC,EAAE,OAAY;QAA5D,YACE,kBAAM,KAAK,EAAE,OAAO,CAAC,SActB;QAjBO,gBAAU,GAAyD,IAAI,GAAG,EAAE,CAAC;QAKnF,wBAAS,CACP,KAAK,CAAC,MAAM,EACZ,wDAAwD;YACtD,qDAAqD,CACxD,CAAC;QAKF,IAAI,CAAE,KAAK,CAAC,MAAc,CAAC,oBAAoB,EAAE;YAC9C,KAAK,CAAC,MAAc,CAAC,oBAAoB,GAAG,KAAI,CAAC,UAAU,CAAC;SAC9D;;IACH,CAAC;IAED,wCAAe,GAAf;QACE,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;YACzB,UAAU,EAAG,IAAI,CAAC,KAAK,CAAC,MAAc,CAAC,oBAAoB;SAC5D,CAAC;IACJ,CAAC;IAED,+BAAM,GAAN;QACE,OAAO,6BAAa,CAAC,CAAC,CAAC,CACrB,oBAAC,6BAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,IAClD,IAAI,CAAC,KAAK,CAAC,QAAQ,CACG,CAC1B,CAAC,CAAC,CAAC,CACF,IAAI,CAAC,KAAK,CAAC,QAAQ,CACpB,CAAC;IACJ,CAAC;IA5CM,wBAAS,GAAG;QACjB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QACnC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;KACpC,CAAC;IAEK,gCAAiB,GAAG;QACzB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QACnC,UAAU,EAAE,SAAS,CAAC,MAAM;KAC7B,CAAC;IAqCJ,qBAAC;CAAA,AA9CD,CAAoD,iBAAS,GA8C5D;kBA9CoB,cAAc"} \ No newline at end of file diff --git a/node_modules/react-apollo/LICENSE b/node_modules/react-apollo/LICENSE new file mode 100644 index 000000000..0808d6883 --- /dev/null +++ b/node_modules/react-apollo/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Newman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/react-apollo/Mutation.d.ts b/node_modules/react-apollo/Mutation.d.ts new file mode 100644 index 000000000..90d50863b --- /dev/null +++ b/node_modules/react-apollo/Mutation.d.ts @@ -0,0 +1,98 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import ApolloClient, { PureQueryOptions, ApolloError, FetchPolicy } from 'apollo-client'; +import { DataProxy } from 'apollo-cache'; +import { DocumentNode, GraphQLError } from 'graphql'; +import { OperationVariables, RefetchQueriesProviderFn } from './types'; +export interface MutationResult> { + data?: TData; + error?: ApolloError; + loading: boolean; + called: boolean; + client: ApolloClient; +} +export interface MutationContext { + client?: ApolloClient; + operations: Map; +} +export interface ExecutionResult> { + data?: T; + extensions?: Record; + errors?: GraphQLError[]; +} +export declare type MutationUpdaterFn = (proxy: DataProxy, mutationResult: FetchResult) => void; +export declare type FetchResult, C = Record, E = Record> = ExecutionResult & { + extensions?: E; + context?: C; +}; +export declare type MutationOptions, TVariables = OperationVariables> = { + variables?: TVariables; + optimisticResponse?: TData; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + update?: MutationUpdaterFn; + context?: Record; + fetchPolicy?: FetchPolicy; +}; +export declare type MutationFn = (options?: MutationOptions) => Promise>; +export interface MutationProps { + client?: ApolloClient; + mutation: DocumentNode; + ignoreResults?: boolean; + optimisticResponse?: TData; + variables?: TVariables; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + update?: MutationUpdaterFn; + children: (mutateFn: MutationFn, result: MutationResult) => React.ReactNode; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; + context?: Record; + fetchPolicy?: FetchPolicy; +} +export interface MutationState { + called: boolean; + error?: ApolloError; + data?: TData; + loading: boolean; +} +declare class Mutation extends React.Component, MutationState> { + static contextTypes: { + client: PropTypes.Requireable; + operations: PropTypes.Requireable; + }; + static propTypes: { + mutation: PropTypes.Validator; + variables: PropTypes.Requireable; + optimisticResponse: PropTypes.Requireable; + refetchQueries: PropTypes.Requireable<((...args: any[]) => any) | (string | object | null)[]>; + awaitRefetchQueries: PropTypes.Requireable; + update: PropTypes.Requireable<(...args: any[]) => any>; + children: PropTypes.Validator<(...args: any[]) => any>; + onCompleted: PropTypes.Requireable<(...args: any[]) => any>; + onError: PropTypes.Requireable<(...args: any[]) => any>; + fetchPolicy: PropTypes.Requireable; + }; + private client; + private mostRecentMutationId; + private hasMounted; + constructor(props: MutationProps, context: any); + componentDidMount(): void; + componentWillUnmount(): void; + componentWillReceiveProps(nextProps: MutationProps, nextContext: MutationContext): void; + render(): React.ReactNode; + private runMutation; + private mutate; + private onMutationStart; + private onMutationCompleted; + private onMutationError; + private generateNewMutationId; + private isMostRecentMutation; + private verifyDocumentIsMutation; +} +export default Mutation; diff --git a/node_modules/react-apollo/Mutation.js b/node_modules/react-apollo/Mutation.js new file mode 100644 index 000000000..6184e7bdc --- /dev/null +++ b/node_modules/react-apollo/Mutation.js @@ -0,0 +1,161 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +var apollo_client_1 = require("apollo-client"); +var ts_invariant_1 = require("ts-invariant"); +var shallowEqual_1 = tslib_1.__importDefault(require("./utils/shallowEqual")); +var parser_1 = require("./parser"); +var component_utils_1 = require("./component-utils"); +var initialState = { + loading: false, + called: false, + error: undefined, + data: undefined, +}; +var Mutation = (function (_super) { + tslib_1.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib_1.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) { + refetchQueries = refetchQueries.map(function (x) { + if (typeof x === 'string' && _this.context.operations) + return _this.context.operations.get(x) || x; + return x; + }); + delete mutateOptions.refetchQueries; + } + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.client.mutate(tslib_1.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 ? new apollo_client_1.ApolloError({ graphQLErrors: errors }) : undefined; + var callOncomplete = function () { return (onCompleted ? onCompleted(data) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId) && !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser_1.parser(mutation); + ts_invariant_1.invariant(operation.type === parser_1.DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === parser_1.DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.client = component_utils_1.getClient(props, context); + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = initialState; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = component_utils_1.getClient(nextProps, nextContext); + if (shallowEqual_1.default(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.props.mutation !== nextProps.mutation) { + this.verifyDocumentIsMutation(nextProps.mutation); + } + if (this.client !== nextClient) { + this.client = nextClient; + this.setState(initialState); + } + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.client, + }; + return children(this.runMutation, result); + }; + Mutation.contextTypes = { + client: PropTypes.object, + operations: PropTypes.object, + }; + Mutation.propTypes = { + mutation: PropTypes.object.isRequired, + variables: PropTypes.object, + optimisticResponse: PropTypes.object, + refetchQueries: PropTypes.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])), + PropTypes.func, + ]), + awaitRefetchQueries: PropTypes.bool, + update: PropTypes.func, + children: PropTypes.func.isRequired, + onCompleted: PropTypes.func, + onError: PropTypes.func, + fetchPolicy: PropTypes.string, + }; + return Mutation; +}(React.Component)); +exports.default = Mutation; +//# sourceMappingURL=Mutation.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/Mutation.js.map b/node_modules/react-apollo/Mutation.js.map new file mode 100644 index 000000000..c1d98afeb --- /dev/null +++ b/node_modules/react-apollo/Mutation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Mutation.js","sourceRoot":"","sources":["../src/Mutation.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AACxC,+CAAyF;AAEzF,6CAAyC;AAEzC,8EAAgD;AAGhD,mCAAgD;AAChD,qDAA8C;AA+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,IAAA,eAA6C,EAA3C,oBAAO,EAAE,cAAI,EAAE,gBAAK,EAAE,kBAAqB,CAAC;QAEpD,IAAM,MAAM,GAAG;YACb,MAAM,QAAA;YACN,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IA1EM,qBAAY,GAAG;QACpB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,UAAU,EAAE,SAAS,CAAC,MAAM;KAC7B,CAAC;IAEK,kBAAS,GAAG;QACjB,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QACrC,SAAS,EAAE,SAAS,CAAC,MAAM;QAC3B,kBAAkB,EAAE,SAAS,CAAC,MAAM;QACpC,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC;YAClC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YAC5E,SAAS,CAAC,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,SAAS,CAAC,IAAI;QACnC,MAAM,EAAE,SAAS,CAAC,IAAI;QACtB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;QACnC,WAAW,EAAE,SAAS,CAAC,IAAI;QAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;QACvB,WAAW,EAAE,SAAS,CAAC,MAAM;KAC9B,CAAC;IA8KJ,eAAC;CAAA,AArMD,CAAqE,KAAK,CAAC,SAAS,GAqMnF;AAED,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/node_modules/react-apollo/Query.d.ts b/node_modules/react-apollo/Query.d.ts new file mode 100644 index 000000000..9a7e49b8d --- /dev/null +++ b/node_modules/react-apollo/Query.d.ts @@ -0,0 +1,80 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import ApolloClient, { ObservableQuery, ApolloError, ApolloQueryResult, NetworkStatus, FetchMoreOptions, FetchMoreQueryOptions } from 'apollo-client'; +import { DocumentNode } from 'graphql'; +import { OperationVariables, QueryOpts } from './types'; +import { RenderPromises } from './getDataFromTree'; +export declare type ObservableQueryFields = Pick, 'startPolling' | 'stopPolling' | 'subscribeToMore' | 'updateQuery' | 'refetch' | 'variables'> & { + fetchMore: ((fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions) => Promise>) & ((fetchMoreOptions: { + query?: DocumentNode; + } & FetchMoreQueryOptions & FetchMoreOptions) => Promise>); +}; +export interface QueryResult extends ObservableQueryFields { + client: ApolloClient; + data: TData | undefined; + error?: ApolloError; + loading: boolean; + networkStatus: NetworkStatus; +} +export interface QueryProps extends QueryOpts { + children: (result: QueryResult) => React.ReactNode; + query: DocumentNode; + displayName?: string; + skip?: boolean; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; +} +export interface QueryContext { + client?: ApolloClient; + operations?: Map; + renderPromises?: RenderPromises; +} +export default class Query extends React.Component> { + static contextTypes: { + client: PropTypes.Requireable; + operations: PropTypes.Requireable; + renderPromises: PropTypes.Requireable; + }; + static propTypes: { + client: PropTypes.Requireable; + children: PropTypes.Validator<(...args: any[]) => any>; + fetchPolicy: PropTypes.Requireable; + notifyOnNetworkStatusChange: PropTypes.Requireable; + onCompleted: PropTypes.Requireable<(...args: any[]) => any>; + onError: PropTypes.Requireable<(...args: any[]) => any>; + pollInterval: PropTypes.Requireable; + query: PropTypes.Validator; + variables: PropTypes.Requireable; + ssr: PropTypes.Requireable; + partialRefetch: PropTypes.Requireable; + returnPartialData: PropTypes.Requireable; + }; + context: QueryContext | undefined; + private client; + private queryObservable?; + private querySubscription?; + private refetcherQueue?; + private hasMounted; + private operation?; + private lastRenderedResult; + constructor(props: QueryProps, context: QueryContext); + fetchData(): Promise> | boolean; + componentDidMount(): void; + componentWillReceiveProps(nextProps: QueryProps, nextContext: QueryContext): void; + componentWillUnmount(): void; + componentDidUpdate(prevProps: QueryProps): void; + render(): React.ReactNode; + private extractOptsFromProps; + private initializeQueryObservable; + private setOperations; + private updateQuery; + private startQuerySubscription; + private removeQuerySubscription; + private resubscribeToQuery; + private updateCurrentData; + private handleErrorOrCompleted; + private getQueryResult; +} diff --git a/node_modules/react-apollo/Query.js b/node_modules/react-apollo/Query.js new file mode 100644 index 000000000..a25cf9c2e --- /dev/null +++ b/node_modules/react-apollo/Query.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +var apollo_client_1 = require("apollo-client"); +var parser_1 = require("./parser"); +var component_utils_1 = require("./component-utils"); +var lodash_isequal_1 = tslib_1.__importDefault(require("lodash.isequal")); +var shallowEqual_1 = tslib_1.__importDefault(require("./utils/shallowEqual")); +var ts_invariant_1 = require("ts-invariant"); +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + tslib_1.__extends(Query, _super); + function Query(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.lastRenderedResult = null; + _this.startQuerySubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: function (result) { + if (_this.lastRenderedResult && + _this.lastRenderedResult.loading === result.loading && + _this.lastRenderedResult.networkStatus === result.networkStatus && + shallowEqual_1.default(_this.lastRenderedResult.data, result.data)) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + _this.resubscribeToQuery(); + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.lastRenderedResult; + delete _this.querySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.queryObservable.currentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function () { + var result = { data: Object.create(null) }; + Object.assign(result, observableQueryFields(_this.queryObservable)); + if (_this.props.skip) { + result = tslib_1.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.queryObservable.currentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error; + if (errors && errors.length > 0) { + error = new apollo_client_1.ApolloError({ graphQLErrors: errors }); + } + var fetchPolicy = _this.queryObservable.options.fetchPolicy; + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + var previousData = _this.lastRenderedResult ? _this.lastRenderedResult.data : {}; + if (loading) { + Object.assign(result.data, previousData, currentResult.data); + } + else if (error) { + Object.assign(result, { + data: (_this.queryObservable.getLastResult() || {}).data, + }); + } + else if (fetchPolicy === 'no-cache' && + Object.keys(currentResult.data).length === 0) { + result.data = previousData; + } + else { + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + currentResult.data !== null && + typeof currentResult.data === 'object' && + Object.keys(currentResult.data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { loading: true, networkStatus: apollo_client_1.NetworkStatus.loading }); + result.refetch(); + _this.lastRenderedResult = result; + return result; + } + Object.assign(result.data, currentResult.data); + } + } + if (!_this.querySubscription) { + var oldRefetch_1 = result.refetch; + result.refetch = function (args) { + if (_this.querySubscription) { + return oldRefetch_1(args); + } + else { + return new Promise(function (r, f) { + _this.refetcherQueue = { resolve: r, reject: f, args: args }; + }); + } + }; + } + setTimeout(function () { + if (_this.queryObservable.resetQueryStoreErrors) { + _this.queryObservable.resetQueryStoreErrors(); + } + else { + var _a = _this.queryObservable, queryManager = _a.queryManager, queryId = _a.queryId; + var queryStore = queryManager.queryStore.get(queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + } + }); + result.client = _this.client; + _this.lastRenderedResult = result; + return result; + }; + _this.client = component_utils_1.getClient(props, context); + _this.initializeQueryObservable(props); + return _this; + } + Query.prototype.fetchData = function () { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, client = _a.client, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib_1.__rest(_a, ["children", "ssr", "displayName", "skip", "client", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = this.client.watchQuery(tslib_1.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (this.context && this.context.renderPromises) { + this.context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.queryObservable.currentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + if (this.props.skip) + return; + this.startQuerySubscription(); + if (this.refetcherQueue) { + var _a = this.refetcherQueue, args = _a.args, resolve = _a.resolve, reject = _a.reject; + this.queryObservable.refetch(args) + .then(resolve) + .catch(reject); + } + }; + Query.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + if (nextProps.skip && !this.props.skip) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + return; + } + var nextClient = component_utils_1.getClient(nextProps, nextContext); + if (shallowEqual_1.default(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.client !== nextClient) { + this.client = nextClient; + this.removeQuerySubscription(); + this.queryObservable = null; + } + if (this.props.query !== nextProps.query) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + } + this.updateQuery(nextProps); + if (nextProps.skip) + return; + this.startQuerySubscription(); + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !lodash_isequal_1.default(prevProps.query, this.props.query) || + !lodash_isequal_1.default(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.render = function () { + var _this = this; + var context = this.context; + var finish = function () { return _this.props.children(_this.getQueryResult()); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish); + } + return finish(); + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser_1.parser(props.query); + ts_invariant_1.invariant(this.operation.type === parser_1.DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === parser_1.DocumentType.Mutation ? 'mutation' : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib_1.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeQueryObservable = function (props) { + var opts = this.extractOptsFromProps(props); + this.setOperations(opts); + if (this.context && this.context.renderPromises) { + this.queryObservable = this.context.renderPromises.getSSRObservable(this); + } + if (!this.queryObservable) { + this.queryObservable = this.client.watchQuery(opts); + } + }; + Query.prototype.setOperations = function (props) { + if (this.context.operations) { + this.context.operations.set(this.operation.name, { + query: props.query, + variables: props.variables, + }); + } + }; + Query.prototype.updateQuery = function (props) { + if (!this.queryObservable) { + this.initializeQueryObservable(props); + } + else { + this.setOperations(props); + } + this.queryObservable.setOptions(this.extractOptsFromProps(props)) + .catch(function () { return null; }); + }; + Query.prototype.resubscribeToQuery = function () { + this.removeQuerySubscription(); + var lastError = this.queryObservable.getLastError(); + var lastResult = this.queryObservable.getLastResult(); + this.queryObservable.resetLastResults(); + this.startQuerySubscription(); + Object.assign(this.queryObservable, { lastError: lastError, lastResult: lastResult }); + }; + Query.contextTypes = { + client: PropTypes.object, + operations: PropTypes.object, + renderPromises: PropTypes.object, + }; + Query.propTypes = { + client: PropTypes.object, + children: PropTypes.func.isRequired, + fetchPolicy: PropTypes.string, + notifyOnNetworkStatusChange: PropTypes.bool, + onCompleted: PropTypes.func, + onError: PropTypes.func, + pollInterval: PropTypes.number, + query: PropTypes.object.isRequired, + variables: PropTypes.object, + ssr: PropTypes.bool, + partialRefetch: PropTypes.bool, + returnPartialData: PropTypes.bool, + }; + return Query; +}(React.Component)); +exports.default = Query; +//# sourceMappingURL=Query.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/Query.js.map b/node_modules/react-apollo/Query.js.map new file mode 100644 index 000000000..4f847c795 --- /dev/null +++ b/node_modules/react-apollo/Query.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.js","sourceRoot":"","sources":["../src/Query.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AACxC,+CAQuB;AAIvB,mCAAqE;AACrE,qDAA8C;AAG9C,0EAAqC;AACrC,8EAAgD;AAChD,6CAAyC;AAezC,SAAS,qBAAqB,CAC5B,UAA8C;IAE9C,IAAM,MAAM,GAAG;QACb,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;QAC5C,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;QAChD,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC;QACpD,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC;QACpD,eAAe,EAAE,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC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,MAAM,CAAC,IAAI,CAAC,eAAgB,EAAE,EAAE,SAAS,WAAA,EAAE,UAAU,YAAA,EAAE,CAAC,CAAC;IAClE,CAAC;IA9QM,kBAAY,GAAG;QACpB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,UAAU,EAAE,SAAS,CAAC,MAAM;QAC5B,cAAc,EAAE,SAAS,CAAC,MAAM;KACjC,CAAC;IAEK,eAAS,GAAG;QACjB,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;QACnC,WAAW,EAAE,SAAS,CAAC,MAAM;QAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;QAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;QAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;QACvB,YAAY,EAAE,SAAS,CAAC,MAAM;QAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QAClC,SAAS,EAAE,SAAS,CAAC,MAAM;QAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;QACnB,cAAc,EAAE,SAAS,CAAC,IAAI;QAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;KAClC,CAAC;IA0ZJ,YAAC;CAAA,AAhbD,CAAiF,KAAK,CAAC,SAAS,GAgb/F;kBAhboB,KAAK"} \ No newline at end of file diff --git a/node_modules/react-apollo/README.md b/node_modules/react-apollo/README.md new file mode 100644 index 000000000..02362bb58 --- /dev/null +++ b/node_modules/react-apollo/README.md @@ -0,0 +1,167 @@ +# [React Apollo](http://dev.apollodata.com/react/) [![npm version](https://badge.fury.io/js/react-apollo.svg)](https://badge.fury.io/js/react-apollo) [![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollostack.com/#slack) + +React Apollo allows you to fetch data from your GraphQL server and use it in building complex and reactive UIs using the React framework. React Apollo may be used in any context that React may be used. In the browser, in React Native, or in Node.js when you want to do server-side rendering. + +React Apollo unlike many other tools in the React ecosystem requires _no_ complex build setup to get up and running. As long as you have a GraphQL server you can get started building out your application with React immediately. React Apollo works out of the box with both [`create-react-app`][] and [React Native][] with a single install and with no extra hassle configuring Babel or other JavaScript tools. + +[`create-react-app`]: https://github.com/facebookincubator/create-react-app +[react native]: http://facebook.github.io/react-native + +React Apollo is: + +1. **Incrementally adoptable**, so that you can drop it into an existing JavaScript app and start using GraphQL for just part of your UI. +2. **Universally compatible**, so that Apollo works with any build setup, any GraphQL server, and any GraphQL schema. +3. **Simple to get started with**, you can start loading data right away and learn about advanced features later. +4. **Inspectable and understandable**, so that you can have great developer tools to understand exactly what is happening in your app. +5. **Built for interactive apps**, so your users can make changes and see them reflected in the UI immediately. +6. **Small and flexible**, so you don't get stuff you don't need. The core is under 25kb compressed. +7. **Community driven**, Apollo is driven by the community and serves a variety of use cases. Everything is planned and developed in the open. + +Get started today on the app you’ve been dreaming of, and let React Apollo take you to the moon! + +## Installation + +It is simple to install React Apollo and related libraries + +```bash +# installing the preset package (apollo-boost) and react integration +npm install apollo-boost react-apollo graphql-tag graphql --save + +# installing each piece independently +npm install apollo-client apollo-cache-inmemory apollo-link-http react-apollo graphql-tag graphql --save +``` + +[apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost) is a minimal config way to start using Apollo Client. It includes some sensible defaults, such as `InMemoryCache` and `HttpLink`. + +That’s it! You may now use React Apollo in any of your React environments. + +For an amazing developer experience you may also install the [Apollo Client Developer tools for Chrome][] which will give you inspectability into your React Apollo data. + +[apollo client developer tools for chrome]: https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm + +## Usage + +> Looking for apollo 1.x docs? See [here](https://s3.amazonaws.com/apollo-docs-1.x/index.html). + +To get started you will first want to create an instance of [`ApolloClient`][] and then you will want to provide that client to your React component tree using the [``][] component. Finally, we will show you a basic example of connecting your GraphQL data to your React components with the [``][] component. + +First we want an instance of [`ApolloClient`][]. We can import the class from `apollo-client`. +To get started, create an ApolloClient instance and point it at your GraphQL server: + +```js +import { ApolloClient } from 'apollo-client'; +import { HttpLink } from 'apollo-link-http'; +import { InMemoryCache } from 'apollo-cache-inmemory'; + +const client = new ApolloClient({ + // By default, this client will send queries to the + // `/graphql` endpoint on the same host + // Pass the configuration option { uri: YOUR_GRAPHQL_API_URL } to the `HttpLink` to connect + // to a different host + link: new HttpLink(), + cache: new InMemoryCache(), +}); +``` + +If you're using [apollo-boost](https://github.com/apollographql/apollo-client/tree/master/packages/apollo-boost), you can create an `ApolloClient` that uses `HttpLink` and `InMemoryCache` like so: + +```js +import ApolloClient from 'apollo-boost'; + +const client = new ApolloClient(); +``` + +> Migrating from 1.x? See the [2.0 migration guide](https://www.apollographql.com/docs/react/recipes/2.0-migration.html). + +Next you will want to add a [``][] component to the root of your React component tree. This component [provides](https://reactjs.org/docs/context.html) the React Apollo functionality to all the other components in the application without passing it explicitly. To use an [``][] with your newly constructed client see the following: + +```js +import { ApolloProvider } from 'react-apollo'; + +ReactDOM.render( + + + , + document.getElementById('root'), +); +``` + +Now you may create components in this React tree that are connected to your GraphQL API. + +Finally, to demonstrate the power of React Apollo in building interactive UIs let us connect one of your components to your GraphQL server using the [``][] component: + +You'll need install `graphql-tag` to use `gql` module: + +```bash +npm install graphql-tag --save +``` + +```js +import gql from 'graphql-tag'; +import { Query } from 'react-apollo'; + +const GET_DOGS = gql` + { + dogs { + id + breed + } + } +`; + +const Dogs = ({ onDogSelected }) => ( + + {({ loading, error, data }) => { + if (loading) return 'Loading...'; + if (error) return `Error! ${error.message}`; + + return ( + + ); + }} + +); +``` + +If you render Dogs within your App component, you’ll first see a loading state and then a form with a list of dog breeds once Apollo Client receives the data from the server. + +To learn more about querying with React Apollo be sure to start reading the [documentation article on Queries][]. If you would like to see all of the features React Apollo supports be sure to check out the [complete API reference][]. + +[`apolloclient`]: https://www.apollographql.com/docs/react/api/apollo-client.html#apollo-client +[``]: https://www.apollographql.com/docs/react/api/react-apollo.html#ApolloProvider +[``]: https://www.apollographql.com/docs/react/essentials/queries.html +[documentation article on queries]: http://dev.apollodata.com/react/queries.html +[complete api reference]: https://www.apollographql.com/docs/react/api/react-apollo.html + +## Polyfills + +React Apollo makes use of `Object.assign`, which is not supported in certain browsers (most prominently, IE11). If you wish to support legacy browsers, you will need to import a polyfill. As an example, you could use `core-js`'s polyfill like so: + +```js +import 'core-js/fn/object/assign'; +``` + +## Building for production + +The `react-apollo` package is designed to be effectively consumed by bundlers that understand either CommonJS `require` syntax or ECMASCript `import` and `export` syntax, such as [Rollup](https://rollupjs.org), [Webpack](https://webpack.js.org), or [Parcel](https://parceljs.org). If your bundler supports tree-shaking, it should be able to eliminate unused code from the `react-apollo` package, regardless of which module syntax you're using. + +You should (almost) never need to reach into the `react-apollo/...` internals to import specific modules. The only supported exceptions are `react-apollo/test-links`, `react-apollo/test-utils`, and `react-apollo/walkTree` (deprecated). + +When minifying your application, you can make the `react-apollo` package noticeably smaller by configuring your minifier to replace the expression `process.env.NODE_ENV` with a string literal (typically `"production"`). Other packages such as [React](https://reactjs.org) use the same convention, so there's a good chance you already have your minifier configured in this way. + +## Documentation + +For a complete React Apollo API reference visit the documentation website at: [https://www.apollographql.com/docs/react/api/react-apollo.html](https://www.apollographql.com/docs/react/api/react-apollo.html) + +All of the documentation for React Apollo including usage articles and helpful recipes lives on: [https://www.apollographql.com/docs/react/](https://www.apollographql.com/docs/react/) + +## Maintainers + +- [@benjamn](https://github.com/benjamn) (Apollo) +- [@hwillson](https://github.com/hwillson) (Apollo) diff --git a/node_modules/react-apollo/Subscriptions.d.ts b/node_modules/react-apollo/Subscriptions.d.ts new file mode 100644 index 000000000..ff26e192f --- /dev/null +++ b/node_modules/react-apollo/Subscriptions.d.ts @@ -0,0 +1,61 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import ApolloClient, { ApolloError, FetchPolicy } from 'apollo-client'; +import { DocumentNode } from 'graphql'; +import { OperationVariables } from './types'; +export interface SubscriptionResult { + loading: boolean; + data?: TData; + error?: ApolloError; +} +export interface OnSubscriptionDataOptions { + client: ApolloClient; + subscriptionData: SubscriptionResult; +} +export interface SubscriptionProps { + subscription: DocumentNode; + variables?: TVariables; + fetchPolicy?: FetchPolicy; + shouldResubscribe?: any; + client?: ApolloClient; + onSubscriptionData?: (options: OnSubscriptionDataOptions) => any; + onSubscriptionComplete?: () => void; + children?: (result: SubscriptionResult) => React.ReactNode; +} +export interface SubscriptionState { + loading: boolean; + data?: TData; + error?: ApolloError; +} +export interface SubscriptionContext { + client?: ApolloClient; +} +declare class Subscription extends React.Component, SubscriptionState> { + static contextTypes: { + client: PropTypes.Requireable; + }; + static propTypes: { + subscription: PropTypes.Validator; + variables: PropTypes.Requireable; + children: PropTypes.Requireable<(...args: any[]) => any>; + onSubscriptionData: PropTypes.Requireable<(...args: any[]) => any>; + onSubscriptionComplete: PropTypes.Requireable<(...args: any[]) => any>; + shouldResubscribe: PropTypes.Requireable any)>; + }; + private client; + private queryObservable?; + private querySubscription?; + constructor(props: SubscriptionProps, context: SubscriptionContext); + componentDidMount(): void; + componentWillReceiveProps(nextProps: SubscriptionProps, nextContext: SubscriptionContext): void; + componentWillUnmount(): void; + render(): any; + private initialize; + private startSubscription; + private getInitialState; + private updateCurrentData; + private updateError; + private completeSubscription; + private endSubscription; +} +export default Subscription; diff --git a/node_modules/react-apollo/Subscriptions.js b/node_modules/react-apollo/Subscriptions.js new file mode 100644 index 000000000..03d8f9651 --- /dev/null +++ b/node_modules/react-apollo/Subscriptions.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +var component_utils_1 = require("./component-utils"); +var shallowEqual_1 = tslib_1.__importDefault(require("./utils/shallowEqual")); +var Subscription = (function (_super) { + tslib_1.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.queryObservable) + return; + _this.queryObservable = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var _a = _this, client = _a.client, onSubscriptionData = _a.props.onSubscriptionData; + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }); + if (onSubscriptionData) + onSubscriptionData({ client: client, subscriptionData: result }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.querySubscription; + } + }; + _this.client = component_utils_1.getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = component_utils_1.getClient(nextProps, nextContext); + if (shallowEqual_1.default(this.props.variables, nextProps.variables) && + this.client === nextClient && + this.props.subscription === nextProps.subscription) { + return; + } + var shouldResubscribe = nextProps.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props, nextProps); + } + var shouldNotResubscribe = shouldResubscribe === false; + if (this.client !== nextClient) { + this.client = nextClient; + } + if (!shouldNotResubscribe) { + this.endSubscription(); + delete this.queryObservable; + this.initialize(nextProps); + this.startSubscription(); + this.setState(this.getInitialState()); + return; + } + this.initialize(nextProps); + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = Object.assign({}, this.state, { + variables: this.props.variables, + }); + return renderFn(result); + }; + Subscription.contextTypes = { + client: PropTypes.object, + }; + Subscription.propTypes = { + subscription: PropTypes.object.isRequired, + variables: PropTypes.object, + children: PropTypes.func, + onSubscriptionData: PropTypes.func, + onSubscriptionComplete: PropTypes.func, + shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]), + }; + return Subscription; +}(React.Component)); +exports.default = Subscription; +//# sourceMappingURL=Subscriptions.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/Subscriptions.js.map b/node_modules/react-apollo/Subscriptions.js.map new file mode 100644 index 000000000..ff95fe105 --- /dev/null +++ b/node_modules/react-apollo/Subscriptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Subscriptions.js","sourceRoot":"","sources":["../src/Subscriptions.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AAOxC,qDAA8C;AAE9C,8EAAgD;AAmChD;IAA0D,wCAGzD;IAkBC,sBAAY,KAA2C,EAAE,OAA4B;QAArF,YACE,kBAAM,KAAK,EAAE,OAAO,CAAC,SAKtB;QAsDO,gBAAU,GAAG,UAAC,KAA2C;YAC/D,IAAI,KAAI,CAAC,eAAe;gBAAE,OAAO;YACjC,KAAI,CAAC,eAAe,GAAG,KAAI,CAAC,MAAM,CAAC,SAAS,CAAC;gBAC3C,KAAK,EAAE,KAAK,CAAC,YAAY;gBACzB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;aAC/B,CAAC,CAAC;QACL,CAAC,CAAC;QAEM,uBAAiB,GAAG;YAC1B,IAAI,KAAI,CAAC,iBAAiB;gBAAE,OAAO;YACnC,KAAI,CAAC,iBAAiB,GAAG,KAAI,CAAC,eAAgB,CAAC,SAAS,CAAC;gBACvD,IAAI,EAAE,KAAI,CAAC,iBAAiB;gBAC5B,KAAK,EAAE,KAAI,CAAC,WAAW;gBACvB,QAAQ,EAAE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IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC3B,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE;YAC3C,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;SAChC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IA3EM,yBAAY,GAAG;QACpB,MAAM,EAAE,SAAS,CAAC,MAAM;KACzB,CAAC;IAEK,sBAAS,GAAG;QACjB,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;QACzC,SAAS,EAAE,SAAS,CAAC,MAAM;QAC3B,QAAQ,EAAE,SAAS,CAAC,IAAI;QACxB,kBAAkB,EAAE,SAAS,CAAC,IAAI;QAClC,sBAAsB,EAAE,SAAS,CAAC,IAAI;QACtC,iBAAiB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;KACzE,CAAC;IA0HJ,mBAAC;CAAA,AAzID,CAA0D,KAAK,CAAC,SAAS,GAyIxE;AAED,kBAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/react-apollo/component-utils.d.ts b/node_modules/react-apollo/component-utils.d.ts new file mode 100644 index 000000000..78f43993d --- /dev/null +++ b/node_modules/react-apollo/component-utils.d.ts @@ -0,0 +1,8 @@ +import ApolloClient from 'apollo-client'; +export interface CommonComponentProps { + client?: ApolloClient; +} +export interface CommonComponentContext { + client?: ApolloClient; +} +export declare function getClient(props: CommonComponentProps, context: CommonComponentContext): ApolloClient; diff --git a/node_modules/react-apollo/component-utils.js b/node_modules/react-apollo/component-utils.js new file mode 100644 index 000000000..bc19e6eda --- /dev/null +++ b/node_modules/react-apollo/component-utils.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ts_invariant_1 = require("ts-invariant"); +function getClient(props, context) { + var client = props.client || context.client; + ts_invariant_1.invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} +exports.getClient = getClient; +//# sourceMappingURL=component-utils.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/component-utils.js.map b/node_modules/react-apollo/component-utils.js.map new file mode 100644 index 000000000..8e0491cb7 --- /dev/null +++ b/node_modules/react-apollo/component-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"component-utils.js","sourceRoot":"","sources":["../src/component-utils.tsx"],"names":[],"mappings":";;AACA,6CAAyC;AAUzC,SAAgB,SAAS,CACvB,KAA2B,EAC3B,OAA+B;IAE/B,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAE9C,wBAAS,CACP,CAAC,CAAC,MAAM,EACR,iEAAiE;QAC/D,6DAA6D;QAC7D,qCAAqC,CACxC,CAAC;IAEF,OAAO,MAA8B,CAAC;AACxC,CAAC;AAdD,8BAcC"} \ No newline at end of file diff --git a/node_modules/react-apollo/getDataFromTree.d.ts b/node_modules/react-apollo/getDataFromTree.d.ts new file mode 100644 index 000000000..14eb030a8 --- /dev/null +++ b/node_modules/react-apollo/getDataFromTree.d.ts @@ -0,0 +1,24 @@ +import * as React from 'react'; +import Query from './Query'; +import { ObservableQuery } from 'apollo-client'; +export declare class RenderPromises { + private queryPromises; + private queryInfoTrie; + registerSSRObservable(queryInstance: Query, observable: ObservableQuery): void; + getSSRObservable(queryInstance: Query): ObservableQuery | null; + addQueryPromise(queryInstance: Query, finish: () => React.ReactNode): React.ReactNode; + hasPromises(): boolean; + consumeAndAwaitPromises(): Promise; + private lookupQueryInfo; +} +export default function getDataFromTree(tree: React.ReactNode, context?: { + [key: string]: any; +}): Promise; +export declare type GetMarkupFromTreeOptions = { + tree: React.ReactNode; + context?: { + [key: string]: any; + }; + renderFunction?: (tree: React.ReactElement) => string; +}; +export declare function getMarkupFromTree({ tree, context, renderFunction, }: GetMarkupFromTreeOptions): Promise; diff --git a/node_modules/react-apollo/getDataFromTree.js b/node_modules/react-apollo/getDataFromTree.js new file mode 100644 index 000000000..8d9f89e8e --- /dev/null +++ b/node_modules/react-apollo/getDataFromTree.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var PropTypes = tslib_1.__importStar(require("prop-types")); +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData()); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +exports.RenderPromises = RenderPromises; +function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require("react-dom/server").renderToStaticMarkup, + }); +} +exports.default = getDataFromTree; +function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require("react-dom/server").renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + var RenderPromisesProvider = (function (_super) { + tslib_1.__extends(RenderPromisesProvider, _super); + function RenderPromisesProvider() { + return _super !== null && _super.apply(this, arguments) || this; + } + RenderPromisesProvider.prototype.getChildContext = function () { + return tslib_1.__assign({}, context, { renderPromises: renderPromises }); + }; + RenderPromisesProvider.prototype.render = function () { + return tree; + }; + RenderPromisesProvider.childContextTypes = { + renderPromises: PropTypes.object, + }; + return RenderPromisesProvider; + }(React.Component)); + Object.keys(context).forEach(function (key) { + RenderPromisesProvider.childContextTypes[key] = PropTypes.any; + }); + function process() { + var html = renderFunction(React.createElement(RenderPromisesProvider)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} +exports.getMarkupFromTree = getMarkupFromTree; +//# sourceMappingURL=getDataFromTree.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/getDataFromTree.js.map b/node_modules/react-apollo/getDataFromTree.js.map new file mode 100644 index 000000000..aa7a3907e --- /dev/null +++ b/node_modules/react-apollo/getDataFromTree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getDataFromTree.js","sourceRoot":"","sources":["../src/getDataFromTree.ts"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,4DAAwC;AAUxC,SAAS,oBAAoB;IAC3B,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC;AAED;IAAA;QAEU,kBAAa,GAAG,IAAI,GAAG,EAAiC,CAAC;QAMzD,kBAAa,GAAG,IAAI,GAAG,EAAwC,CAAC;IAq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AAC;KAAA,AAjBD,CAAqC,KAAK,CAAC,SAAS,GAiBnD;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;QAC9B,sBAAsB,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,SAAS,OAAO;QACd,IAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACzE,OAAO,cAAc,CAAC,WAAW,EAAE;YACjC,CAAC,CAAC,cAAc,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC;AAzCD,8CAyCC"} \ No newline at end of file diff --git a/node_modules/react-apollo/graphql.d.ts b/node_modules/react-apollo/graphql.d.ts new file mode 100644 index 000000000..ac53fd8ea --- /dev/null +++ b/node_modules/react-apollo/graphql.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +import { DocumentNode } from 'graphql'; +import { OperationOption, DataProps, MutateProps } from './types'; +export declare function graphql> & Partial>>(document: DocumentNode, operationOptions?: OperationOption): (WrappedComponent: React.ComponentType) => React.ComponentClass; diff --git a/node_modules/react-apollo/graphql.js b/node_modules/react-apollo/graphql.js new file mode 100644 index 000000000..baab1e584 --- /dev/null +++ b/node_modules/react-apollo/graphql.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var parser_1 = require("./parser"); +var query_hoc_1 = require("./query-hoc"); +var mutation_hoc_1 = require("./mutation-hoc"); +var subscription_hoc_1 = require("./subscription-hoc"); +function graphql(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + switch (parser_1.parser(document).type) { + case parser_1.DocumentType.Mutation: + return mutation_hoc_1.withMutation(document, operationOptions); + case parser_1.DocumentType.Subscription: + return subscription_hoc_1.withSubscription(document, operationOptions); + case parser_1.DocumentType.Query: + default: + return query_hoc_1.withQuery(document, operationOptions); + } +} +exports.graphql = graphql; +//# sourceMappingURL=graphql.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/graphql.js.map b/node_modules/react-apollo/graphql.js.map new file mode 100644 index 000000000..78ddee59d --- /dev/null +++ b/node_modules/react-apollo/graphql.js.map @@ -0,0 +1 @@ +{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../src/graphql.tsx"],"names":[],"mappings":";;AAEA,mCAAgD;AAGhD,yCAAwC;AACxC,+CAA8C;AAC9C,uDAAsD;AAEtD,SAAgB,OAAO,CAOrB,QAAsB,EACtB,gBAAqF;IAArF,iCAAA,EAAA,qBAAqF;IAErF,QAAQ,eAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;QAC7B,KAAK,qBAAY,CAAC,QAAQ;YACxB,OAAO,2BAAY,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAClD,KAAK,qBAAY,CAAC,YAAY;YAC5B,OAAO,mCAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAGtD,KAAK,qBAAY,CAAC,KAAK,CAAC;QACxB;YACE,OAAO,qBAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;KAChD;AACH,CAAC;AArBD,0BAqBC"} \ No newline at end of file diff --git a/node_modules/react-apollo/hoc-utils.d.ts b/node_modules/react-apollo/hoc-utils.d.ts new file mode 100644 index 000000000..93995ec37 --- /dev/null +++ b/node_modules/react-apollo/hoc-utils.d.ts @@ -0,0 +1,16 @@ +import * as React from 'react'; +import { OperationVariables } from './types'; +import { IDocumentDefinition } from './parser'; +export declare const defaultMapPropsToOptions: () => {}; +export declare const defaultMapResultToProps:

    (props: P) => P; +export declare const defaultMapPropsToSkip: () => boolean; +export declare function getDisplayName

    (WrappedComponent: React.ComponentType

    ): string; +export declare function calculateVariablesFromProps(operation: IDocumentDefinition, props: TProps): OperationVariables; +export declare type RefSetter = (ref: React.ComponentClass) => void | void; +export declare class GraphQLBase extends React.Component { + withRef: boolean; + private wrappedInstance?; + constructor(props: TProps); + getWrappedInstance(): React.ComponentClass | undefined; + setWrappedInstance(ref: React.ComponentClass): void; +} diff --git a/node_modules/react-apollo/hoc-utils.js b/node_modules/react-apollo/hoc-utils.js new file mode 100644 index 000000000..5be3d26f0 --- /dev/null +++ b/node_modules/react-apollo/hoc-utils.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var ts_invariant_1 = require("ts-invariant"); +exports.defaultMapPropsToOptions = function () { return ({}); }; +exports.defaultMapResultToProps = function (props) { return props; }; +exports.defaultMapPropsToSkip = function () { return false; }; +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +exports.getDisplayName = getDisplayName; +function calculateVariablesFromProps(operation, props) { + var variables = {}; + for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) { + var _b = _a[_i], variable = _b.variable, type = _b.type; + if (!variable.name || !variable.name.value) + continue; + var variableName = variable.name.value; + var variableProp = props[variableName]; + if (typeof variableProp !== 'undefined') { + variables[variableName] = variableProp; + continue; + } + if (type.kind !== 'NonNullType') { + variables[variableName] = undefined; + } + } + return variables; +} +exports.calculateVariablesFromProps = calculateVariablesFromProps; +var GraphQLBase = (function (_super) { + tslib_1.__extends(GraphQLBase, _super); + function GraphQLBase(props) { + var _this = _super.call(this, props) || this; + _this.withRef = false; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + GraphQLBase.prototype.getWrappedInstance = function () { + ts_invariant_1.invariant(this.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + GraphQLBase.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + return GraphQLBase; +}(React.Component)); +exports.GraphQLBase = GraphQLBase; +//# sourceMappingURL=hoc-utils.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/hoc-utils.js.map b/node_modules/react-apollo/hoc-utils.js.map new file mode 100644 index 000000000..d88dfbedc --- /dev/null +++ b/node_modules/react-apollo/hoc-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hoc-utils.js","sourceRoot":"","sources":["../src/hoc-utils.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,6CAAyC;AAK5B,QAAA,wBAAwB,GAAG,cAAM,OAAA,CAAC,EAAE,CAAC,EAAJ,CAAI,CAAC;AACtC,QAAA,uBAAuB,GAAuB,UAAA,KAAK,IAAI,OAAA,KAAK,EAAL,CAAK,CAAC;AAC7D,QAAA,qBAAqB,GAAG,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC;AAEjD,SAAgB,cAAc,CAAI,gBAAwC;IACxE,OAAO,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,IAAI,IAAI,WAAW,CAAC;AAC9E,CAAC;AAFD,wCAEC;AAED,SAAgB,2BAA2B,CAAS,SAA8B,EAAE,KAAa;IAC/F,IAAI,SAAS,GAAuB,EAAE,CAAC;IACvC,KAA+B,UAAmB,EAAnB,KAAA,SAAS,CAAC,SAAS,EAAnB,cAAmB,EAAnB,IAAmB,EAAE;QAA3C,IAAA,WAAkB,EAAhB,sBAAQ,EAAE,cAAI;QACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;YAAE,SAAS;QAErD,IAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QACzC,IAAM,YAAY,GAAI,KAAa,CAAC,YAAY,CAAC,CAAC;QAElD,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;YACvC,SAAS,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;YACvC,SAAS;SACV;QAGD,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;SACrC;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,kEAmBC;AAKD;IAAoE,uCAGnE;IAKC,qBAAY,KAAa;QAAzB,YACE,kBAAM,KAAK,CAAC,SAEb;QAPM,aAAO,GAAY,KAAK,CAAC;QAM9B,KAAI,CAAC,kBAAkB,GAAG,KAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IAC/D,CAAC;IAED,wCAAkB,GAAlB;QACE,wBAAS,CACP,IAAI,CAAC,OAAO,EACZ,sDAAsD,GAAG,kCAAkC,CAC5F,CAAC;QAEF,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,wCAAkB,GAAlB,UAAmB,GAAsC;QACvD,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;IACH,kBAAC;AAAD,CAAC,AAzBD,CAAoE,KAAK,CAAC,SAAS,GAyBlF;AAzBY,kCAAW"} \ No newline at end of file diff --git a/node_modules/react-apollo/index.d.ts b/node_modules/react-apollo/index.d.ts new file mode 100644 index 000000000..be92df2fe --- /dev/null +++ b/node_modules/react-apollo/index.d.ts @@ -0,0 +1,22 @@ +export { ApolloContext } from './ApolloContext'; +export { default as ApolloConsumer } from './ApolloConsumer'; +export * from './ApolloConsumer'; +export { default as ApolloProvider } from './ApolloProvider'; +export * from './ApolloProvider'; +export { default as Query } from './Query'; +export * from './Query'; +export { default as Mutation } from './Mutation'; +export * from './Mutation'; +export { default as Subscription } from './Subscriptions'; +export * from './Subscriptions'; +export { graphql } from './graphql'; +export { withQuery } from './query-hoc'; +export { withMutation } from './mutation-hoc'; +export { withSubscription } from './subscription-hoc'; +export { default as withApollo } from './withApollo'; +export * from './withApollo'; +export * from './getDataFromTree'; +export { default as getDataFromTree } from './getDataFromTree'; +export { renderToStringWithData } from './renderToStringWithData'; +export * from './types'; +export { compose } from './utils/flowRight'; diff --git a/node_modules/react-apollo/index.js b/node_modules/react-apollo/index.js new file mode 100644 index 000000000..0471397ae --- /dev/null +++ b/node_modules/react-apollo/index.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var ApolloContext_1 = require("./ApolloContext"); +exports.ApolloContext = ApolloContext_1.ApolloContext; +var ApolloConsumer_1 = require("./ApolloConsumer"); +exports.ApolloConsumer = ApolloConsumer_1.default; +tslib_1.__exportStar(require("./ApolloConsumer"), exports); +var ApolloProvider_1 = require("./ApolloProvider"); +exports.ApolloProvider = ApolloProvider_1.default; +tslib_1.__exportStar(require("./ApolloProvider"), exports); +var Query_1 = require("./Query"); +exports.Query = Query_1.default; +tslib_1.__exportStar(require("./Query"), exports); +var Mutation_1 = require("./Mutation"); +exports.Mutation = Mutation_1.default; +tslib_1.__exportStar(require("./Mutation"), exports); +var Subscriptions_1 = require("./Subscriptions"); +exports.Subscription = Subscriptions_1.default; +tslib_1.__exportStar(require("./Subscriptions"), exports); +var graphql_1 = require("./graphql"); +exports.graphql = graphql_1.graphql; +var query_hoc_1 = require("./query-hoc"); +exports.withQuery = query_hoc_1.withQuery; +var mutation_hoc_1 = require("./mutation-hoc"); +exports.withMutation = mutation_hoc_1.withMutation; +var subscription_hoc_1 = require("./subscription-hoc"); +exports.withSubscription = subscription_hoc_1.withSubscription; +var withApollo_1 = require("./withApollo"); +exports.withApollo = withApollo_1.default; +tslib_1.__exportStar(require("./withApollo"), exports); +tslib_1.__exportStar(require("./getDataFromTree"), exports); +var getDataFromTree_1 = require("./getDataFromTree"); +exports.getDataFromTree = getDataFromTree_1.default; +var renderToStringWithData_1 = require("./renderToStringWithData"); +exports.renderToStringWithData = renderToStringWithData_1.renderToStringWithData; +var flowRight_1 = require("./utils/flowRight"); +exports.compose = flowRight_1.compose; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/index.js.map b/node_modules/react-apollo/index.js.map new file mode 100644 index 000000000..33261fb6f --- /dev/null +++ b/node_modules/react-apollo/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,wCAAA,aAAa,CAAA;AAEtB,mDAA6D;AAApD,0CAAA,OAAO,CAAkB;AAClC,2DAAiC;AAEjC,mDAA6D;AAApD,0CAAA,OAAO,CAAkB;AAClC,2DAAiC;AAEjC,iCAA2C;AAAlC,wBAAA,OAAO,CAAS;AACzB,kDAAwB;AAExB,uCAAiD;AAAxC,8BAAA,OAAO,CAAY;AAC5B,qDAA2B;AAE3B,iDAA0D;AAAjD,uCAAA,OAAO,CAAgB;AAChC,0DAAgC;AAEhC,qCAAoC;AAA3B,4BAAA,OAAO,CAAA;AAChB,yCAAwC;AAA/B,gCAAA,SAAS,CAAA;AAClB,+CAA8C;AAArC,sCAAA,YAAY,CAAA;AACrB,uDAAsD;AAA7C,8CAAA,gBAAgB,CAAA;AAEzB,2CAAqD;AAA5C,kCAAA,OAAO,CAAc;AAC9B,uDAA6B;AAE7B,4DAAkC;AAClC,qDAA+D;AAAtD,4CAAA,OAAO,CAAmB;AACnC,mEAAkE;AAAzD,0DAAA,sBAAsB,CAAA;AAI/B,+CAA4C;AAAnC,8BAAA,OAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/react-apollo/mutation-hoc.d.ts b/node_modules/react-apollo/mutation-hoc.d.ts new file mode 100644 index 000000000..a50bd8462 --- /dev/null +++ b/node_modules/react-apollo/mutation-hoc.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +import { DocumentNode } from 'graphql'; +import { OperationOption, MutateProps } from './types'; +export declare function withMutation>(document: DocumentNode, operationOptions?: OperationOption): (WrappedComponent: React.ComponentType) => React.ComponentClass; diff --git a/node_modules/react-apollo/mutation-hoc.js b/node_modules/react-apollo/mutation-hoc.js new file mode 100644 index 000000000..b16c308ab --- /dev/null +++ b/node_modules/react-apollo/mutation-hoc.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics")); +var parser_1 = require("./parser"); +var Mutation_1 = tslib_1.__importDefault(require("./Mutation")); +var hoc_utils_1 = require("./hoc-utils"); +function withMutation(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser_1.parser(document); + var _a = operationOptions.options, options = _a === void 0 ? hoc_utils_1.defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + hoc_utils_1.getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib_1.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var props = this.props; + var opts = mapPropsToOptions(props); + if (operationOptions.withRef) { + this.withRef = true; + props = Object.assign({}, props, { + ref: this.setWrappedInstance, + }); + } + if (!opts.variables && operation.variables.length > 0) { + opts.variables = hoc_utils_1.calculateVariablesFromProps(operation, props); + } + return (React.createElement(Mutation_1.default, tslib_1.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _a) { + var _b, _c; + var data = _a.data, r = tslib_1.__rest(_a, ["data"]); + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'mutate'; + var resultName = operationOptions.name ? name + "Result" : 'result'; + var childProps = (_b = {}, _b[name] = mutate, _b[resultName] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = mutate, + _c[resultName] = result, + _c.ownProps = props, + _c); + childProps = operationOptions.props(newResult); + } + return (React.createElement(WrappedComponent, tslib_1.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(hoc_utils_1.GraphQLBase)); + return hoist_non_react_statics_1.default(GraphQL, WrappedComponent, {}); + }; +} +exports.withMutation = withMutation; +//# sourceMappingURL=mutation-hoc.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/mutation-hoc.js.map b/node_modules/react-apollo/mutation-hoc.js.map new file mode 100644 index 000000000..6afcd8ac7 --- /dev/null +++ b/node_modules/react-apollo/mutation-hoc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mutation-hoc.js","sourceRoot":"","sources":["../src/mutation-hoc.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAE/B,4FAA2D;AAE3D,mCAAkC;AAElC,gEAAiD;AACjD,yCAKqB;AAErB,SAAgB,YAAY,CAM1B,QAAsB,EACtB,gBAAqF;IAArF,iCAAA,EAAA,qBAAqF;IAGrF,IAAM,SAAS,GAAG,eAAM,CAAC,QAAQ,CAAC,CAAC;IAG3B,IAAA,6BAAkC,EAAlC,mEAAkC,EAAE,2BAAgB,EAAhB,qCAAgB,CAAsB;IAElF,IAAI,iBAAiB,GAAG,OAAuC,CAAC;IAChE,IAAI,OAAO,iBAAiB,KAAK,UAAU;QAAE,iBAAiB,GAAG,cAAM,OAAA,OAAuB,EAAvB,CAAuB,CAAC;IAE/F,OAAO,UACL,gBAA2D;QAE3D,IAAM,kBAAkB,GAAM,KAAK,SAAI,0BAAc,CAAC,gBAAgB,CAAC,MAAG,CAAC;QAC3E;YAAsB,mCAAgC;YAAtD;;YAkDA,CAAC;YA/CC,wBAAM,GAAN;gBACE,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBACvB,IAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAEtC,IAAI,gBAAgB,CAAC,OAAO,EAAE;oBAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;oBACpB,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,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W,GAkDhC;QAGD,OAAO,iCAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AA7ED,oCA6EC"} \ No newline at end of file diff --git a/node_modules/react-apollo/package.json b/node_modules/react-apollo/package.json new file mode 100644 index 000000000..26c6303b2 --- /dev/null +++ b/node_modules/react-apollo/package.json @@ -0,0 +1,51 @@ +{ + "name": "react-apollo", + "version": "2.5.8", + "author": "opensource@apollographql.com", + "description": "React data container for Apollo Client", + "keywords": [ + "apollo", + "graphql", + "react" + ], + "license": "MIT", + "main": "react-apollo.cjs.js", + "module": "react-apollo.esm.js", + "react-native": { + "react-dom/server": false + }, + "typings": "index.d.ts", + "repository": { + "type": "git", + "url": "apollographql/react-apollo" + }, + "renovate": { + "extends": [ + "config:base", + "schedule:nonOfficeHours", + ":pinOnlyDevDependencies" + ], + "semanticCommits": true, + "timezone": "America/New_York", + "automerge": false, + "labels": [ + "dependencies" + ] + }, + "peerDependencies": { + "apollo-client": "^2.6.3", + "react": "^15.0.0 || ^16.0.0", + "react-dom": "^15.0.0 || ^16.0.0", + "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" + }, + "sideEffects": false, + "dependencies": { + "apollo-utilities": "^1.3.0", + "fast-json-stable-stringify": "^2.0.0", + "hoist-non-react-statics": "^3.3.0", + "lodash.isequal": "^4.5.0", + "prop-types": "^15.7.2", + "ts-invariant": "^0.4.2", + "tslib": "^1.9.3" + } +} \ No newline at end of file diff --git a/node_modules/react-apollo/parser.d.ts b/node_modules/react-apollo/parser.d.ts new file mode 100644 index 000000000..65a107673 --- /dev/null +++ b/node_modules/react-apollo/parser.d.ts @@ -0,0 +1,12 @@ +import { DocumentNode, VariableDefinitionNode } from 'graphql'; +export declare enum DocumentType { + Query = 0, + Mutation = 1, + Subscription = 2 +} +export interface IDocumentDefinition { + type: DocumentType; + name: string; + variables: ReadonlyArray; +} +export declare function parser(document: DocumentNode): IDocumentDefinition; diff --git a/node_modules/react-apollo/parser.js b/node_modules/react-apollo/parser.js new file mode 100644 index 000000000..9e3f76f81 --- /dev/null +++ b/node_modules/react-apollo/parser.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var ts_invariant_1 = require("ts-invariant"); +var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType = exports.DocumentType || (exports.DocumentType = {})); +var cache = new Map(); +function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + ts_invariant_1.invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'query'; }); + var mutations = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'mutation'; }); + var subscriptions = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'subscription'; }); + ts_invariant_1.invariant(!fragments.length || (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + ts_invariant_1.invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; + ts_invariant_1.invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} +exports.parser = parser; +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/parser.js.map b/node_modules/react-apollo/parser.js.map new file mode 100644 index 000000000..d338832a3 --- /dev/null +++ b/node_modules/react-apollo/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;AAOA,6CAAyC;AAEzC,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iDAAK,CAAA;IACL,uDAAQ,CAAA;IACR,+DAAY,CAAA;AACd,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAQD,IAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;AAGxB,SAAgB,MAAM,CAAC,QAAsB;IAC3C,IAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,IAAI,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;IAO1B,wBAAS,CACP,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAE7B,iBAAe,QAAQ,+CAA4C;QACjE,oEAAoE;QACpE,2CAA2C,CAC9C,CAAC;IAEF,IAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CAC3C,UAAC,CAAiB,IAAK,OAAA,CAAC,CAAC,IAAI,KAAK,oBAAoB,EAA/B,CAA+B,CACvD,CAAC;IAEF,IAAM,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,CACzC,UAAC,CAAiB,IAAK,OAAA,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,C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5F,wBAAS,CACP,WAAW,CAAC,MAAM,KAAK,CAAC,EAExB,wDAAsD,QAAQ,UAAO;SAChE,WAAW,CAAC,MAAM,mBAAgB,CAAA;QACrC,uEAAuE,CAC1E,CAAC;IAEF,IAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAA4B,CAAC;IAC7D,SAAS,GAAG,UAAU,CAAC,mBAAmB,IAAI,EAAE,CAAC;IAEjD,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;QACtD,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;KAC9B;SAAM;QACL,IAAI,GAAG,MAAM,CAAC;KACf;IAED,IAAM,OAAO,GAAG,EAAE,IAAI,MAAA,EAAE,IAAI,MAAA,EAAE,SAAS,WAAA,EAAE,CAAC;IAC1C,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,OAAO,CAAC;AACjB,CAAC;AA3ED,wBA2EC"} \ No newline at end of file diff --git a/node_modules/react-apollo/query-hoc.d.ts b/node_modules/react-apollo/query-hoc.d.ts new file mode 100644 index 000000000..47175c515 --- /dev/null +++ b/node_modules/react-apollo/query-hoc.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +import { DocumentNode } from 'graphql'; +import { OperationOption, DataProps } from './types'; +export declare function withQuery>(document: DocumentNode, operationOptions?: OperationOption): (WrappedComponent: React.ComponentType) => React.ComponentClass; diff --git a/node_modules/react-apollo/query-hoc.js b/node_modules/react-apollo/query-hoc.js new file mode 100644 index 000000000..75acf9928 --- /dev/null +++ b/node_modules/react-apollo/query-hoc.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics")); +var parser_1 = require("./parser"); +var Query_1 = tslib_1.__importDefault(require("./Query")); +var hoc_utils_1 = require("./hoc-utils"); +function withQuery(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser_1.parser(document); + var _a = operationOptions.options, options = _a === void 0 ? hoc_utils_1.defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? hoc_utils_1.defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') { + mapPropsToOptions = function () { return options; }; + } + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') { + mapPropsToSkip = function () { return skip; }; + } + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + hoc_utils_1.getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib_1.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : tslib_1.__assign({}, mapPropsToOptions(props)); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = hoc_utils_1.calculateVariablesFromProps(operation, props); + } + return (React.createElement(Query_1.default, tslib_1.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) { + var _b, _c; + var _ = _a.client, data = _a.data, r = tslib_1.__rest(_a, ["client", "data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (React.createElement(WrappedComponent, tslib_1.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (React.createElement(WrappedComponent, tslib_1.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(hoc_utils_1.GraphQLBase)); + return hoist_non_react_statics_1.default(GraphQL, WrappedComponent, {}); + }; +} +exports.withQuery = withQuery; +//# sourceMappingURL=query-hoc.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/query-hoc.js.map b/node_modules/react-apollo/query-hoc.js.map new file mode 100644 index 000000000..011301077 --- /dev/null +++ b/node_modules/react-apollo/query-hoc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"query-hoc.js","sourceRoot":"","sources":["../src/query-hoc.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAE/B,4FAA2D;AAE3D,mCAAkC;AAElC,0DAA2C;AAC3C,yCAMqB;AAErB,SAAgB,SAAS,CAMvB,QAAsB,EACtB,gBAAqF;IAArF,iCAAA,EAAA,qBAAqF;IAGrF,IAAM,SAAS,GAAG,eAAM,CAAC,QAAQ,CAAC,CAAC;IAGjC,IAAA,6BAAkC,EAAlC,mEAAkC,EAClC,0BAA4B,EAA5B,6DAA4B,EAC5B,2BAAgB,EAAhB,qCAAgB,CACG;IAErB,IAAI,iBAAiB,GAAG,OAAoC,CAAC;IAC7D,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAAE;QAC3C,iBAAiB,GAAG,cAAM,OAAA,OAAoB,EAApB,CAAoB,CAAC;KAChD;IAED,IAAI,cAAc,GAAG,IAA+B,CAAC;IACrD,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE;QACxC,cAAc,GAAG,cAAM,OAAA,IAAW,EAAX,CAAW,CAAC;KACpC;IAGD,IAAI,eAAmC,CAAC;IACxC,OAAO,UACL,gBAA2D;QAE3D,IAAM,kBAAkB,GAAM,KAAK,SAAI,0BAAc,CAAC,gBAAgB,CAAC,MAAG,CAAC;QAC3E;YAAsB,mCAAgC;YAAtD;;YAiEA,CAAC;YA7DC,wBAAM,GA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K,EAAE;wBAC1B,IAAM,SAAS;4BACb,GAAC,IAAI,IAAG,MAAM;4BACd,WAAQ,GAAE,KAAe;+BAC1B,CAAC;wBACF,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;wBACrE,UAAU,GAAG,eAAe,CAAC;qBAC9B;oBAED,OAAO,CACL,oBAAC,gBAAgB,uBACX,KAAe,EACf,UAAyB,EAC7B,CACH,CAAC;gBACJ,CAAC,CACK,CACT,CAAC;YACJ,CAAC;YA/DM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YA+D7C,cAAC;SAAA,AAjED,CAAsB,uBAAW,GAiEhC;QAGD,OAAO,iCAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AAxGD,8BAwGC"} \ No newline at end of file diff --git a/node_modules/react-apollo/queryRecycler.d.ts b/node_modules/react-apollo/queryRecycler.d.ts new file mode 100644 index 000000000..65db26c35 --- /dev/null +++ b/node_modules/react-apollo/queryRecycler.d.ts @@ -0,0 +1,7 @@ +import { ObservableQuery } from 'apollo-client'; +import { QueryOpts } from './types'; +export declare class ObservableQueryRecycler { + private observableQueries; + recycle(observableQuery: ObservableQuery): void; + reuse(options: QueryOpts): null | ObservableQuery; +} diff --git a/node_modules/react-apollo/queryRecycler.js b/node_modules/react-apollo/queryRecycler.js new file mode 100644 index 000000000..385b7a654 --- /dev/null +++ b/node_modules/react-apollo/queryRecycler.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var shallowEqual_1 = tslib_1.__importDefault(require("./utils/shallowEqual")); +var ObservableQueryRecycler = (function () { + function ObservableQueryRecycler() { + this.observableQueries = []; + } + ObservableQueryRecycler.prototype.recycle = function (observableQuery) { + observableQuery.setOptions({ + query: observableQuery.options.query, + fetchPolicy: 'standby', + pollInterval: 0, + fetchResults: false, + }); + this.observableQueries.push({ + observableQuery: observableQuery, + subscription: observableQuery.subscribe({}), + }); + }; + ObservableQueryRecycler.prototype.reuse = function (options) { + if (this.observableQueries.length <= 0) { + return null; + } + var item = this.observableQueries.pop(); + if (!item) { + return null; + } + var observableQuery = item.observableQuery, subscription = item.subscription; + subscription.unsubscribe(); + var ssr = options.ssr, client = options.client, modifiableOpts = tslib_1.__rest(options, ["ssr", "client"]); + if (!shallowEqual_1.default(modifiableOpts.variables || {}, observableQuery.variables)) + return null; + observableQuery.setOptions(tslib_1.__assign({}, modifiableOpts, { pollInterval: options.pollInterval, fetchPolicy: options.fetchPolicy })); + return observableQuery; + }; + return ObservableQueryRecycler; +}()); +exports.ObservableQueryRecycler = ObservableQueryRecycler; +//# sourceMappingURL=queryRecycler.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/queryRecycler.js.map b/node_modules/react-apollo/queryRecycler.js.map new file mode 100644 index 000000000..f55950550 --- /dev/null +++ b/node_modules/react-apollo/queryRecycler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queryRecycler.js","sourceRoot":"","sources":["../src/queryRecycler.ts"],"names":[],"mappings":";;;AAIA,8EAAgD;AAyBhD;IAAA;QAIU,sBAAiB,GAA+B,EAAE,CAAC;IAkF7D,CAAC;IArEQ,yCAAO,GAAd,UAAe,eAAqC;QAGlD,eAAe,CAAC,UAAU,CAAC;YACzB,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK;YACpC,WAAW,EAAE,SAAS;YACtB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAC1B,eAAe,iBAAA;YACf,YAAY,EAAE,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;IAWM,uCAAK,GAAZ,UAAa,OAAkB;QAC7B,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,IAAI,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC;SACb;QAED,IAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAI,CAAC;SACb;QACO,IAAA,sCAAe,EAAE,gCAAY,CAAU;QAC/C,YAAY,CAAC,WAAW,EAAE,CAAC;QAGnB,IAAA,iBAAG,EAAE,uBAAM,EAAE,2DAAiB,CAAa;QAYnD,IAAI,CAAC,sBAAY,CAAC,cAAc,CAAC,SAAS,IAAI,EAAE,EAAE,eAAe,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAS1F,eAAe,CAAC,UAAU,CAAC,qBACtB,cAAc,IAGjB,YAAY,EAAE,OAAO,CAAC,YAAY,EAClC,WAAW,EAAE,OAAO,CAAC,WAAW,GAC1B,CAAC,CAAC;QAEV,OAAO,eAAe,CAAC;IACzB,CAAC;IACH,8BAAC;AAAD,CAAC,AAtFD,IAsFC;AAtFY,0DAAuB"} \ No newline at end of file diff --git a/node_modules/react-apollo/react-apollo.cjs.d.ts b/node_modules/react-apollo/react-apollo.cjs.d.ts new file mode 100644 index 000000000..ea465c2a3 --- /dev/null +++ b/node_modules/react-apollo/react-apollo.cjs.d.ts @@ -0,0 +1 @@ +export * from './index'; diff --git a/node_modules/react-apollo/react-apollo.cjs.js b/node_modules/react-apollo/react-apollo.cjs.js new file mode 100644 index 000000000..f03c0523c --- /dev/null +++ b/node_modules/react-apollo/react-apollo.cjs.js @@ -0,0 +1,1097 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var react = require('react'); +var propTypes = require('prop-types'); +var tsInvariant = require('ts-invariant'); +var tslib = require('tslib'); +var apolloClient = require('apollo-client'); +var isEqual = _interopDefault(require('lodash.isequal')); +var hoistNonReactStatics = _interopDefault(require('hoist-non-react-statics')); + +var ApolloContext = react.createContext && + react.createContext(undefined); + +var ApolloConsumer = function (props, legacyContext) { + function finish(context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError() : new tsInvariant.InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + } + return ApolloContext ? (react.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext)); +}; +ApolloConsumer.contextTypes = { + client: propTypes.object.isRequired, +}; +ApolloConsumer.propTypes = { + children: propTypes.func.isRequired, +}; + +var ApolloProvider = (function (_super) { + tslib.__extends(ApolloProvider, _super); + function ApolloProvider(props, context) { + var _this = _super.call(this, props, context) || this; + _this.operations = new Map(); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(props.client) : tsInvariant.invariant(props.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + if (!props.client.__operations_cache__) { + props.client.__operations_cache__ = _this.operations; + } + return _this; + } + ApolloProvider.prototype.getChildContext = function () { + return { + client: this.props.client, + operations: this.props.client.__operations_cache__, + }; + }; + ApolloProvider.prototype.render = function () { + return ApolloContext ? (react.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children); + }; + ApolloProvider.propTypes = { + client: propTypes.object.isRequired, + children: propTypes.node.isRequired, + }; + ApolloProvider.childContextTypes = { + client: propTypes.object.isRequired, + operations: propTypes.object, + }; + return ApolloProvider; +}(react.Component)); + +var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType || (DocumentType = {})); +var cache = new Map(); +function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!document && !!document.kind) : tsInvariant.invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'query'; }); + var mutations = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'mutation'; }); + var subscriptions = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'subscription'; }); + process.env.NODE_ENV === "production" ? tsInvariant.invariant( + !fragments.length || (queries.length || mutations.length || subscriptions.length) + ) : tsInvariant.invariant(!fragments.length || (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1) : tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(definitions.length === 1) : tsInvariant.invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} + +function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!client) : tsInvariant.invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} + +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + tslib.__extends(Query, _super); + function Query(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.lastRenderedResult = null; + _this.startQuerySubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: function (result) { + if (_this.lastRenderedResult && + _this.lastRenderedResult.loading === result.loading && + _this.lastRenderedResult.networkStatus === result.networkStatus && + shallowEqual(_this.lastRenderedResult.data, result.data)) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + _this.resubscribeToQuery(); + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.lastRenderedResult; + delete _this.querySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.queryObservable.currentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function () { + var result = { data: Object.create(null) }; + Object.assign(result, observableQueryFields(_this.queryObservable)); + if (_this.props.skip) { + result = tslib.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.queryObservable.currentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error; + if (errors && errors.length > 0) { + error = new apolloClient.ApolloError({ graphQLErrors: errors }); + } + var fetchPolicy = _this.queryObservable.options.fetchPolicy; + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + var previousData = _this.lastRenderedResult ? _this.lastRenderedResult.data : {}; + if (loading) { + Object.assign(result.data, previousData, currentResult.data); + } + else if (error) { + Object.assign(result, { + data: (_this.queryObservable.getLastResult() || {}).data, + }); + } + else if (fetchPolicy === 'no-cache' && + Object.keys(currentResult.data).length === 0) { + result.data = previousData; + } + else { + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + currentResult.data !== null && + typeof currentResult.data === 'object' && + Object.keys(currentResult.data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { loading: true, networkStatus: apolloClient.NetworkStatus.loading }); + result.refetch(); + _this.lastRenderedResult = result; + return result; + } + Object.assign(result.data, currentResult.data); + } + } + if (!_this.querySubscription) { + var oldRefetch_1 = result.refetch; + result.refetch = function (args) { + if (_this.querySubscription) { + return oldRefetch_1(args); + } + else { + return new Promise(function (r, f) { + _this.refetcherQueue = { resolve: r, reject: f, args: args }; + }); + } + }; + } + setTimeout(function () { + if (_this.queryObservable.resetQueryStoreErrors) { + _this.queryObservable.resetQueryStoreErrors(); + } + else { + var _a = _this.queryObservable, queryManager = _a.queryManager, queryId = _a.queryId; + var queryStore = queryManager.queryStore.get(queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + } + }); + result.client = _this.client; + _this.lastRenderedResult = result; + return result; + }; + _this.client = getClient(props, context); + _this.initializeQueryObservable(props); + return _this; + } + Query.prototype.fetchData = function () { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, client = _a.client, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib.__rest(_a, ["children", "ssr", "displayName", "skip", "client", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = this.client.watchQuery(tslib.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (this.context && this.context.renderPromises) { + this.context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.queryObservable.currentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + if (this.props.skip) + return; + this.startQuerySubscription(); + if (this.refetcherQueue) { + var _a = this.refetcherQueue, args = _a.args, resolve = _a.resolve, reject = _a.reject; + this.queryObservable.refetch(args) + .then(resolve) + .catch(reject); + } + }; + Query.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + if (nextProps.skip && !this.props.skip) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + return; + } + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.client !== nextClient) { + this.client = nextClient; + this.removeQuerySubscription(); + this.queryObservable = null; + } + if (this.props.query !== nextProps.query) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + } + this.updateQuery(nextProps); + if (nextProps.skip) + return; + this.startQuerySubscription(); + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.render = function () { + var _this = this; + var context = this.context; + var finish = function () { return _this.props.children(_this.getQueryResult()); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish); + } + return finish(); + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser(props.query); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.operation.type === DocumentType.Query) : tsInvariant.invariant(this.operation.type === DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeQueryObservable = function (props) { + var opts = this.extractOptsFromProps(props); + this.setOperations(opts); + if (this.context && this.context.renderPromises) { + this.queryObservable = this.context.renderPromises.getSSRObservable(this); + } + if (!this.queryObservable) { + this.queryObservable = this.client.watchQuery(opts); + } + }; + Query.prototype.setOperations = function (props) { + if (this.context.operations) { + this.context.operations.set(this.operation.name, { + query: props.query, + variables: props.variables, + }); + } + }; + Query.prototype.updateQuery = function (props) { + if (!this.queryObservable) { + this.initializeQueryObservable(props); + } + else { + this.setOperations(props); + } + this.queryObservable.setOptions(this.extractOptsFromProps(props)) + .catch(function () { return null; }); + }; + Query.prototype.resubscribeToQuery = function () { + this.removeQuerySubscription(); + var lastError = this.queryObservable.getLastError(); + var lastResult = this.queryObservable.getLastResult(); + this.queryObservable.resetLastResults(); + this.startQuerySubscription(); + Object.assign(this.queryObservable, { lastError: lastError, lastResult: lastResult }); + }; + Query.contextTypes = { + client: propTypes.object, + operations: propTypes.object, + renderPromises: propTypes.object, + }; + Query.propTypes = { + client: propTypes.object, + children: propTypes.func.isRequired, + fetchPolicy: propTypes.string, + notifyOnNetworkStatusChange: propTypes.bool, + onCompleted: propTypes.func, + onError: propTypes.func, + pollInterval: propTypes.number, + query: propTypes.object.isRequired, + variables: propTypes.object, + ssr: propTypes.bool, + partialRefetch: propTypes.bool, + returnPartialData: propTypes.bool, + }; + return Query; +}(react.Component)); + +var initialState = { + loading: false, + called: false, + error: undefined, + data: undefined, +}; +var Mutation = (function (_super) { + tslib.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) { + refetchQueries = refetchQueries.map(function (x) { + if (typeof x === 'string' && _this.context.operations) + return _this.context.operations.get(x) || x; + return x; + }); + delete mutateOptions.refetchQueries; + } + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.client.mutate(tslib.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 ? new apolloClient.ApolloError({ graphQLErrors: errors }) : undefined; + var callOncomplete = function () { return (onCompleted ? onCompleted(data) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId) && !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser(mutation); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operation.type === DocumentType.Mutation) : tsInvariant.invariant(operation.type === DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.client = getClient(props, context); + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = initialState; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.props.mutation !== nextProps.mutation) { + this.verifyDocumentIsMutation(nextProps.mutation); + } + if (this.client !== nextClient) { + this.client = nextClient; + this.setState(initialState); + } + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.client, + }; + return children(this.runMutation, result); + }; + Mutation.contextTypes = { + client: propTypes.object, + operations: propTypes.object, + }; + Mutation.propTypes = { + mutation: propTypes.object.isRequired, + variables: propTypes.object, + optimisticResponse: propTypes.object, + refetchQueries: propTypes.oneOfType([ + propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.object])), + propTypes.func, + ]), + awaitRefetchQueries: propTypes.bool, + update: propTypes.func, + children: propTypes.func.isRequired, + onCompleted: propTypes.func, + onError: propTypes.func, + fetchPolicy: propTypes.string, + }; + return Mutation; +}(react.Component)); + +var Subscription = (function (_super) { + tslib.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.queryObservable) + return; + _this.queryObservable = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var _a = _this, client = _a.client, onSubscriptionData = _a.props.onSubscriptionData; + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }); + if (onSubscriptionData) + onSubscriptionData({ client: client, subscriptionData: result }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.querySubscription; + } + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props.variables, nextProps.variables) && + this.client === nextClient && + this.props.subscription === nextProps.subscription) { + return; + } + var shouldResubscribe = nextProps.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props, nextProps); + } + var shouldNotResubscribe = shouldResubscribe === false; + if (this.client !== nextClient) { + this.client = nextClient; + } + if (!shouldNotResubscribe) { + this.endSubscription(); + delete this.queryObservable; + this.initialize(nextProps); + this.startSubscription(); + this.setState(this.getInitialState()); + return; + } + this.initialize(nextProps); + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = Object.assign({}, this.state, { + variables: this.props.variables, + }); + return renderFn(result); + }; + Subscription.contextTypes = { + client: propTypes.object, + }; + Subscription.propTypes = { + subscription: propTypes.object.isRequired, + variables: propTypes.object, + children: propTypes.func, + onSubscriptionData: propTypes.func, + onSubscriptionComplete: propTypes.func, + shouldResubscribe: propTypes.oneOfType([propTypes.func, propTypes.bool]), + }; + return Subscription; +}(react.Component)); + +var defaultMapPropsToOptions = function () { return ({}); }; +var defaultMapPropsToSkip = function () { return false; }; +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +function calculateVariablesFromProps(operation, props) { + var variables = {}; + for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) { + var _b = _a[_i], variable = _b.variable, type = _b.type; + if (!variable.name || !variable.name.value) + continue; + var variableName = variable.name.value; + var variableProp = props[variableName]; + if (typeof variableProp !== 'undefined') { + variables[variableName] = variableProp; + continue; + } + if (type.kind !== 'NonNullType') { + variables[variableName] = undefined; + } + } + return variables; +} +var GraphQLBase = (function (_super) { + tslib.__extends(GraphQLBase, _super); + function GraphQLBase(props) { + var _this = _super.call(this, props) || this; + _this.withRef = false; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + GraphQLBase.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.withRef) : tsInvariant.invariant(this.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + GraphQLBase.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + return GraphQLBase; +}(react.Component)); + +function withQuery(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') { + mapPropsToOptions = function () { return options; }; + } + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') { + mapPropsToSkip = function () { return skip; }; + } + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : tslib.__assign({}, mapPropsToOptions(props)); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) { + var _b, _c; + var _ = _a.client, data = _a.data, r = tslib.__rest(_a, ["client", "data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (react.createElement(WrappedComponent, tslib.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function withMutation(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var props = this.props; + var opts = mapPropsToOptions(props); + if (operationOptions.withRef) { + this.withRef = true; + props = Object.assign({}, props, { + ref: this.setWrappedInstance, + }); + } + if (!opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _a) { + var _b, _c; + var data = _a.data, r = tslib.__rest(_a, ["data"]); + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'mutate'; + var resultName = operationOptions.name ? name + "Result" : 'result'; + var childProps = (_b = {}, _b[name] = mutate, _b[resultName] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = mutate, + _c[resultName] = result, + _c.ownProps = props, + _c); + childProps = operationOptions.props(newResult); + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function withSubscription(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') + mapPropsToSkip = function () { return skip; }; + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL(props) { + var _this = _super.call(this, props) || this; + _this.state = { resubscribe: false }; + return _this; + } + GraphQL.prototype.componentWillReceiveProps = function (nextProps) { + if (!shouldResubscribe) + return; + this.setState({ + resubscribe: shouldResubscribe(this.props, nextProps), + }); + }; + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) { + var _b, _c; + var data = _a.data, r = tslib.__rest(_a, ["data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (react.createElement(WrappedComponent, tslib.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function graphql(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + switch (parser(document).type) { + case DocumentType.Mutation: + return withMutation(document, operationOptions); + case DocumentType.Subscription: + return withSubscription(document, operationOptions); + case DocumentType.Query: + default: + return withQuery(document, operationOptions); + } +} + +function getDisplayName$1(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +function withApollo(WrappedComponent, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var withDisplayName = "withApollo(" + getDisplayName$1(WrappedComponent) + ")"; + var WithApollo = (function (_super) { + tslib.__extends(WithApollo, _super); + function WithApollo(props) { + var _this = _super.call(this, props) || this; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + WithApollo.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operationOptions.withRef) : tsInvariant.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + WithApollo.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + WithApollo.prototype.render = function () { + var _this = this; + return (react.createElement(ApolloConsumer, null, function (client) { + var props = Object.assign({}, _this.props, { + client: client, + ref: operationOptions.withRef ? _this.setWrappedInstance : undefined, + }); + return react.createElement(WrappedComponent, tslib.__assign({}, props)); + })); + }; + WithApollo.displayName = withDisplayName; + WithApollo.WrappedComponent = WrappedComponent; + return WithApollo; + }(react.Component)); + return hoistNonReactStatics(WithApollo, WrappedComponent, {}); +} + +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData()); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require("react-dom/server").renderToStaticMarkup, + }); +} +function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require("react-dom/server").renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + var RenderPromisesProvider = (function (_super) { + tslib.__extends(RenderPromisesProvider, _super); + function RenderPromisesProvider() { + return _super !== null && _super.apply(this, arguments) || this; + } + RenderPromisesProvider.prototype.getChildContext = function () { + return tslib.__assign({}, context, { renderPromises: renderPromises }); + }; + RenderPromisesProvider.prototype.render = function () { + return tree; + }; + RenderPromisesProvider.childContextTypes = { + renderPromises: propTypes.object, + }; + return RenderPromisesProvider; + }(react.Component)); + Object.keys(context).forEach(function (key) { + RenderPromisesProvider.childContextTypes[key] = propTypes.any; + }); + function process() { + var html = renderFunction(react.createElement(RenderPromisesProvider)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} + +function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require("react-dom/server").renderToString, + }); +} + +function compose() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i] = arguments[_i]; + } + var functions = funcs.reverse(); + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var firstFunction = functions[0], restFunctions = functions.slice(1); + var result = firstFunction.apply(null, args); + restFunctions.forEach(function (fnc) { + result = fnc.call(null, result); + }); + return result; + }; +} + +exports.ApolloConsumer = ApolloConsumer; +exports.ApolloContext = ApolloContext; +exports.ApolloProvider = ApolloProvider; +exports.Mutation = Mutation; +exports.Query = Query; +exports.RenderPromises = RenderPromises; +exports.Subscription = Subscription; +exports.compose = compose; +exports.getDataFromTree = getDataFromTree; +exports.getMarkupFromTree = getMarkupFromTree; +exports.graphql = graphql; +exports.renderToStringWithData = renderToStringWithData; +exports.withApollo = withApollo; +exports.withMutation = withMutation; +exports.withQuery = withQuery; +exports.withSubscription = withSubscription; diff --git a/node_modules/react-apollo/react-apollo.cjs.js.map b/node_modules/react-apollo/react-apollo.cjs.js.map new file mode 100644 index 000000000..1217bb21d --- /dev/null +++ b/node_modules/react-apollo/react-apollo.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-apollo.cjs.js","sourceRoot":"","sources":["../src/react-apollo.cjs.ts"],"names":[],"mappings":";;;AASA,kDAAwB"} \ No newline at end of file diff --git a/node_modules/react-apollo/react-apollo.esm.js b/node_modules/react-apollo/react-apollo.esm.js new file mode 100644 index 000000000..3dd29b46f --- /dev/null +++ b/node_modules/react-apollo/react-apollo.esm.js @@ -0,0 +1,1077 @@ +import { createContext, createElement, Component } from 'react'; +import { object, func, node, string, bool, number, oneOfType, arrayOf, any } from 'prop-types'; +import { InvariantError, invariant } from 'ts-invariant'; +import { __extends, __assign, __rest } from 'tslib'; +import { ApolloError, NetworkStatus } from 'apollo-client'; +import isEqual from 'lodash.isequal'; +import hoistNonReactStatics from 'hoist-non-react-statics'; + +var ApolloContext = createContext && + createContext(undefined); + +var ApolloConsumer = function (props, legacyContext) { + function finish(context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new InvariantError() : new InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + } + return ApolloContext ? (createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext)); +}; +ApolloConsumer.contextTypes = { + client: object.isRequired, +}; +ApolloConsumer.propTypes = { + children: func.isRequired, +}; + +var ApolloProvider = (function (_super) { + __extends(ApolloProvider, _super); + function ApolloProvider(props, context) { + var _this = _super.call(this, props, context) || this; + _this.operations = new Map(); + process.env.NODE_ENV === "production" ? invariant(props.client) : invariant(props.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + if (!props.client.__operations_cache__) { + props.client.__operations_cache__ = _this.operations; + } + return _this; + } + ApolloProvider.prototype.getChildContext = function () { + return { + client: this.props.client, + operations: this.props.client.__operations_cache__, + }; + }; + ApolloProvider.prototype.render = function () { + return ApolloContext ? (createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children); + }; + ApolloProvider.propTypes = { + client: object.isRequired, + children: node.isRequired, + }; + ApolloProvider.childContextTypes = { + client: object.isRequired, + operations: object, + }; + return ApolloProvider; +}(Component)); + +var DocumentType; +(function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; +})(DocumentType || (DocumentType = {})); +var cache = new Map(); +function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? invariant(!!document && !!document.kind) : invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'query'; }); + var mutations = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'mutation'; }); + var subscriptions = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'subscription'; }); + process.env.NODE_ENV === "production" ? invariant( + !fragments.length || (queries.length || mutations.length || subscriptions.length) + ) : invariant(!fragments.length || (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? invariant(queries.length + mutations.length + subscriptions.length <= 1) : invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; + process.env.NODE_ENV === "production" ? invariant(definitions.length === 1) : invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; +} + +function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? invariant(!!client) : invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} + +function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; +} +var Query = (function (_super) { + __extends(Query, _super); + function Query(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.lastRenderedResult = null; + _this.startQuerySubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: function (result) { + if (_this.lastRenderedResult && + _this.lastRenderedResult.loading === result.loading && + _this.lastRenderedResult.networkStatus === result.networkStatus && + shallowEqual(_this.lastRenderedResult.data, result.data)) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + _this.resubscribeToQuery(); + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.lastRenderedResult; + delete _this.querySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.queryObservable.currentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function () { + var result = { data: Object.create(null) }; + Object.assign(result, observableQueryFields(_this.queryObservable)); + if (_this.props.skip) { + result = __assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.queryObservable.currentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error; + if (errors && errors.length > 0) { + error = new ApolloError({ graphQLErrors: errors }); + } + var fetchPolicy = _this.queryObservable.options.fetchPolicy; + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + var previousData = _this.lastRenderedResult ? _this.lastRenderedResult.data : {}; + if (loading) { + Object.assign(result.data, previousData, currentResult.data); + } + else if (error) { + Object.assign(result, { + data: (_this.queryObservable.getLastResult() || {}).data, + }); + } + else if (fetchPolicy === 'no-cache' && + Object.keys(currentResult.data).length === 0) { + result.data = previousData; + } + else { + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + currentResult.data !== null && + typeof currentResult.data === 'object' && + Object.keys(currentResult.data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { loading: true, networkStatus: NetworkStatus.loading }); + result.refetch(); + _this.lastRenderedResult = result; + return result; + } + Object.assign(result.data, currentResult.data); + } + } + if (!_this.querySubscription) { + var oldRefetch_1 = result.refetch; + result.refetch = function (args) { + if (_this.querySubscription) { + return oldRefetch_1(args); + } + else { + return new Promise(function (r, f) { + _this.refetcherQueue = { resolve: r, reject: f, args: args }; + }); + } + }; + } + setTimeout(function () { + if (_this.queryObservable.resetQueryStoreErrors) { + _this.queryObservable.resetQueryStoreErrors(); + } + else { + var _a = _this.queryObservable, queryManager = _a.queryManager, queryId = _a.queryId; + var queryStore = queryManager.queryStore.get(queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + } + }); + result.client = _this.client; + _this.lastRenderedResult = result; + return result; + }; + _this.client = getClient(props, context); + _this.initializeQueryObservable(props); + return _this; + } + Query.prototype.fetchData = function () { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, client = _a.client, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = __rest(_a, ["children", "ssr", "displayName", "skip", "client", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = this.client.watchQuery(__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (this.context && this.context.renderPromises) { + this.context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.queryObservable.currentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + if (this.props.skip) + return; + this.startQuerySubscription(); + if (this.refetcherQueue) { + var _a = this.refetcherQueue, args = _a.args, resolve = _a.resolve, reject = _a.reject; + this.queryObservable.refetch(args) + .then(resolve) + .catch(reject); + } + }; + Query.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + if (nextProps.skip && !this.props.skip) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + return; + } + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.client !== nextClient) { + this.client = nextClient; + this.removeQuerySubscription(); + this.queryObservable = null; + } + if (this.props.query !== nextProps.query) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + } + this.updateQuery(nextProps); + if (nextProps.skip) + return; + this.startQuerySubscription(); + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.render = function () { + var _this = this; + var context = this.context; + var finish = function () { return _this.props.children(_this.getQueryResult()); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish); + } + return finish(); + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser(props.query); + process.env.NODE_ENV === "production" ? invariant(this.operation.type === DocumentType.Query) : invariant(this.operation.type === DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return __assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeQueryObservable = function (props) { + var opts = this.extractOptsFromProps(props); + this.setOperations(opts); + if (this.context && this.context.renderPromises) { + this.queryObservable = this.context.renderPromises.getSSRObservable(this); + } + if (!this.queryObservable) { + this.queryObservable = this.client.watchQuery(opts); + } + }; + Query.prototype.setOperations = function (props) { + if (this.context.operations) { + this.context.operations.set(this.operation.name, { + query: props.query, + variables: props.variables, + }); + } + }; + Query.prototype.updateQuery = function (props) { + if (!this.queryObservable) { + this.initializeQueryObservable(props); + } + else { + this.setOperations(props); + } + this.queryObservable.setOptions(this.extractOptsFromProps(props)) + .catch(function () { return null; }); + }; + Query.prototype.resubscribeToQuery = function () { + this.removeQuerySubscription(); + var lastError = this.queryObservable.getLastError(); + var lastResult = this.queryObservable.getLastResult(); + this.queryObservable.resetLastResults(); + this.startQuerySubscription(); + Object.assign(this.queryObservable, { lastError: lastError, lastResult: lastResult }); + }; + Query.contextTypes = { + client: object, + operations: object, + renderPromises: object, + }; + Query.propTypes = { + client: object, + children: func.isRequired, + fetchPolicy: string, + notifyOnNetworkStatusChange: bool, + onCompleted: func, + onError: func, + pollInterval: number, + query: object.isRequired, + variables: object, + ssr: bool, + partialRefetch: bool, + returnPartialData: bool, + }; + return Query; +}(Component)); + +var initialState = { + loading: false, + called: false, + error: undefined, + data: undefined, +}; +var Mutation = (function (_super) { + __extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = __assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) { + refetchQueries = refetchQueries.map(function (x) { + if (typeof x === 'string' && _this.context.operations) + return _this.context.operations.get(x) || x; + return x; + }); + delete mutateOptions.refetchQueries; + } + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.client.mutate(__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 ? new ApolloError({ graphQLErrors: errors }) : undefined; + var callOncomplete = function () { return (onCompleted ? onCompleted(data) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId) && !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser(mutation); + process.env.NODE_ENV === "production" ? invariant(operation.type === DocumentType.Mutation) : invariant(operation.type === DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.client = getClient(props, context); + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = initialState; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.props.mutation !== nextProps.mutation) { + this.verifyDocumentIsMutation(nextProps.mutation); + } + if (this.client !== nextClient) { + this.client = nextClient; + this.setState(initialState); + } + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.client, + }; + return children(this.runMutation, result); + }; + Mutation.contextTypes = { + client: object, + operations: object, + }; + Mutation.propTypes = { + mutation: object.isRequired, + variables: object, + optimisticResponse: object, + refetchQueries: oneOfType([ + arrayOf(oneOfType([string, object])), + func, + ]), + awaitRefetchQueries: bool, + update: func, + children: func.isRequired, + onCompleted: func, + onError: func, + fetchPolicy: string, + }; + return Mutation; +}(Component)); + +var Subscription = (function (_super) { + __extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.queryObservable) + return; + _this.queryObservable = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var _a = _this, client = _a.client, onSubscriptionData = _a.props.onSubscriptionData; + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }); + if (onSubscriptionData) + onSubscriptionData({ client: client, subscriptionData: result }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.querySubscription; + } + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props.variables, nextProps.variables) && + this.client === nextClient && + this.props.subscription === nextProps.subscription) { + return; + } + var shouldResubscribe = nextProps.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props, nextProps); + } + var shouldNotResubscribe = shouldResubscribe === false; + if (this.client !== nextClient) { + this.client = nextClient; + } + if (!shouldNotResubscribe) { + this.endSubscription(); + delete this.queryObservable; + this.initialize(nextProps); + this.startSubscription(); + this.setState(this.getInitialState()); + return; + } + this.initialize(nextProps); + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = Object.assign({}, this.state, { + variables: this.props.variables, + }); + return renderFn(result); + }; + Subscription.contextTypes = { + client: object, + }; + Subscription.propTypes = { + subscription: object.isRequired, + variables: object, + children: func, + onSubscriptionData: func, + onSubscriptionComplete: func, + shouldResubscribe: oneOfType([func, bool]), + }; + return Subscription; +}(Component)); + +var defaultMapPropsToOptions = function () { return ({}); }; +var defaultMapPropsToSkip = function () { return false; }; +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +function calculateVariablesFromProps(operation, props) { + var variables = {}; + for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) { + var _b = _a[_i], variable = _b.variable, type = _b.type; + if (!variable.name || !variable.name.value) + continue; + var variableName = variable.name.value; + var variableProp = props[variableName]; + if (typeof variableProp !== 'undefined') { + variables[variableName] = variableProp; + continue; + } + if (type.kind !== 'NonNullType') { + variables[variableName] = undefined; + } + } + return variables; +} +var GraphQLBase = (function (_super) { + __extends(GraphQLBase, _super); + function GraphQLBase(props) { + var _this = _super.call(this, props) || this; + _this.withRef = false; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + GraphQLBase.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? invariant(this.withRef) : invariant(this.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + GraphQLBase.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + return GraphQLBase; +}(Component)); + +function withQuery(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') { + mapPropsToOptions = function () { return options; }; + } + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') { + mapPropsToSkip = function () { return skip; }; + } + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + __extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : __assign({}, mapPropsToOptions(props)); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (createElement(Query, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) { + var _b, _c; + var _ = _a.client, data = _a.data, r = __rest(_a, ["client", "data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (createElement(WrappedComponent, __assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (createElement(WrappedComponent, __assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function withMutation(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + __extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var props = this.props; + var opts = mapPropsToOptions(props); + if (operationOptions.withRef) { + this.withRef = true; + props = Object.assign({}, props, { + ref: this.setWrappedInstance, + }); + } + if (!opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (createElement(Mutation, __assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _a) { + var _b, _c; + var data = _a.data, r = __rest(_a, ["data"]); + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'mutate'; + var resultName = operationOptions.name ? name + "Result" : 'result'; + var childProps = (_b = {}, _b[name] = mutate, _b[resultName] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = mutate, + _c[resultName] = result, + _c.ownProps = props, + _c); + childProps = operationOptions.props(newResult); + } + return (createElement(WrappedComponent, __assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function withSubscription(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') + mapPropsToSkip = function () { return skip; }; + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + __extends(GraphQL, _super); + function GraphQL(props) { + var _this = _super.call(this, props) || this; + _this.state = { resubscribe: false }; + return _this; + } + GraphQL.prototype.componentWillReceiveProps = function (nextProps) { + if (!shouldResubscribe) + return; + this.setState({ + resubscribe: shouldResubscribe(this.props, nextProps), + }); + }; + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (createElement(Subscription, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) { + var _b, _c; + var data = _a.data, r = __rest(_a, ["data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (createElement(WrappedComponent, __assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (createElement(WrappedComponent, __assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; +} + +function graphql(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + switch (parser(document).type) { + case DocumentType.Mutation: + return withMutation(document, operationOptions); + case DocumentType.Subscription: + return withSubscription(document, operationOptions); + case DocumentType.Query: + default: + return withQuery(document, operationOptions); + } +} + +function getDisplayName$1(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +function withApollo(WrappedComponent, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var withDisplayName = "withApollo(" + getDisplayName$1(WrappedComponent) + ")"; + var WithApollo = (function (_super) { + __extends(WithApollo, _super); + function WithApollo(props) { + var _this = _super.call(this, props) || this; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + WithApollo.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? invariant(operationOptions.withRef) : invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + WithApollo.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + WithApollo.prototype.render = function () { + var _this = this; + return (createElement(ApolloConsumer, null, function (client) { + var props = Object.assign({}, _this.props, { + client: client, + ref: operationOptions.withRef ? _this.setWrappedInstance : undefined, + }); + return createElement(WrappedComponent, __assign({}, props)); + })); + }; + WithApollo.displayName = withDisplayName; + WithApollo.WrappedComponent = WrappedComponent; + return WithApollo; + }(Component)); + return hoistNonReactStatics(WithApollo, WrappedComponent, {}); +} + +function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; +} +var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData()); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; +}()); +function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require("react-dom/server").renderToStaticMarkup, + }); +} +function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require("react-dom/server").renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + var RenderPromisesProvider = (function (_super) { + __extends(RenderPromisesProvider, _super); + function RenderPromisesProvider() { + return _super !== null && _super.apply(this, arguments) || this; + } + RenderPromisesProvider.prototype.getChildContext = function () { + return __assign({}, context, { renderPromises: renderPromises }); + }; + RenderPromisesProvider.prototype.render = function () { + return tree; + }; + RenderPromisesProvider.childContextTypes = { + renderPromises: object, + }; + return RenderPromisesProvider; + }(Component)); + Object.keys(context).forEach(function (key) { + RenderPromisesProvider.childContextTypes[key] = any; + }); + function process() { + var html = renderFunction(createElement(RenderPromisesProvider)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); +} + +function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require("react-dom/server").renderToString, + }); +} + +function compose() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i] = arguments[_i]; + } + var functions = funcs.reverse(); + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var firstFunction = functions[0], restFunctions = functions.slice(1); + var result = firstFunction.apply(null, args); + restFunctions.forEach(function (fnc) { + result = fnc.call(null, result); + }); + return result; + }; +} + +export { ApolloConsumer, ApolloContext, ApolloProvider, Mutation, Query, RenderPromises, Subscription, compose, getDataFromTree, getMarkupFromTree, graphql, renderToStringWithData, withApollo, withMutation, withQuery, withSubscription }; +//# sourceMappingURL=react-apollo.esm.js.map diff --git a/node_modules/react-apollo/react-apollo.esm.js.map b/node_modules/react-apollo/react-apollo.esm.js.map new file mode 100644 index 000000000..1d1563a49 --- /dev/null +++ b/node_modules/react-apollo/react-apollo.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"react-apollo.esm.js","sources":["../src/ApolloContext.ts","../src/ApolloConsumer.tsx","../src/ApolloProvider.tsx","../src/parser.ts","../src/component-utils.tsx","../src/utils/shallowEqual.ts","../src/Query.tsx","../src/Mutation.tsx","../src/Subscriptions.tsx","../src/hoc-utils.tsx","../src/query-hoc.tsx","../src/mutation-hoc.tsx","../src/subscription-hoc.tsx","../src/graphql.tsx","../src/withApollo.tsx","../src/getDataFromTree.ts","../src/renderToStringWithData.ts","../src/utils/flowRight.ts"],"sourcesContent":["import * as React from 'react';\nimport ApolloClient from 'apollo-client';\nimport { DocumentNode } from 'graphql';\n\nexport interface ApolloContextValue {\n client?: ApolloClient;\n operations?: Map;\n}\n\nexport const ApolloContext = React.createContext &&\n React.createContext(undefined)\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ApolloClient from 'apollo-client';\nimport { ApolloContext } from './ApolloContext';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface ApolloConsumerProps {\n children: (client: ApolloClient) => React.ReactElement | null;\n}\n\nconst ApolloConsumer: React.StatelessComponent =\n (props, legacyContext) => {\n function finish(context: any) {\n if (!context || !context.client) {\n throw new InvariantError(\n 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an .'\n );\n }\n return props.children(context.client);\n }\n\n return ApolloContext ? (\n \n {finish}\n \n ) : (\n // Fall back to legacy context API if React.createContext not available.\n finish(legacyContext)\n );\n };\n\nApolloConsumer.contextTypes = {\n client: PropTypes.object.isRequired,\n};\n\nApolloConsumer.propTypes = {\n children: PropTypes.func.isRequired,\n};\n\nexport default ApolloConsumer;\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { Component } from 'react';\nimport ApolloClient from 'apollo-client';\nimport { DocumentNode } from 'graphql';\nimport { ApolloContext } from './ApolloContext';\n\nimport { invariant } from 'ts-invariant';\n\nexport interface ApolloProviderProps {\n client: ApolloClient;\n children: React.ReactNode;\n}\n\nexport default class ApolloProvider extends Component> {\n static propTypes = {\n client: PropTypes.object.isRequired,\n children: PropTypes.node.isRequired,\n };\n\n static childContextTypes = {\n client: PropTypes.object.isRequired,\n operations: PropTypes.object,\n };\n\n private operations: Map = new Map();\n\n constructor(props: ApolloProviderProps, context: any) {\n super(props, context);\n\n invariant(\n props.client,\n 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.',\n );\n\n // we have to attach to the client since you could have multiple\n // providers\n // XXX this is backwards compat and will be removed in 3.0\n if (!(props.client as any).__operations_cache__) {\n (props.client as any).__operations_cache__ = this.operations;\n }\n }\n\n getChildContext() {\n return {\n client: this.props.client,\n operations: (this.props.client as any).__operations_cache__,\n };\n }\n\n render() {\n return ApolloContext ? (\n \n {this.props.children}\n \n ) : (\n this.props.children\n );\n }\n}\n","import {\n DocumentNode,\n DefinitionNode,\n VariableDefinitionNode,\n OperationDefinitionNode,\n} from 'graphql';\n\nimport { invariant } from 'ts-invariant';\n\nexport enum DocumentType {\n Query,\n Mutation,\n Subscription,\n}\n\nexport interface IDocumentDefinition {\n type: DocumentType;\n name: string;\n variables: ReadonlyArray;\n}\n\nconst cache = new Map();\n\n// the parser is mainly a safety check for the HOC\nexport function parser(document: DocumentNode): IDocumentDefinition {\n const cached = cache.get(document);\n if (cached) return cached;\n // variables\n let variables, type, name;\n\n /*\n\n Saftey checks for proper usage of react-apollo\n\n */\n invariant(\n !!document && !!document.kind,\n // tslint:disable-line\n `Argument of ${document} passed to parser was not a valid GraphQL ` +\n `DocumentNode. You may need to use 'graphql-tag' or another method ` +\n `to convert your operation into a document`,\n );\n\n const fragments = document.definitions.filter(\n (x: DefinitionNode) => x.kind === 'FragmentDefinition',\n );\n\n const queries = document.definitions.filter(\n (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'query',\n );\n\n const mutations = document.definitions.filter(\n (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'mutation',\n );\n\n const subscriptions = document.definitions.filter(\n (x: DefinitionNode) => x.kind === 'OperationDefinition' && x.operation === 'subscription',\n );\n\n invariant(\n !fragments.length || (queries.length || mutations.length || subscriptions.length),\n `Passing only a fragment to 'graphql' is not yet supported. ` +\n `You must include a query, subscription or mutation as well`,\n );\n\n invariant(\n queries.length + mutations.length + subscriptions.length <= 1,\n // tslint:disable-line\n `react-apollo only supports a query, subscription, or a mutation per HOC. ` +\n `${document} had ${queries.length} queries, ${subscriptions.length} ` +\n `subscriptions and ${mutations.length} mutations. ` +\n `You can use 'compose' to join multiple operation types to a component`,\n );\n\n type = queries.length ? DocumentType.Query : DocumentType.Mutation;\n if (!queries.length && !mutations.length) type = DocumentType.Subscription;\n\n const definitions = queries.length ? queries : mutations.length ? mutations : subscriptions;\n\n invariant(\n definitions.length === 1,\n // tslint:disable-line\n `react-apollo only supports one definition per HOC. ${document} had ` +\n `${definitions.length} definitions. ` +\n `You can use 'compose' to join multiple operation types to a component`,\n );\n\n const definition = definitions[0] as OperationDefinitionNode;\n variables = definition.variableDefinitions || [];\n\n if (definition.name && definition.name.kind === 'Name') {\n name = definition.name.value;\n } else {\n name = 'data'; // fallback to using data if no name\n }\n\n const payload = { name, type, variables };\n cache.set(document, payload);\n return payload;\n}\n","import ApolloClient from 'apollo-client';\nimport { invariant } from 'ts-invariant';\n\nexport interface CommonComponentProps {\n client?: ApolloClient;\n}\n\nexport interface CommonComponentContext {\n client?: ApolloClient;\n}\n\nexport function getClient(\n props: CommonComponentProps,\n context: CommonComponentContext,\n): ApolloClient {\n const client = props.client || context.client;\n\n invariant(\n !!client,\n 'Could not find \"client\" in the context or passed in as a prop. ' +\n 'Wrap the root component in an , or pass an ' +\n 'ApolloClient instance in via props.',\n );\n\n return client as ApolloClient;\n}\n","const { hasOwnProperty } = Object.prototype;\n\nfunction is(x: any, y: any) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n }\n return x !== x && y !== y;\n}\n\nfunction isObject(obj: any): obj is { [key: string]: any } {\n return obj !== null && typeof obj === \"object\";\n}\n\nexport default function shallowEqual(objA: any, objB: any) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (!isObject(objA) || !isObject(objB)) {\n return false;\n }\n\n const keys = Object.keys(objA);\n\n if (keys.length !== Object.keys(objB).length) {\n return false;\n }\n\n return keys.every(\n key => hasOwnProperty.call(objB, key) && is(objA[key], objB[key]),\n );\n}\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ApolloClient, {\n ObservableQuery,\n ApolloError,\n ApolloQueryResult,\n NetworkStatus,\n FetchMoreOptions,\n FetchMoreQueryOptions,\n ApolloCurrentResult\n} from 'apollo-client';\nimport { DocumentNode } from 'graphql';\nimport { ZenObservable } from 'zen-observable-ts';\nimport { OperationVariables, QueryControls, QueryOpts } from './types';\nimport { parser, DocumentType, IDocumentDefinition } from './parser';\nimport { getClient } from './component-utils';\nimport { RenderPromises } from './getDataFromTree';\n\nimport isEqual from 'lodash.isequal';\nimport shallowEqual from './utils/shallowEqual';\nimport { invariant } from 'ts-invariant';\n\nexport type ObservableQueryFields = Pick<\n ObservableQuery,\n 'startPolling' | 'stopPolling' | 'subscribeToMore' | 'updateQuery' | 'refetch' | 'variables'\n> & {\n fetchMore: ((\n fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions,\n ) => Promise>) &\n ((\n fetchMoreOptions: { query?: DocumentNode } & FetchMoreQueryOptions &\n FetchMoreOptions,\n ) => Promise>);\n};\n\nfunction observableQueryFields(\n observable: ObservableQuery,\n): ObservableQueryFields {\n const fields = {\n variables: observable.variables,\n refetch: observable.refetch.bind(observable),\n fetchMore: observable.fetchMore.bind(observable),\n updateQuery: observable.updateQuery.bind(observable),\n startPolling: observable.startPolling.bind(observable),\n stopPolling: observable.stopPolling.bind(observable),\n subscribeToMore: observable.subscribeToMore.bind(observable),\n };\n // TODO: Need to cast this because we improved the type of `updateQuery` to be parametric\n // on variables, while the type in Apollo client just has object.\n // Consider removing this when that is properly typed\n return fields as ObservableQueryFields;\n}\n\nexport interface QueryResult\n extends ObservableQueryFields {\n client: ApolloClient;\n // we create an empty object to make checking for data\n // easier for consumers (i.e. instead of data && data.user\n // you can just check data.user) this also makes destructring\n // easier (i.e. { data: { user } })\n // however, this isn't realy possible with TypeScript that\n // I'm aware of. So intead we enforce checking for data\n // like so result.data!.user. This tells TS to use TData\n // XXX is there a better way to do this?\n data: TData | undefined;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n}\n\nexport interface QueryProps extends QueryOpts {\n children: (result: QueryResult) => React.ReactNode;\n query: DocumentNode;\n displayName?: string;\n skip?: boolean;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n}\n\nexport interface QueryContext {\n client?: ApolloClient;\n operations?: Map;\n renderPromises?: RenderPromises;\n}\n\nexport default class Query extends React.Component<\n QueryProps\n> {\n static contextTypes = {\n client: PropTypes.object,\n operations: PropTypes.object,\n renderPromises: PropTypes.object,\n };\n\n static propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool,\n };\n\n context: QueryContext | undefined;\n\n private client: ApolloClient;\n\n // request / action storage. Note that we delete querySubscription if we\n // unsubscribe but never delete queryObservable once it is created. We\n // only delete queryObservable when we unmount the component.\n private queryObservable?: ObservableQuery | null;\n private querySubscription?: ZenObservable.Subscription;\n private refetcherQueue?: {\n args: any;\n resolve: (value?: any | PromiseLike) => void;\n reject: (reason?: any) => void;\n };\n\n private hasMounted: boolean = false;\n private operation?: IDocumentDefinition;\n private lastRenderedResult: ApolloQueryResult | null = null;\n\n constructor(props: QueryProps, context: QueryContext) {\n super(props, context);\n\n this.client = getClient(props, context);\n this.initializeQueryObservable(props);\n }\n\n // For server-side rendering (see getDataFromTree.ts)\n fetchData(): Promise> | boolean {\n if (this.props.skip) return false;\n\n // pull off react options\n const {\n children,\n ssr,\n displayName,\n skip,\n client,\n onCompleted,\n onError,\n partialRefetch,\n ...opts\n } = this.props;\n\n let { fetchPolicy } = opts;\n if (ssr === false) return false;\n if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') {\n fetchPolicy = 'cache-first'; // ignore force fetch in SSR;\n }\n\n const observable = this.client.watchQuery({\n ...opts,\n fetchPolicy,\n });\n\n // Register the SSR observable, so it can be re-used once the value comes back.\n if (this.context && this.context.renderPromises) {\n this.context.renderPromises.registerSSRObservable(this, observable);\n }\n\n const result = this.queryObservable!.currentResult();\n\n return result.loading ? observable.result() : false;\n }\n\n componentDidMount() {\n this.hasMounted = true;\n if (this.props.skip) return;\n\n this.startQuerySubscription();\n if (this.refetcherQueue) {\n const { args, resolve, reject } = this.refetcherQueue;\n this.queryObservable!.refetch(args)\n .then(resolve)\n .catch(reject);\n }\n }\n\n componentWillReceiveProps(nextProps: QueryProps, nextContext: QueryContext) {\n // the next render wants to skip\n if (nextProps.skip && !this.props.skip) {\n this.queryObservable!.resetLastResults();\n this.removeQuerySubscription();\n return;\n }\n\n const nextClient = getClient(nextProps, nextContext);\n\n if (shallowEqual(this.props, nextProps) && this.client === nextClient) {\n return;\n }\n\n if (this.client !== nextClient) {\n this.client = nextClient;\n this.removeQuerySubscription();\n this.queryObservable = null;\n }\n\n if (this.props.query !== nextProps.query) {\n this.queryObservable!.resetLastResults();\n this.removeQuerySubscription();\n }\n\n this.updateQuery(nextProps);\n if (nextProps.skip) return;\n this.startQuerySubscription();\n }\n\n componentWillUnmount() {\n this.removeQuerySubscription();\n this.hasMounted = false;\n }\n\n componentDidUpdate(prevProps: QueryProps) {\n const isDiffRequest =\n !isEqual(prevProps.query, this.props.query) ||\n !isEqual(prevProps.variables, this.props.variables);\n if (isDiffRequest) {\n // If specified, `onError` / `onCompleted` callbacks are called here\n // after local cache results are loaded.\n this.handleErrorOrCompleted();\n }\n }\n\n render(): React.ReactNode {\n const { context } = this;\n const finish = () => this.props.children(this.getQueryResult());\n if (context && context.renderPromises) {\n return context.renderPromises.addQueryPromise(this, finish);\n }\n return finish();\n }\n\n private extractOptsFromProps(props: QueryProps) {\n this.operation = parser(props.query);\n\n invariant(\n this.operation.type === DocumentType.Query,\n `The component requires a graphql query, but got a ${\n this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription'\n }.`,\n );\n\n const displayName = props.displayName || 'Query';\n\n return {\n ...props,\n displayName,\n context: props.context || {},\n metadata: { reactComponent: { displayName }},\n };\n }\n\n private initializeQueryObservable(props: QueryProps) {\n const opts = this.extractOptsFromProps(props);\n // save for backwards compat of refetcherQueries without a recycler\n this.setOperations(opts);\n\n // See if there is an existing observable that was used to fetch the same data and\n // if so, use it instead since it will contain the proper queryId to fetch\n // the result set. This is used during SSR.\n if (this.context && this.context.renderPromises) {\n this.queryObservable = this.context.renderPromises.getSSRObservable(this);\n }\n if (!this.queryObservable) {\n this.queryObservable = this.client.watchQuery(opts);\n }\n }\n\n private setOperations(props: QueryProps) {\n if (this.context!.operations) {\n this.context!.operations!.set(this.operation!.name, {\n query: props.query,\n variables: props.variables,\n });\n }\n }\n\n private updateQuery(props: QueryProps) {\n // if we skipped initially, we may not have yet created the observable\n if (!this.queryObservable) {\n this.initializeQueryObservable(props);\n } else {\n this.setOperations(props);\n }\n\n this.queryObservable!.setOptions(this.extractOptsFromProps(props))\n // The error will be passed to the child container, so we don't\n // need to log it here. We could conceivably log something if\n // an option was set. OTOH we don't log errors w/ the original\n // query. See https://github.com/apollostack/react-apollo/issues/404\n .catch(() => null);\n }\n\n private startQuerySubscription = () => {\n // When the `Query` component receives new props, or when we explicitly\n // re-subscribe to a query using `resubscribeToQuery`, we start a new\n // subscription in this method. To avoid un-necessary re-renders when\n // receiving new props or re-subscribing, we track the full last\n // observable result so it can be compared against incoming new data.\n // We only trigger a re-render if the incoming result is different than\n // the stored `lastRenderedResult`.\n\n if (this.querySubscription) return;\n\n this.querySubscription = this.queryObservable!.subscribe({\n next: (result) => {\n if (\n this.lastRenderedResult &&\n this.lastRenderedResult.loading === result.loading &&\n this.lastRenderedResult.networkStatus === result.networkStatus &&\n shallowEqual(this.lastRenderedResult.data, result.data)\n ) {\n return;\n }\n\n this.updateCurrentData();\n },\n error: error => {\n this.resubscribeToQuery();\n\n if (!error.hasOwnProperty('graphQLErrors')) throw error;\n this.updateCurrentData();\n },\n });\n };\n\n private removeQuerySubscription = () => {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n delete this.lastRenderedResult;\n delete this.querySubscription;\n }\n };\n\n private resubscribeToQuery() {\n this.removeQuerySubscription();\n\n // Unfortunately, if `lastError` is set in the current\n // `queryObservable` when the subscription is re-created,\n // the subscription will immediately receive the error, which will\n // cause it to terminate again. To avoid this, we first clear\n // the last error/result from the `queryObservable` before re-starting\n // the subscription, and restore it afterwards (so the subscription\n // has a chance to stay open).\n const lastError = this.queryObservable!.getLastError();\n const lastResult = this.queryObservable!.getLastResult();\n this.queryObservable!.resetLastResults();\n this.startQuerySubscription();\n Object.assign(this.queryObservable!, { lastError, lastResult });\n }\n\n private updateCurrentData = () => {\n // If specified, `onError` / `onCompleted` callbacks are called here\n // after a network based Query result has been received.\n this.handleErrorOrCompleted();\n\n // Force a rerender that goes through shouldComponentUpdate.\n if (this.hasMounted) this.forceUpdate();\n };\n\n private handleErrorOrCompleted = () => {\n const result = this.queryObservable!.currentResult();\n const { data, loading, error } = result;\n const { onCompleted, onError } = this.props;\n if (onCompleted && !loading && !error) {\n onCompleted(data as TData);\n } else if (onError && !loading && error) {\n onError(error);\n }\n }\n\n private getQueryResult = (): QueryResult => {\n let result = { data: Object.create(null) as TData } as any;\n // Attach bound methods\n Object.assign(result, observableQueryFields(this.queryObservable!));\n\n // When skipping a query (ie. we're not querying for data but still want\n // to render children), make sure the `data` is cleared out and\n // `loading` is set to `false` (since we aren't loading anything).\n if (this.props.skip) {\n result = {\n ...result,\n data: undefined,\n error: undefined,\n loading: false,\n };\n } else {\n const currentResult = this.queryObservable!.currentResult();\n const { loading, partial, networkStatus, errors } = currentResult;\n let { error } = currentResult;\n\n // Until a set naming convention for networkError and graphQLErrors is\n // decided upon, we map errors (graphQLErrors) to the error props.\n if (errors && errors.length > 0) {\n error = new ApolloError({ graphQLErrors: errors });\n }\n\n const { fetchPolicy } = this.queryObservable!.options;\n Object.assign(result, { loading, networkStatus, error });\n\n const previousData =\n this.lastRenderedResult ? this.lastRenderedResult.data : {};\n\n if (loading) {\n Object.assign(result.data, previousData, currentResult.data);\n } else if (error) {\n Object.assign(result, {\n data: (this.queryObservable!.getLastResult() || {}).data,\n });\n } else if (\n fetchPolicy === 'no-cache' &&\n Object.keys(currentResult.data).length === 0\n ) {\n // Make sure data pulled in by a `no-cache` query is preserved\n // when the components parent tree is re-rendered.\n result.data = previousData;\n } else {\n const { partialRefetch } = this.props;\n if (\n partialRefetch &&\n currentResult.data !== null &&\n typeof currentResult.data === 'object' &&\n Object.keys(currentResult.data).length === 0 &&\n partial &&\n fetchPolicy !== 'cache-only'\n ) {\n // When a `Query` component is mounted, and a mutation is executed\n // that returns the same ID as the mounted `Query`, but has less\n // fields in its result, Apollo Client's `QueryManager` returns the\n // data as an empty Object since a hit can't be found in the cache.\n // This can lead to application errors when the UI elements rendered by\n // the original `Query` component are expecting certain data values to\n // exist, and they're all of a sudden stripped away. To help avoid\n // this we'll attempt to refetch the `Query` data.\n Object.assign(result, { loading: true, networkStatus: NetworkStatus.loading });\n result.refetch();\n this.lastRenderedResult = result;\n return result;\n }\n\n Object.assign(result.data, currentResult.data);\n }\n }\n\n // Handle race condition where refetch is called on child mount or later\n // Normal execution model:\n // render(loading) -> mount -> start subscription -> get data -> render(with data)\n //\n // SSR with synchronous refetch:\n // render(with data) -> refetch -> mount -> start subscription\n //\n // SSR with asynchronous refetch:\n // render(with data) -> mount -> start subscription -> refetch\n //\n // If a subscription has not started, then the synchronous call to refetch\n // must be made at a time when an active network request is being made, so\n // we ensure that the network requests are deduped, to avoid an\n // inconsistent UI state that displays different data for the current query\n // alongside a refetched query.\n //\n // Once the Query component is mounted and the subscription is made, we\n // always hit the network with refetch, since the components data will be\n // updated and a network request is not currently active.\n if (!this.querySubscription) {\n const oldRefetch = (result as QueryControls).refetch;\n\n (result as QueryControls).refetch = args => {\n if (this.querySubscription) {\n return oldRefetch(args);\n } else {\n return new Promise((r, f) => {\n this.refetcherQueue = { resolve: r, reject: f, args };\n });\n }\n };\n }\n\n // When the component is done rendering stored query errors, we'll\n // remove those errors from the `ObservableQuery` query store, so they\n // aren't re-displayed on subsequent (potentially error free)\n // requests/responses.\n //\n // NOTE: Resetting query store errors is handled in 2 different ways here,\n // since the `resetQueryStoreErrors` wasn't available until\n // `apollo-client` 2.6.3. If a previous version of `apollo-client` is\n // being used, errors are reset by reaching into `ObservableQuery`'s\n // internals. This hack is temporary, as React Apollo 3 will be\n // released shortly, and will enforce `apollo-client` 2.6.3 as the\n // minimum.\n setTimeout(() => {\n if ((this.queryObservable! as any).resetQueryStoreErrors) {\n // Apollo Client >= 2.6.3\n (this.queryObservable! as any).resetQueryStoreErrors();\n } else {\n // Apollo Client < 2.6.3\n const { queryManager, queryId } = (this.queryObservable! as any);\n const queryStore = queryManager.queryStore.get(queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n });\n\n result.client = this.client;\n this.lastRenderedResult = result;\n return result;\n };\n}\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ApolloClient, { PureQueryOptions, ApolloError, FetchPolicy } from 'apollo-client';\nimport { DataProxy } from 'apollo-cache';\nimport { invariant } from 'ts-invariant';\nimport { DocumentNode, GraphQLError } from 'graphql';\nimport shallowEqual from './utils/shallowEqual';\n\nimport { OperationVariables, RefetchQueriesProviderFn } from './types';\nimport { parser, DocumentType } from './parser';\nimport { getClient } from './component-utils';\n\nexport interface MutationResult> {\n data?: TData;\n error?: ApolloError;\n loading: boolean;\n called: boolean;\n client: ApolloClient;\n}\nexport interface MutationContext {\n client?: ApolloClient;\n operations: Map;\n}\n\nexport interface ExecutionResult> {\n data?: T;\n extensions?: Record;\n errors?: GraphQLError[];\n}\n\n// Improved MutationUpdaterFn type, need to port them back to Apollo Client\nexport declare type MutationUpdaterFn<\n T = {\n [key: string]: any;\n }\n> = (proxy: DataProxy, mutationResult: FetchResult) => void;\n\nexport declare type FetchResult<\n TData = Record,\n C = Record,\n E = Record\n> = ExecutionResult & {\n extensions?: E;\n context?: C;\n};\n\nexport declare type MutationOptions<\n TData = Record,\n TVariables = OperationVariables\n> = {\n variables?: TVariables;\n optimisticResponse?: TData;\n refetchQueries?: Array | RefetchQueriesProviderFn;\n awaitRefetchQueries?: boolean;\n update?: MutationUpdaterFn;\n context?: Record;\n fetchPolicy?: FetchPolicy;\n};\n\nexport declare type MutationFn = (\n options?: MutationOptions,\n) => Promise>;\n\nexport interface MutationProps {\n client?: ApolloClient;\n mutation: DocumentNode;\n ignoreResults?: boolean;\n optimisticResponse?: TData;\n variables?: TVariables;\n refetchQueries?: Array | RefetchQueriesProviderFn;\n awaitRefetchQueries?: boolean;\n update?: MutationUpdaterFn;\n children: (\n mutateFn: MutationFn,\n result: MutationResult,\n ) => React.ReactNode;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n context?: Record;\n fetchPolicy?: FetchPolicy;\n}\n\nexport interface MutationState {\n called: boolean;\n error?: ApolloError;\n data?: TData;\n loading: boolean;\n}\n\nconst initialState = {\n loading: false,\n called: false,\n error: undefined,\n data: undefined,\n};\n\nclass Mutation extends React.Component<\n MutationProps,\n MutationState\n> {\n static contextTypes = {\n client: PropTypes.object,\n operations: PropTypes.object,\n };\n\n static propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.object,\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),\n PropTypes.func,\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n };\n\n private client: ApolloClient;\n private mostRecentMutationId: number;\n\n private hasMounted: boolean = false;\n\n constructor(props: MutationProps, context: any) {\n super(props, context);\n this.client = getClient(props, context);\n this.verifyDocumentIsMutation(props.mutation);\n this.mostRecentMutationId = 0;\n this.state = initialState;\n }\n\n componentDidMount() {\n this.hasMounted = true;\n }\n\n componentWillUnmount() {\n this.hasMounted = false;\n }\n\n componentWillReceiveProps(\n nextProps: MutationProps,\n nextContext: MutationContext,\n ) {\n const nextClient = getClient(nextProps, nextContext);\n if (shallowEqual(this.props, nextProps) && this.client === nextClient) {\n return;\n }\n\n if (this.props.mutation !== nextProps.mutation) {\n this.verifyDocumentIsMutation(nextProps.mutation);\n }\n\n if (this.client !== nextClient) {\n this.client = nextClient;\n this.setState(initialState);\n }\n }\n\n render() {\n const { children } = this.props;\n const { loading, data, error, called } = this.state;\n\n const result = {\n called,\n loading,\n data,\n error,\n client: this.client,\n };\n\n return children(this.runMutation, result);\n }\n\n private runMutation = (options: MutationOptions = {}) => {\n this.onMutationStart();\n const mutationId = this.generateNewMutationId();\n\n return this.mutate(options)\n .then((response: ExecutionResult) => {\n this.onMutationCompleted(response, mutationId);\n return response;\n })\n .catch((e: ApolloError) => {\n this.onMutationError(e, mutationId);\n if (!this.props.onError) throw e;\n });\n };\n\n private mutate = (options: MutationOptions) => {\n const {\n mutation,\n variables,\n optimisticResponse,\n update,\n context = {},\n awaitRefetchQueries = false,\n fetchPolicy,\n } = this.props;\n const mutateOptions = { ...options };\n\n let refetchQueries = mutateOptions.refetchQueries || this.props.refetchQueries;\n // XXX this will be removed in the 3.0 of Apollo Client. Currently, we\n // support refectching of named queries which just pulls the latest\n // variables to match. This forces us to either a) keep all queries around\n // to be able to iterate over and refetch, or b) [new in 2.1] keep a map of\n // operations on the client where operation name => { query, variables }\n //\n // Going forward, we should only allow using the full operation + variables to\n // refetch.\n if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) {\n refetchQueries = (refetchQueries as any).map((x: string | PureQueryOptions) => {\n if (typeof x === 'string' && this.context.operations)\n return this.context.operations.get(x) || x;\n return x;\n });\n delete mutateOptions.refetchQueries;\n }\n\n const mutateVariables = Object.assign({}, variables, mutateOptions.variables);\n delete mutateOptions.variables;\n\n return this.client.mutate({\n mutation,\n optimisticResponse,\n refetchQueries,\n awaitRefetchQueries,\n update,\n context,\n fetchPolicy,\n variables: mutateVariables,\n ...mutateOptions,\n });\n };\n\n private onMutationStart = () => {\n if (!this.state.loading && !this.props.ignoreResults) {\n this.setState({\n loading: true,\n error: undefined,\n data: undefined,\n called: true,\n });\n }\n };\n\n private onMutationCompleted = (response: ExecutionResult, mutationId: number) => {\n const { onCompleted, ignoreResults } = this.props;\n\n const { data, errors } = response;\n const error =\n errors && errors.length > 0 ? new ApolloError({ graphQLErrors: errors }) : undefined;\n\n const callOncomplete = () => (onCompleted ? onCompleted(data as TData) : null);\n\n if (this.hasMounted && this.isMostRecentMutation(mutationId) && !ignoreResults) {\n this.setState({ loading: false, data, error }, callOncomplete);\n } else {\n callOncomplete();\n }\n };\n\n private onMutationError = (error: ApolloError, mutationId: number) => {\n const { onError } = this.props;\n const callOnError = () => (onError ? onError(error) : null);\n\n if (this.hasMounted && this.isMostRecentMutation(mutationId)) {\n this.setState({ loading: false, error }, callOnError);\n } else {\n callOnError();\n }\n };\n\n private generateNewMutationId = (): number => {\n this.mostRecentMutationId = this.mostRecentMutationId + 1;\n return this.mostRecentMutationId;\n };\n\n private isMostRecentMutation = (mutationId: number) => {\n return this.mostRecentMutationId === mutationId;\n };\n\n private verifyDocumentIsMutation = (mutation: DocumentNode) => {\n const operation = parser(mutation);\n invariant(\n operation.type === DocumentType.Mutation,\n `The component requires a graphql mutation, but got a ${\n operation.type === DocumentType.Query ? 'query' : 'subscription'\n }.`,\n );\n };\n}\n\nexport default Mutation;\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ApolloClient, { ApolloError, FetchPolicy } from 'apollo-client';\nimport { Observable } from 'apollo-link';\nimport { DocumentNode } from 'graphql';\nimport { ZenObservable } from 'zen-observable-ts';\n\nimport { OperationVariables } from './types';\nimport { getClient } from './component-utils';\n\nimport shallowEqual from './utils/shallowEqual';\nimport { invariant } from 'ts-invariant';\n\nexport interface SubscriptionResult {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n}\n\nexport interface OnSubscriptionDataOptions {\n client: ApolloClient;\n subscriptionData: SubscriptionResult;\n}\n\nexport interface SubscriptionProps {\n subscription: DocumentNode;\n variables?: TVariables;\n fetchPolicy?: FetchPolicy;\n shouldResubscribe?: any;\n client?: ApolloClient;\n onSubscriptionData?: (options: OnSubscriptionDataOptions) => any;\n onSubscriptionComplete?: () => void;\n children?: (result: SubscriptionResult) => React.ReactNode;\n}\n\nexport interface SubscriptionState {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n}\n\nexport interface SubscriptionContext {\n client?: ApolloClient;\n}\n\nclass Subscription extends React.Component<\n SubscriptionProps,\n SubscriptionState\n> {\n static contextTypes = {\n client: PropTypes.object,\n };\n\n static propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),\n };\n\n private client: ApolloClient;\n private queryObservable?: Observable;\n private querySubscription?: ZenObservable.Subscription;\n\n constructor(props: SubscriptionProps, context: SubscriptionContext) {\n super(props, context);\n\n this.client = getClient(props, context);\n this.initialize(props);\n this.state = this.getInitialState();\n }\n\n componentDidMount() {\n this.startSubscription();\n }\n\n componentWillReceiveProps(\n nextProps: SubscriptionProps,\n nextContext: SubscriptionContext,\n ) {\n const nextClient = getClient(nextProps, nextContext);\n\n if (\n shallowEqual(this.props.variables, nextProps.variables) &&\n this.client === nextClient &&\n this.props.subscription === nextProps.subscription\n ) {\n return;\n }\n\n let shouldResubscribe = nextProps.shouldResubscribe;\n if (typeof shouldResubscribe === 'function') {\n shouldResubscribe = !!shouldResubscribe(this.props, nextProps);\n }\n const shouldNotResubscribe = shouldResubscribe === false;\n if (this.client !== nextClient) {\n this.client = nextClient;\n }\n\n if (!shouldNotResubscribe) {\n this.endSubscription();\n delete this.queryObservable;\n this.initialize(nextProps);\n this.startSubscription();\n this.setState(this.getInitialState());\n return;\n }\n this.initialize(nextProps);\n this.startSubscription();\n }\n\n componentWillUnmount() {\n this.endSubscription();\n }\n\n render() {\n const renderFn: any = this.props.children;\n if (!renderFn) return null;\n const result = Object.assign({}, this.state, {\n variables: this.props.variables,\n });\n return renderFn(result);\n }\n\n private initialize = (props: SubscriptionProps) => {\n if (this.queryObservable) return;\n this.queryObservable = this.client.subscribe({\n query: props.subscription,\n variables: props.variables,\n fetchPolicy: props.fetchPolicy,\n });\n };\n\n private startSubscription = () => {\n if (this.querySubscription) return;\n this.querySubscription = this.queryObservable!.subscribe({\n next: this.updateCurrentData,\n error: this.updateError,\n complete: this.completeSubscription\n });\n };\n\n private getInitialState = () => ({\n loading: true,\n error: undefined,\n data: undefined,\n });\n\n private updateCurrentData = (result: SubscriptionResult) => {\n const {\n client,\n props: { onSubscriptionData },\n } = this;\n this.setState({\n data: result.data,\n loading: false,\n error: undefined,\n });\n if (onSubscriptionData) onSubscriptionData({ client, subscriptionData: result });\n };\n\n private updateError = (error: any) => {\n this.setState({\n error,\n loading: false,\n });\n };\n\n private completeSubscription = () => {\n const { onSubscriptionComplete } = this.props;\n if (onSubscriptionComplete) onSubscriptionComplete();\n this.endSubscription();\n };\n\n private endSubscription = () => {\n if (this.querySubscription) {\n this.querySubscription.unsubscribe();\n delete this.querySubscription;\n }\n };\n}\n\nexport default Subscription;\n","import * as React from 'react';\nimport { invariant } from 'ts-invariant';\n\nimport { OperationVariables } from './types';\nimport { DocumentType, IDocumentDefinition } from './parser';\n\nexport const defaultMapPropsToOptions = () => ({});\nexport const defaultMapResultToProps:

    (props: P) => P = props => props;\nexport const defaultMapPropsToSkip = () => false;\n\nexport function getDisplayName

    (WrappedComponent: React.ComponentType

    ) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nexport function calculateVariablesFromProps(operation: IDocumentDefinition, props: TProps) {\n let variables: OperationVariables = {};\n for (let { variable, type } of operation.variables) {\n if (!variable.name || !variable.name.value) continue;\n\n const variableName = variable.name.value;\n const variableProp = (props as any)[variableName];\n\n if (typeof variableProp !== 'undefined') {\n variables[variableName] = variableProp;\n continue;\n }\n\n // Allow optional props\n if (type.kind !== 'NonNullType') {\n variables[variableName] = undefined;\n }\n }\n return variables;\n}\n\nexport type RefSetter = (ref: React.ComponentClass) => void | void;\n\n// base class for hocs to easily manage refs\nexport class GraphQLBase extends React.Component<\n TProps,\n TState\n> {\n public withRef: boolean = false;\n // wrapped instance\n private wrappedInstance?: React.ComponentClass;\n\n constructor(props: TProps) {\n super(props);\n this.setWrappedInstance = this.setWrappedInstance.bind(this);\n }\n\n getWrappedInstance() {\n invariant(\n this.withRef,\n `To access the wrapped instance, you need to specify ` + `{ withRef: true } in the options`,\n );\n\n return this.wrappedInstance;\n }\n\n setWrappedInstance(ref: React.ComponentClass) {\n this.wrappedInstance = ref;\n }\n}\n","import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from './parser';\nimport { OperationOption, QueryOpts, OptionProps, DataProps } from './types';\nimport { default as Query } from './Query';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip,\n} from './hoc-utils';\n\nexport function withQuery<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = DataProps\n>(\n document: DocumentNode,\n operationOptions: OperationOption = {},\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo',\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => QueryOpts;\n if (typeof mapPropsToOptions !== 'function') {\n mapPropsToOptions = () => options as QueryOpts;\n }\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') {\n mapPropsToSkip = () => skip as any;\n }\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType,\n ): React.ComponentClass => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip ? Object.create(null) : { ...mapPropsToOptions(props) };\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(\n operation,\n props,\n );\n }\n return (\n \n {({ client: _, data, ...r }) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance,\n });\n }\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n \n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps = {\n [name]: result,\n ownProps: props as TProps,\n };\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n\n return (\n \n );\n }}\n \n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n","import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from './parser';\nimport { MutationOpts, OperationOption, OptionProps, MutateProps } from './types';\nimport { default as Mutation } from './Mutation';\nimport {\n defaultMapPropsToOptions,\n getDisplayName,\n calculateVariablesFromProps,\n GraphQLBase,\n} from './hoc-utils';\n\nexport function withMutation<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = MutateProps\n>(\n document: DocumentNode,\n operationOptions: OperationOption = {},\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n\n const { options = defaultMapPropsToOptions, alias = 'Apollo' } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => MutationOpts;\n if (typeof mapPropsToOptions !== 'function') mapPropsToOptions = () => options as MutationOpts;\n\n return (\n WrappedComponent: React.ComponentType,\n ): React.ComponentClass => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n render() {\n let props = this.props;\n const opts = mapPropsToOptions(props);\n\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance,\n });\n }\n if (!opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(\n operation,\n props,\n );\n }\n\n return (\n \n {(mutate, { data, ...r }) => {\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Mutation component's shape here to replicate that\n // this matches the query HoC\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'mutate';\n const resultName = operationOptions.name ? `${name}Result` : 'result';\n let childProps = { [name]: mutate, [resultName]: result };\n if (operationOptions.props) {\n const newResult: OptionProps = {\n [name]: mutate,\n [resultName]: result,\n ownProps: props,\n };\n childProps = operationOptions.props(newResult) as any;\n }\n\n return (\n \n );\n }}\n \n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n","import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from './parser';\nimport { OperationOption, QueryOpts, OptionProps, DataProps } from './types';\nimport { default as Subscription } from './Subscriptions';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip,\n} from './hoc-utils';\n\nexport function withSubscription<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = DataProps\n>(\n document: DocumentNode,\n operationOptions: OperationOption = {},\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo',\n shouldResubscribe,\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => QueryOpts;\n if (typeof mapPropsToOptions !== 'function') mapPropsToOptions = () => options as QueryOpts;\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') mapPropsToSkip = () => skip as any;\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType,\n ): React.ComponentClass => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n constructor(props: TProps) {\n super(props);\n this.state = { resubscribe: false };\n }\n componentWillReceiveProps(nextProps: TProps) {\n if (!shouldResubscribe) return;\n this.setState({\n resubscribe: shouldResubscribe(this.props, nextProps),\n });\n }\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props);\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(\n operation,\n props,\n );\n }\n return (\n \n {({ data, ...r }) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance,\n });\n }\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n \n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps = {\n [name]: result,\n ownProps: props as TProps,\n };\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n\n return (\n \n );\n }}\n \n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n","import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport { parser, DocumentType } from './parser';\nimport { OperationOption, DataProps, MutateProps } from './types';\n\nimport { withQuery } from './query-hoc';\nimport { withMutation } from './mutation-hoc';\nimport { withSubscription } from './subscription-hoc';\n\nexport function graphql<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = Partial> &\n Partial>\n>(\n document: DocumentNode,\n operationOptions: OperationOption = {},\n) {\n switch (parser(document).type) {\n case DocumentType.Mutation:\n return withMutation(document, operationOptions);\n case DocumentType.Subscription:\n return withSubscription(document, operationOptions);\n // case DocumentType.Fragment:\n // throw new Error('fragments cannont currently be used on their own');\n case DocumentType.Query:\n default:\n return withQuery(document, operationOptions);\n }\n}\n","import * as React from 'react';\nimport { OperationOption } from './types';\nimport ApolloConsumer from './ApolloConsumer';\nimport { ApolloClient } from 'apollo-client';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { invariant } from 'ts-invariant';\n\nfunction getDisplayName

    (WrappedComponent: React.ComponentType

    ) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nexport type WithApolloClient

    = P & { client: ApolloClient };\n\nexport default function withApollo(\n WrappedComponent: React.ComponentType>,\n operationOptions: OperationOption = {},\n): React.ComponentClass {\n const withDisplayName = `withApollo(${getDisplayName(WrappedComponent)})`;\n\n class WithApollo extends React.Component {\n static displayName = withDisplayName;\n static WrappedComponent = WrappedComponent;\n\n // wrapped instance\n private wrappedInstance: any;\n\n constructor(props: TProps) {\n super(props);\n this.setWrappedInstance = this.setWrappedInstance.bind(this);\n }\n\n getWrappedInstance() {\n invariant(\n operationOptions.withRef,\n `To access the wrapped instance, you need to specify ` + `{ withRef: true } in the options`,\n );\n\n return this.wrappedInstance;\n }\n\n setWrappedInstance(ref: React.ComponentType>) {\n this.wrappedInstance = ref;\n }\n\n render() {\n return (\n \n {client => {\n const props = Object.assign({}, this.props, {\n client,\n ref: operationOptions.withRef ? this.setWrappedInstance : undefined,\n });\n return ;\n }}\n \n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(WithApollo, WrappedComponent, {});\n}\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Query from './Query';\nimport { ObservableQuery } from 'apollo-client';\nimport { DocumentNode } from 'graphql';\n\ntype QueryInfo = {\n seen: boolean;\n observable: ObservableQuery | null;\n}\n\nfunction makeDefaultQueryInfo(): QueryInfo {\n return {\n seen: false,\n observable: null,\n };\n}\n\nexport class RenderPromises {\n // Map from Query component instances to pending fetchData promises.\n private queryPromises = new Map, Promise>();\n\n // Two-layered map from (query document, stringified variables) to QueryInfo\n // objects. These QueryInfo objects are intended to survive through the whole\n // getMarkupFromTree process, whereas specific Query instances do not survive\n // beyond a single call to renderToStaticMarkup.\n private queryInfoTrie = new Map>();\n\n // Registers the server side rendered observable.\n public registerSSRObservable(\n queryInstance: Query,\n observable: ObservableQuery,\n ) {\n this.lookupQueryInfo(queryInstance).observable = observable;\n }\n\n // Get's the cached observable that matches the SSR Query instances query and variables.\n public getSSRObservable(queryInstance: Query) {\n return this.lookupQueryInfo(queryInstance).observable;\n }\n\n public addQueryPromise(\n queryInstance: Query,\n finish: () => React.ReactNode,\n ): React.ReactNode {\n const info = this.lookupQueryInfo(queryInstance);\n if (!info.seen) {\n this.queryPromises.set(\n queryInstance,\n new Promise(resolve => {\n resolve(queryInstance.fetchData());\n }),\n );\n // Render null to abandon this subtree for this rendering, so that we\n // can wait for the data to arrive.\n return null;\n }\n return finish();\n }\n\n public hasPromises() {\n return this.queryPromises.size > 0;\n }\n\n public consumeAndAwaitPromises() {\n const promises: Promise[] = [];\n this.queryPromises.forEach((promise, queryInstance) => {\n // Make sure we never try to call fetchData for this query document and\n // these variables again. Since the queryInstance objects change with\n // every rendering, deduplicating them by query and variables is the\n // best we can do. If a different Query component happens to have the\n // same query document and variables, it will be immediately rendered\n // by calling finish() in addQueryPromise, which could result in the\n // rendering of an unwanted loading state, but that's not nearly as bad\n // as getting stuck in an infinite rendering loop because we kept calling\n // queryInstance.fetchData for the same Query component indefinitely.\n this.lookupQueryInfo(queryInstance).seen = true;\n promises.push(promise);\n });\n this.queryPromises.clear();\n return Promise.all(promises);\n }\n\n private lookupQueryInfo(\n queryInstance: Query,\n ): QueryInfo {\n const { queryInfoTrie } = this;\n const { query, variables } = queryInstance.props;\n const varMap = queryInfoTrie.get(query) || new Map();\n if (!queryInfoTrie.has(query)) queryInfoTrie.set(query, varMap);\n const variablesString = JSON.stringify(variables);\n const info = varMap.get(variablesString) || makeDefaultQueryInfo();\n if (!varMap.has(variablesString)) varMap.set(variablesString, info);\n return info;\n }\n}\n\nexport default function getDataFromTree(\n tree: React.ReactNode,\n context: { [key: string]: any } = {},\n) {\n return getMarkupFromTree({\n tree,\n context,\n // If you need to configure this renderFunction, call getMarkupFromTree\n // directly instead of getDataFromTree.\n renderFunction: require(\"react-dom/server\").renderToStaticMarkup,\n });\n}\n\nexport type GetMarkupFromTreeOptions = {\n tree: React.ReactNode;\n context?: { [key: string]: any };\n renderFunction?: (tree: React.ReactElement) => string;\n};\n\nexport function getMarkupFromTree({\n tree,\n context = {},\n // The rendering function is configurable! We use renderToStaticMarkup as\n // the default, because it's a little less expensive than renderToString,\n // and legacy usage of getDataFromTree ignores the return value anyway.\n renderFunction = require(\"react-dom/server\").renderToStaticMarkup,\n}: GetMarkupFromTreeOptions): Promise {\n const renderPromises = new RenderPromises();\n\n class RenderPromisesProvider extends React.Component {\n static childContextTypes: { [key: string]: any } = {\n renderPromises: PropTypes.object,\n };\n\n getChildContext() {\n return { ...context, renderPromises };\n }\n\n render() {\n // Always re-render from the rootElement, even though it might seem\n // better to render the children of the component responsible for the\n // promise, because it is not possible to reconstruct the full context\n // of the original rendering (including all unknown context provider\n // elements) for a subtree of the orginal component tree.\n return tree;\n }\n }\n\n Object.keys(context).forEach(key => {\n RenderPromisesProvider.childContextTypes[key] = PropTypes.any;\n });\n\n function process(): Promise | string {\n const html = renderFunction(React.createElement(RenderPromisesProvider));\n return renderPromises.hasPromises()\n ? renderPromises.consumeAndAwaitPromises().then(process)\n : html;\n }\n\n return Promise.resolve().then(process);\n}\n","import { ReactElement } from 'react';\nimport { getMarkupFromTree } from './getDataFromTree';\n\nexport function renderToStringWithData(component: ReactElement): Promise {\n return getMarkupFromTree({\n tree: component,\n renderFunction: require(\"react-dom/server\").renderToString,\n });\n}\n","export function compose(...funcs: Function[]) {\n const functions = funcs.reverse();\n return function (...args: any[]) {\n const [firstFunction, ...restFunctions] = functions\n let result = firstFunction.apply(null, args);\n restFunctions.forEach((fnc) => {\n result = fnc.call(null, result)\n });\n return result;\n }\n}\n"],"names":["React.createContext","React.createElement","PropTypes.object","PropTypes.func","tslib_1.__extends","PropTypes.node","PropTypes.string","PropTypes.bool","PropTypes.number","React.Component","PropTypes.oneOfType","PropTypes.arrayOf","getDisplayName","PropTypes.any"],"mappings":";;;;;;;;IASa,aAAa,GAAGA,aAAmB;IAC9CA,aAAmB,CAAiC,SAAS,CAAC;;ACAhE,IAAM,cAAc,GAClB,UAAC,KAAK,EAAE,aAAa;IACnB,SAAS,MAAM,CAAC,OAAY;QAC1B,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/B,MAAM;gBAEJ,iDAAiD,CAClD,CAAC;SACH;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KACvC;IAED,OAAO,aAAa,IAClBC,cAAC,aAAa,CAAC,QAAQ,QACpB,MAAM,CACgB,KAGzB,MAAM,CAAC,aAAa,CAAC,CACtB,CAAC;CACH,CAAC;AAEJ,cAAc,CAAC,YAAY,GAAG;IAC5B,MAAM,EAAEC,MAAgB,CAAC,UAAU;CACpC,CAAC;AAEF,cAAc,CAAC,SAAS,GAAG;IACzB,QAAQ,EAAEC,IAAc,CAAC,UAAU;CACpC,CAAC;;ACxBF;IAAoDC,kCAAsC;IAaxF,wBAAY,KAAkC,EAAE,OAAY;QAA5D,YACE,kBAAM,KAAK,EAAE,OAAO,CAAC,SActB;QAjBO,gBAAU,GAAyD,IAAI,GAAG,EAAE,CAAC;QAKnF;YAGI,qDAAqD,CACxD,CAAC;QAKF,IAAI,CAAE,KAAK,CAAC,MAAc,CAAC,oBAAoB,EAAE;YAC9C,KAAK,CAAC,MAAc,CAAC,oBAAoB,GAAG,KAAI,CAAC,UAAU,CAAC;SAC9D;;KACF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;IAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;CACxC;;SC1Je,sBAAsB,CAAC,SAA4B;IACjE,OAAO,iBAAiB,CAAC;QACvB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,cAAc;KAC3D,CAAC,CAAC;CACJ;;SCRe,OAAO;IAAC,eAAoB;SAApB,UAAoB,EAApB,qBAAoB,EAApB,IAAoB;QAApB,0BAAoB;;IAC1C,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAClC,OAAO;QAAU,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACtB,IAAA,4BAAa,EAAE,kCAAgB,CAAa;QACnD,IAAI,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,aAAa,CAAC,OAAO,CAAC,UAAC,GAAG;YACxB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;SAChC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;KACf,CAAA;CACF;;;;"} \ No newline at end of file diff --git a/node_modules/react-apollo/react-apollo.umd.js b/node_modules/react-apollo/react-apollo.umd.js new file mode 100644 index 000000000..bf9956934 --- /dev/null +++ b/node_modules/react-apollo/react-apollo.umd.js @@ -0,0 +1,1096 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('ts-invariant'), require('tslib'), require('apollo-client'), require('lodash.isequal'), require('hoist-non-react-statics')) : + typeof define === 'function' && define.amd ? define(['exports', 'react', 'prop-types', 'ts-invariant', 'tslib', 'apollo-client', 'lodash.isequal', 'hoist-non-react-statics'], factory) : + (global = global || self, factory(global['react-apollo'] = {}, global.react, global.propTypes, global.invariant, global.tslib, global.apollo.core, global.isEqual, global.hoistNonReactStatics)); +}(this, function (exports, react, propTypes, tsInvariant, tslib, apolloClient, isEqual, hoistNonReactStatics) { 'use strict'; + + isEqual = isEqual && isEqual.hasOwnProperty('default') ? isEqual['default'] : isEqual; + hoistNonReactStatics = hoistNonReactStatics && hoistNonReactStatics.hasOwnProperty('default') ? hoistNonReactStatics['default'] : hoistNonReactStatics; + + var ApolloContext = react.createContext && + react.createContext(undefined); + + var ApolloConsumer = function (props, legacyContext) { + function finish(context) { + if (!context || !context.client) { + throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError() : new tsInvariant.InvariantError('Could not find "client" in the context of ApolloConsumer. ' + + 'Wrap the root component in an .'); + } + return props.children(context.client); + } + return ApolloContext ? (react.createElement(ApolloContext.Consumer, null, finish)) : (finish(legacyContext)); + }; + ApolloConsumer.contextTypes = { + client: propTypes.object.isRequired, + }; + ApolloConsumer.propTypes = { + children: propTypes.func.isRequired, + }; + + var ApolloProvider = (function (_super) { + tslib.__extends(ApolloProvider, _super); + function ApolloProvider(props, context) { + var _this = _super.call(this, props, context) || this; + _this.operations = new Map(); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(props.client) : tsInvariant.invariant(props.client, 'ApolloProvider was not passed a client instance. Make ' + + 'sure you pass in your client via the "client" prop.'); + if (!props.client.__operations_cache__) { + props.client.__operations_cache__ = _this.operations; + } + return _this; + } + ApolloProvider.prototype.getChildContext = function () { + return { + client: this.props.client, + operations: this.props.client.__operations_cache__, + }; + }; + ApolloProvider.prototype.render = function () { + return ApolloContext ? (react.createElement(ApolloContext.Provider, { value: this.getChildContext() }, this.props.children)) : (this.props.children); + }; + ApolloProvider.propTypes = { + client: propTypes.object.isRequired, + children: propTypes.node.isRequired, + }; + ApolloProvider.childContextTypes = { + client: propTypes.object.isRequired, + operations: propTypes.object, + }; + return ApolloProvider; + }(react.Component)); + + var DocumentType; + (function (DocumentType) { + DocumentType[DocumentType["Query"] = 0] = "Query"; + DocumentType[DocumentType["Mutation"] = 1] = "Mutation"; + DocumentType[DocumentType["Subscription"] = 2] = "Subscription"; + })(DocumentType || (DocumentType = {})); + var cache = new Map(); + function parser(document) { + var cached = cache.get(document); + if (cached) + return cached; + var variables, type, name; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!document && !!document.kind) : tsInvariant.invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " + + "DocumentNode. You may need to use 'graphql-tag' or another method " + + "to convert your operation into a document"); + var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; }); + var queries = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'query'; }); + var mutations = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'mutation'; }); + var subscriptions = document.definitions.filter(function (x) { return x.kind === 'OperationDefinition' && x.operation === 'subscription'; }); + process.env.NODE_ENV === "production" ? tsInvariant.invariant( + !fragments.length || (queries.length || mutations.length || subscriptions.length) + ) : tsInvariant.invariant(!fragments.length || (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " + + "You must include a query, subscription or mutation as well"); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1) : tsInvariant.invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " + + (document + " had " + queries.length + " queries, " + subscriptions.length + " ") + + ("subscriptions and " + mutations.length + " mutations. ") + + "You can use 'compose' to join multiple operation types to a component"); + type = queries.length ? DocumentType.Query : DocumentType.Mutation; + if (!queries.length && !mutations.length) + type = DocumentType.Subscription; + var definitions = queries.length ? queries : mutations.length ? mutations : subscriptions; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(definitions.length === 1) : tsInvariant.invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " + + (definitions.length + " definitions. ") + + "You can use 'compose' to join multiple operation types to a component"); + var definition = definitions[0]; + variables = definition.variableDefinitions || []; + if (definition.name && definition.name.kind === 'Name') { + name = definition.name.value; + } + else { + name = 'data'; + } + var payload = { name: name, type: type, variables: variables }; + cache.set(document, payload); + return payload; + } + + function getClient(props, context) { + var client = props.client || context.client; + process.env.NODE_ENV === "production" ? tsInvariant.invariant(!!client) : tsInvariant.invariant(!!client, 'Could not find "client" in the context or passed in as a prop. ' + + 'Wrap the root component in an , or pass an ' + + 'ApolloClient instance in via props.'); + return client; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; + } + function isObject(obj) { + return obj !== null && typeof obj === "object"; + } + function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); + } + + function observableQueryFields(observable) { + var fields = { + variables: observable.variables, + refetch: observable.refetch.bind(observable), + fetchMore: observable.fetchMore.bind(observable), + updateQuery: observable.updateQuery.bind(observable), + startPolling: observable.startPolling.bind(observable), + stopPolling: observable.stopPolling.bind(observable), + subscribeToMore: observable.subscribeToMore.bind(observable), + }; + return fields; + } + var Query = (function (_super) { + tslib.__extends(Query, _super); + function Query(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.lastRenderedResult = null; + _this.startQuerySubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: function (result) { + if (_this.lastRenderedResult && + _this.lastRenderedResult.loading === result.loading && + _this.lastRenderedResult.networkStatus === result.networkStatus && + shallowEqual(_this.lastRenderedResult.data, result.data)) { + return; + } + _this.updateCurrentData(); + }, + error: function (error) { + _this.resubscribeToQuery(); + if (!error.hasOwnProperty('graphQLErrors')) + throw error; + _this.updateCurrentData(); + }, + }); + }; + _this.removeQuerySubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.lastRenderedResult; + delete _this.querySubscription; + } + }; + _this.updateCurrentData = function () { + _this.handleErrorOrCompleted(); + if (_this.hasMounted) + _this.forceUpdate(); + }; + _this.handleErrorOrCompleted = function () { + var result = _this.queryObservable.currentResult(); + var data = result.data, loading = result.loading, error = result.error; + var _a = _this.props, onCompleted = _a.onCompleted, onError = _a.onError; + if (onCompleted && !loading && !error) { + onCompleted(data); + } + else if (onError && !loading && error) { + onError(error); + } + }; + _this.getQueryResult = function () { + var result = { data: Object.create(null) }; + Object.assign(result, observableQueryFields(_this.queryObservable)); + if (_this.props.skip) { + result = tslib.__assign({}, result, { data: undefined, error: undefined, loading: false }); + } + else { + var currentResult = _this.queryObservable.currentResult(); + var loading = currentResult.loading, partial = currentResult.partial, networkStatus = currentResult.networkStatus, errors = currentResult.errors; + var error = currentResult.error; + if (errors && errors.length > 0) { + error = new apolloClient.ApolloError({ graphQLErrors: errors }); + } + var fetchPolicy = _this.queryObservable.options.fetchPolicy; + Object.assign(result, { loading: loading, networkStatus: networkStatus, error: error }); + var previousData = _this.lastRenderedResult ? _this.lastRenderedResult.data : {}; + if (loading) { + Object.assign(result.data, previousData, currentResult.data); + } + else if (error) { + Object.assign(result, { + data: (_this.queryObservable.getLastResult() || {}).data, + }); + } + else if (fetchPolicy === 'no-cache' && + Object.keys(currentResult.data).length === 0) { + result.data = previousData; + } + else { + var partialRefetch = _this.props.partialRefetch; + if (partialRefetch && + currentResult.data !== null && + typeof currentResult.data === 'object' && + Object.keys(currentResult.data).length === 0 && + partial && + fetchPolicy !== 'cache-only') { + Object.assign(result, { loading: true, networkStatus: apolloClient.NetworkStatus.loading }); + result.refetch(); + _this.lastRenderedResult = result; + return result; + } + Object.assign(result.data, currentResult.data); + } + } + if (!_this.querySubscription) { + var oldRefetch_1 = result.refetch; + result.refetch = function (args) { + if (_this.querySubscription) { + return oldRefetch_1(args); + } + else { + return new Promise(function (r, f) { + _this.refetcherQueue = { resolve: r, reject: f, args: args }; + }); + } + }; + } + setTimeout(function () { + if (_this.queryObservable.resetQueryStoreErrors) { + _this.queryObservable.resetQueryStoreErrors(); + } + else { + var _a = _this.queryObservable, queryManager = _a.queryManager, queryId = _a.queryId; + var queryStore = queryManager.queryStore.get(queryId); + if (queryStore) { + queryStore.networkError = null; + queryStore.graphQLErrors = []; + } + } + }); + result.client = _this.client; + _this.lastRenderedResult = result; + return result; + }; + _this.client = getClient(props, context); + _this.initializeQueryObservable(props); + return _this; + } + Query.prototype.fetchData = function () { + if (this.props.skip) + return false; + var _a = this.props, children = _a.children, ssr = _a.ssr, displayName = _a.displayName, skip = _a.skip, client = _a.client, onCompleted = _a.onCompleted, onError = _a.onError, partialRefetch = _a.partialRefetch, opts = tslib.__rest(_a, ["children", "ssr", "displayName", "skip", "client", "onCompleted", "onError", "partialRefetch"]); + var fetchPolicy = opts.fetchPolicy; + if (ssr === false) + return false; + if (fetchPolicy === 'network-only' || fetchPolicy === 'cache-and-network') { + fetchPolicy = 'cache-first'; + } + var observable = this.client.watchQuery(tslib.__assign({}, opts, { fetchPolicy: fetchPolicy })); + if (this.context && this.context.renderPromises) { + this.context.renderPromises.registerSSRObservable(this, observable); + } + var result = this.queryObservable.currentResult(); + return result.loading ? observable.result() : false; + }; + Query.prototype.componentDidMount = function () { + this.hasMounted = true; + if (this.props.skip) + return; + this.startQuerySubscription(); + if (this.refetcherQueue) { + var _a = this.refetcherQueue, args = _a.args, resolve = _a.resolve, reject = _a.reject; + this.queryObservable.refetch(args) + .then(resolve) + .catch(reject); + } + }; + Query.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + if (nextProps.skip && !this.props.skip) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + return; + } + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.client !== nextClient) { + this.client = nextClient; + this.removeQuerySubscription(); + this.queryObservable = null; + } + if (this.props.query !== nextProps.query) { + this.queryObservable.resetLastResults(); + this.removeQuerySubscription(); + } + this.updateQuery(nextProps); + if (nextProps.skip) + return; + this.startQuerySubscription(); + }; + Query.prototype.componentWillUnmount = function () { + this.removeQuerySubscription(); + this.hasMounted = false; + }; + Query.prototype.componentDidUpdate = function (prevProps) { + var isDiffRequest = !isEqual(prevProps.query, this.props.query) || + !isEqual(prevProps.variables, this.props.variables); + if (isDiffRequest) { + this.handleErrorOrCompleted(); + } + }; + Query.prototype.render = function () { + var _this = this; + var context = this.context; + var finish = function () { return _this.props.children(_this.getQueryResult()); }; + if (context && context.renderPromises) { + return context.renderPromises.addQueryPromise(this, finish); + } + return finish(); + }; + Query.prototype.extractOptsFromProps = function (props) { + this.operation = parser(props.query); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.operation.type === DocumentType.Query) : tsInvariant.invariant(this.operation.type === DocumentType.Query, "The component requires a graphql query, but got a " + (this.operation.type === DocumentType.Mutation ? 'mutation' : 'subscription') + "."); + var displayName = props.displayName || 'Query'; + return tslib.__assign({}, props, { displayName: displayName, context: props.context || {}, metadata: { reactComponent: { displayName: displayName } } }); + }; + Query.prototype.initializeQueryObservable = function (props) { + var opts = this.extractOptsFromProps(props); + this.setOperations(opts); + if (this.context && this.context.renderPromises) { + this.queryObservable = this.context.renderPromises.getSSRObservable(this); + } + if (!this.queryObservable) { + this.queryObservable = this.client.watchQuery(opts); + } + }; + Query.prototype.setOperations = function (props) { + if (this.context.operations) { + this.context.operations.set(this.operation.name, { + query: props.query, + variables: props.variables, + }); + } + }; + Query.prototype.updateQuery = function (props) { + if (!this.queryObservable) { + this.initializeQueryObservable(props); + } + else { + this.setOperations(props); + } + this.queryObservable.setOptions(this.extractOptsFromProps(props)) + .catch(function () { return null; }); + }; + Query.prototype.resubscribeToQuery = function () { + this.removeQuerySubscription(); + var lastError = this.queryObservable.getLastError(); + var lastResult = this.queryObservable.getLastResult(); + this.queryObservable.resetLastResults(); + this.startQuerySubscription(); + Object.assign(this.queryObservable, { lastError: lastError, lastResult: lastResult }); + }; + Query.contextTypes = { + client: propTypes.object, + operations: propTypes.object, + renderPromises: propTypes.object, + }; + Query.propTypes = { + client: propTypes.object, + children: propTypes.func.isRequired, + fetchPolicy: propTypes.string, + notifyOnNetworkStatusChange: propTypes.bool, + onCompleted: propTypes.func, + onError: propTypes.func, + pollInterval: propTypes.number, + query: propTypes.object.isRequired, + variables: propTypes.object, + ssr: propTypes.bool, + partialRefetch: propTypes.bool, + returnPartialData: propTypes.bool, + }; + return Query; + }(react.Component)); + + var initialState = { + loading: false, + called: false, + error: undefined, + data: undefined, + }; + var Mutation = (function (_super) { + tslib.__extends(Mutation, _super); + function Mutation(props, context) { + var _this = _super.call(this, props, context) || this; + _this.hasMounted = false; + _this.runMutation = function (options) { + if (options === void 0) { options = {}; } + _this.onMutationStart(); + var mutationId = _this.generateNewMutationId(); + return _this.mutate(options) + .then(function (response) { + _this.onMutationCompleted(response, mutationId); + return response; + }) + .catch(function (e) { + _this.onMutationError(e, mutationId); + if (!_this.props.onError) + throw e; + }); + }; + _this.mutate = function (options) { + var _a = _this.props, mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, update = _a.update, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, fetchPolicy = _a.fetchPolicy; + var mutateOptions = tslib.__assign({}, options); + var refetchQueries = mutateOptions.refetchQueries || _this.props.refetchQueries; + if (refetchQueries && refetchQueries.length && Array.isArray(refetchQueries)) { + refetchQueries = refetchQueries.map(function (x) { + if (typeof x === 'string' && _this.context.operations) + return _this.context.operations.get(x) || x; + return x; + }); + delete mutateOptions.refetchQueries; + } + var mutateVariables = Object.assign({}, variables, mutateOptions.variables); + delete mutateOptions.variables; + return _this.client.mutate(tslib.__assign({ mutation: mutation, + optimisticResponse: optimisticResponse, + refetchQueries: refetchQueries, + awaitRefetchQueries: awaitRefetchQueries, + update: update, + context: context, + fetchPolicy: fetchPolicy, variables: mutateVariables }, mutateOptions)); + }; + _this.onMutationStart = function () { + if (!_this.state.loading && !_this.props.ignoreResults) { + _this.setState({ + loading: true, + error: undefined, + data: undefined, + called: true, + }); + } + }; + _this.onMutationCompleted = function (response, mutationId) { + var _a = _this.props, onCompleted = _a.onCompleted, ignoreResults = _a.ignoreResults; + var data = response.data, errors = response.errors; + var error = errors && errors.length > 0 ? new apolloClient.ApolloError({ graphQLErrors: errors }) : undefined; + var callOncomplete = function () { return (onCompleted ? onCompleted(data) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId) && !ignoreResults) { + _this.setState({ loading: false, data: data, error: error }, callOncomplete); + } + else { + callOncomplete(); + } + }; + _this.onMutationError = function (error, mutationId) { + var onError = _this.props.onError; + var callOnError = function () { return (onError ? onError(error) : null); }; + if (_this.hasMounted && _this.isMostRecentMutation(mutationId)) { + _this.setState({ loading: false, error: error }, callOnError); + } + else { + callOnError(); + } + }; + _this.generateNewMutationId = function () { + _this.mostRecentMutationId = _this.mostRecentMutationId + 1; + return _this.mostRecentMutationId; + }; + _this.isMostRecentMutation = function (mutationId) { + return _this.mostRecentMutationId === mutationId; + }; + _this.verifyDocumentIsMutation = function (mutation) { + var operation = parser(mutation); + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operation.type === DocumentType.Mutation) : tsInvariant.invariant(operation.type === DocumentType.Mutation, "The component requires a graphql mutation, but got a " + (operation.type === DocumentType.Query ? 'query' : 'subscription') + "."); + }; + _this.client = getClient(props, context); + _this.verifyDocumentIsMutation(props.mutation); + _this.mostRecentMutationId = 0; + _this.state = initialState; + return _this; + } + Mutation.prototype.componentDidMount = function () { + this.hasMounted = true; + }; + Mutation.prototype.componentWillUnmount = function () { + this.hasMounted = false; + }; + Mutation.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props, nextProps) && this.client === nextClient) { + return; + } + if (this.props.mutation !== nextProps.mutation) { + this.verifyDocumentIsMutation(nextProps.mutation); + } + if (this.client !== nextClient) { + this.client = nextClient; + this.setState(initialState); + } + }; + Mutation.prototype.render = function () { + var children = this.props.children; + var _a = this.state, loading = _a.loading, data = _a.data, error = _a.error, called = _a.called; + var result = { + called: called, + loading: loading, + data: data, + error: error, + client: this.client, + }; + return children(this.runMutation, result); + }; + Mutation.contextTypes = { + client: propTypes.object, + operations: propTypes.object, + }; + Mutation.propTypes = { + mutation: propTypes.object.isRequired, + variables: propTypes.object, + optimisticResponse: propTypes.object, + refetchQueries: propTypes.oneOfType([ + propTypes.arrayOf(propTypes.oneOfType([propTypes.string, propTypes.object])), + propTypes.func, + ]), + awaitRefetchQueries: propTypes.bool, + update: propTypes.func, + children: propTypes.func.isRequired, + onCompleted: propTypes.func, + onError: propTypes.func, + fetchPolicy: propTypes.string, + }; + return Mutation; + }(react.Component)); + + var Subscription = (function (_super) { + tslib.__extends(Subscription, _super); + function Subscription(props, context) { + var _this = _super.call(this, props, context) || this; + _this.initialize = function (props) { + if (_this.queryObservable) + return; + _this.queryObservable = _this.client.subscribe({ + query: props.subscription, + variables: props.variables, + fetchPolicy: props.fetchPolicy, + }); + }; + _this.startSubscription = function () { + if (_this.querySubscription) + return; + _this.querySubscription = _this.queryObservable.subscribe({ + next: _this.updateCurrentData, + error: _this.updateError, + complete: _this.completeSubscription + }); + }; + _this.getInitialState = function () { return ({ + loading: true, + error: undefined, + data: undefined, + }); }; + _this.updateCurrentData = function (result) { + var _a = _this, client = _a.client, onSubscriptionData = _a.props.onSubscriptionData; + _this.setState({ + data: result.data, + loading: false, + error: undefined, + }); + if (onSubscriptionData) + onSubscriptionData({ client: client, subscriptionData: result }); + }; + _this.updateError = function (error) { + _this.setState({ + error: error, + loading: false, + }); + }; + _this.completeSubscription = function () { + var onSubscriptionComplete = _this.props.onSubscriptionComplete; + if (onSubscriptionComplete) + onSubscriptionComplete(); + _this.endSubscription(); + }; + _this.endSubscription = function () { + if (_this.querySubscription) { + _this.querySubscription.unsubscribe(); + delete _this.querySubscription; + } + }; + _this.client = getClient(props, context); + _this.initialize(props); + _this.state = _this.getInitialState(); + return _this; + } + Subscription.prototype.componentDidMount = function () { + this.startSubscription(); + }; + Subscription.prototype.componentWillReceiveProps = function (nextProps, nextContext) { + var nextClient = getClient(nextProps, nextContext); + if (shallowEqual(this.props.variables, nextProps.variables) && + this.client === nextClient && + this.props.subscription === nextProps.subscription) { + return; + } + var shouldResubscribe = nextProps.shouldResubscribe; + if (typeof shouldResubscribe === 'function') { + shouldResubscribe = !!shouldResubscribe(this.props, nextProps); + } + var shouldNotResubscribe = shouldResubscribe === false; + if (this.client !== nextClient) { + this.client = nextClient; + } + if (!shouldNotResubscribe) { + this.endSubscription(); + delete this.queryObservable; + this.initialize(nextProps); + this.startSubscription(); + this.setState(this.getInitialState()); + return; + } + this.initialize(nextProps); + this.startSubscription(); + }; + Subscription.prototype.componentWillUnmount = function () { + this.endSubscription(); + }; + Subscription.prototype.render = function () { + var renderFn = this.props.children; + if (!renderFn) + return null; + var result = Object.assign({}, this.state, { + variables: this.props.variables, + }); + return renderFn(result); + }; + Subscription.contextTypes = { + client: propTypes.object, + }; + Subscription.propTypes = { + subscription: propTypes.object.isRequired, + variables: propTypes.object, + children: propTypes.func, + onSubscriptionData: propTypes.func, + onSubscriptionComplete: propTypes.func, + shouldResubscribe: propTypes.oneOfType([propTypes.func, propTypes.bool]), + }; + return Subscription; + }(react.Component)); + + var defaultMapPropsToOptions = function () { return ({}); }; + var defaultMapPropsToSkip = function () { return false; }; + function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; + } + function calculateVariablesFromProps(operation, props) { + var variables = {}; + for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) { + var _b = _a[_i], variable = _b.variable, type = _b.type; + if (!variable.name || !variable.name.value) + continue; + var variableName = variable.name.value; + var variableProp = props[variableName]; + if (typeof variableProp !== 'undefined') { + variables[variableName] = variableProp; + continue; + } + if (type.kind !== 'NonNullType') { + variables[variableName] = undefined; + } + } + return variables; + } + var GraphQLBase = (function (_super) { + tslib.__extends(GraphQLBase, _super); + function GraphQLBase(props) { + var _this = _super.call(this, props) || this; + _this.withRef = false; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + GraphQLBase.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? tsInvariant.invariant(this.withRef) : tsInvariant.invariant(this.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + GraphQLBase.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + return GraphQLBase; + }(react.Component)); + + function withQuery(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') { + mapPropsToOptions = function () { return options; }; + } + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') { + mapPropsToSkip = function () { return skip; }; + } + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : tslib.__assign({}, mapPropsToOptions(props)); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document, warnUnhandledError: true }), function (_a) { + var _b, _c; + var _ = _a.client, data = _a.data, r = tslib.__rest(_a, ["client", "data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (react.createElement(WrappedComponent, tslib.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; + } + + function withMutation(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL() { + return _super !== null && _super.apply(this, arguments) || this; + } + GraphQL.prototype.render = function () { + var props = this.props; + var opts = mapPropsToOptions(props); + if (operationOptions.withRef) { + this.withRef = true; + props = Object.assign({}, props, { + ref: this.setWrappedInstance, + }); + } + if (!opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Mutation, tslib.__assign({}, opts, { mutation: document, ignoreResults: true }), function (mutate, _a) { + var _b, _c; + var data = _a.data, r = tslib.__rest(_a, ["data"]); + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'mutate'; + var resultName = operationOptions.name ? name + "Result" : 'result'; + var childProps = (_b = {}, _b[name] = mutate, _b[resultName] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = mutate, + _c[resultName] = result, + _c.ownProps = props, + _c); + childProps = operationOptions.props(newResult); + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; + } + + function withSubscription(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser(document); + var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') + mapPropsToSkip = function () { return skip; }; + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib.__extends(GraphQL, _super); + function GraphQL(props) { + var _this = _super.call(this, props) || this; + _this.state = { resubscribe: false }; + return _this; + } + GraphQL.prototype.componentWillReceiveProps = function (nextProps) { + if (!shouldResubscribe) + return; + this.setState({ + resubscribe: shouldResubscribe(this.props, nextProps), + }); + }; + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = calculateVariablesFromProps(operation, props); + } + return (react.createElement(Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) { + var _b, _c; + var data = _a.data, r = tslib.__rest(_a, ["data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (react.createElement(WrappedComponent, tslib.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (react.createElement(WrappedComponent, tslib.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(GraphQLBase)); + return hoistNonReactStatics(GraphQL, WrappedComponent, {}); + }; + } + + function graphql(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + switch (parser(document).type) { + case DocumentType.Mutation: + return withMutation(document, operationOptions); + case DocumentType.Subscription: + return withSubscription(document, operationOptions); + case DocumentType.Query: + default: + return withQuery(document, operationOptions); + } + } + + function getDisplayName$1(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; + } + function withApollo(WrappedComponent, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var withDisplayName = "withApollo(" + getDisplayName$1(WrappedComponent) + ")"; + var WithApollo = (function (_super) { + tslib.__extends(WithApollo, _super); + function WithApollo(props) { + var _this = _super.call(this, props) || this; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + WithApollo.prototype.getWrappedInstance = function () { + process.env.NODE_ENV === "production" ? tsInvariant.invariant(operationOptions.withRef) : tsInvariant.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + WithApollo.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + WithApollo.prototype.render = function () { + var _this = this; + return (react.createElement(ApolloConsumer, null, function (client) { + var props = Object.assign({}, _this.props, { + client: client, + ref: operationOptions.withRef ? _this.setWrappedInstance : undefined, + }); + return react.createElement(WrappedComponent, tslib.__assign({}, props)); + })); + }; + WithApollo.displayName = withDisplayName; + WithApollo.WrappedComponent = WrappedComponent; + return WithApollo; + }(react.Component)); + return hoistNonReactStatics(WithApollo, WrappedComponent, {}); + } + + function makeDefaultQueryInfo() { + return { + seen: false, + observable: null, + }; + } + var RenderPromises = (function () { + function RenderPromises() { + this.queryPromises = new Map(); + this.queryInfoTrie = new Map(); + } + RenderPromises.prototype.registerSSRObservable = function (queryInstance, observable) { + this.lookupQueryInfo(queryInstance).observable = observable; + }; + RenderPromises.prototype.getSSRObservable = function (queryInstance) { + return this.lookupQueryInfo(queryInstance).observable; + }; + RenderPromises.prototype.addQueryPromise = function (queryInstance, finish) { + var info = this.lookupQueryInfo(queryInstance); + if (!info.seen) { + this.queryPromises.set(queryInstance, new Promise(function (resolve) { + resolve(queryInstance.fetchData()); + })); + return null; + } + return finish(); + }; + RenderPromises.prototype.hasPromises = function () { + return this.queryPromises.size > 0; + }; + RenderPromises.prototype.consumeAndAwaitPromises = function () { + var _this = this; + var promises = []; + this.queryPromises.forEach(function (promise, queryInstance) { + _this.lookupQueryInfo(queryInstance).seen = true; + promises.push(promise); + }); + this.queryPromises.clear(); + return Promise.all(promises); + }; + RenderPromises.prototype.lookupQueryInfo = function (queryInstance) { + var queryInfoTrie = this.queryInfoTrie; + var _a = queryInstance.props, query = _a.query, variables = _a.variables; + var varMap = queryInfoTrie.get(query) || new Map(); + if (!queryInfoTrie.has(query)) + queryInfoTrie.set(query, varMap); + var variablesString = JSON.stringify(variables); + var info = varMap.get(variablesString) || makeDefaultQueryInfo(); + if (!varMap.has(variablesString)) + varMap.set(variablesString, info); + return info; + }; + return RenderPromises; + }()); + function getDataFromTree(tree, context) { + if (context === void 0) { context = {}; } + return getMarkupFromTree({ + tree: tree, + context: context, + renderFunction: require("react-dom/server").renderToStaticMarkup, + }); + } + function getMarkupFromTree(_a) { + var tree = _a.tree, _b = _a.context, context = _b === void 0 ? {} : _b, _c = _a.renderFunction, renderFunction = _c === void 0 ? require("react-dom/server").renderToStaticMarkup : _c; + var renderPromises = new RenderPromises(); + var RenderPromisesProvider = (function (_super) { + tslib.__extends(RenderPromisesProvider, _super); + function RenderPromisesProvider() { + return _super !== null && _super.apply(this, arguments) || this; + } + RenderPromisesProvider.prototype.getChildContext = function () { + return tslib.__assign({}, context, { renderPromises: renderPromises }); + }; + RenderPromisesProvider.prototype.render = function () { + return tree; + }; + RenderPromisesProvider.childContextTypes = { + renderPromises: propTypes.object, + }; + return RenderPromisesProvider; + }(react.Component)); + Object.keys(context).forEach(function (key) { + RenderPromisesProvider.childContextTypes[key] = propTypes.any; + }); + function process() { + var html = renderFunction(react.createElement(RenderPromisesProvider)); + return renderPromises.hasPromises() + ? renderPromises.consumeAndAwaitPromises().then(process) + : html; + } + return Promise.resolve().then(process); + } + + function renderToStringWithData(component) { + return getMarkupFromTree({ + tree: component, + renderFunction: require("react-dom/server").renderToString, + }); + } + + function compose() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i] = arguments[_i]; + } + var functions = funcs.reverse(); + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var firstFunction = functions[0], restFunctions = functions.slice(1); + var result = firstFunction.apply(null, args); + restFunctions.forEach(function (fnc) { + result = fnc.call(null, result); + }); + return result; + }; + } + + exports.ApolloConsumer = ApolloConsumer; + exports.ApolloContext = ApolloContext; + exports.ApolloProvider = ApolloProvider; + exports.Mutation = Mutation; + exports.Query = Query; + exports.RenderPromises = RenderPromises; + exports.Subscription = Subscription; + exports.compose = compose; + exports.getDataFromTree = getDataFromTree; + exports.getMarkupFromTree = getMarkupFromTree; + exports.graphql = graphql; + exports.renderToStringWithData = renderToStringWithData; + exports.withApollo = withApollo; + exports.withMutation = withMutation; + exports.withQuery = withQuery; + exports.withSubscription = withSubscription; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/node_modules/react-apollo/renderToStringWithData.d.ts b/node_modules/react-apollo/renderToStringWithData.d.ts new file mode 100644 index 000000000..b891f03a3 --- /dev/null +++ b/node_modules/react-apollo/renderToStringWithData.d.ts @@ -0,0 +1,2 @@ +import { ReactElement } from 'react'; +export declare function renderToStringWithData(component: ReactElement): Promise; diff --git a/node_modules/react-apollo/renderToStringWithData.js b/node_modules/react-apollo/renderToStringWithData.js new file mode 100644 index 000000000..5e82382b5 --- /dev/null +++ b/node_modules/react-apollo/renderToStringWithData.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var getDataFromTree_1 = require("./getDataFromTree"); +function renderToStringWithData(component) { + return getDataFromTree_1.getMarkupFromTree({ + tree: component, + renderFunction: require("react-dom/server").renderToString, + }); +} +exports.renderToStringWithData = renderToStringWithData; +//# sourceMappingURL=renderToStringWithData.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/renderToStringWithData.js.map b/node_modules/react-apollo/renderToStringWithData.js.map new file mode 100644 index 000000000..3c76f6dbd --- /dev/null +++ b/node_modules/react-apollo/renderToStringWithData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"renderToStringWithData.js","sourceRoot":"","sources":["../src/renderToStringWithData.ts"],"names":[],"mappings":";;AACA,qDAAsD;AAEtD,SAAgB,sBAAsB,CAAC,SAA4B;IACjE,OAAO,mCAAiB,CAAC;QACvB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,cAAc;KAC3D,CAAC,CAAC;AACL,CAAC;AALD,wDAKC"} \ No newline at end of file diff --git a/node_modules/react-apollo/subscription-hoc.d.ts b/node_modules/react-apollo/subscription-hoc.d.ts new file mode 100644 index 000000000..487b9a68b --- /dev/null +++ b/node_modules/react-apollo/subscription-hoc.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +import { DocumentNode } from 'graphql'; +import { OperationOption, DataProps } from './types'; +export declare function withSubscription>(document: DocumentNode, operationOptions?: OperationOption): (WrappedComponent: React.ComponentType) => React.ComponentClass; diff --git a/node_modules/react-apollo/subscription-hoc.js b/node_modules/react-apollo/subscription-hoc.js new file mode 100644 index 000000000..1500cbd38 --- /dev/null +++ b/node_modules/react-apollo/subscription-hoc.js @@ -0,0 +1,78 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics")); +var parser_1 = require("./parser"); +var Subscriptions_1 = tslib_1.__importDefault(require("./Subscriptions")); +var hoc_utils_1 = require("./hoc-utils"); +function withSubscription(document, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var operation = parser_1.parser(document); + var _a = operationOptions.options, options = _a === void 0 ? hoc_utils_1.defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? hoc_utils_1.defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe; + var mapPropsToOptions = options; + if (typeof mapPropsToOptions !== 'function') + mapPropsToOptions = function () { return options; }; + var mapPropsToSkip = skip; + if (typeof mapPropsToSkip !== 'function') + mapPropsToSkip = function () { return skip; }; + var lastResultProps; + return function (WrappedComponent) { + var graphQLDisplayName = alias + "(" + hoc_utils_1.getDisplayName(WrappedComponent) + ")"; + var GraphQL = (function (_super) { + tslib_1.__extends(GraphQL, _super); + function GraphQL(props) { + var _this = _super.call(this, props) || this; + _this.state = { resubscribe: false }; + return _this; + } + GraphQL.prototype.componentWillReceiveProps = function (nextProps) { + if (!shouldResubscribe) + return; + this.setState({ + resubscribe: shouldResubscribe(this.props, nextProps), + }); + }; + GraphQL.prototype.render = function () { + var _this = this; + var props = this.props; + var shouldSkip = mapPropsToSkip(props); + var opts = shouldSkip ? Object.create(null) : mapPropsToOptions(props); + if (!shouldSkip && !opts.variables && operation.variables.length > 0) { + opts.variables = hoc_utils_1.calculateVariablesFromProps(operation, props); + } + return (React.createElement(Subscriptions_1.default, tslib_1.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) { + var _b, _c; + var data = _a.data, r = tslib_1.__rest(_a, ["data"]); + if (operationOptions.withRef) { + _this.withRef = true; + props = Object.assign({}, props, { + ref: _this.setWrappedInstance, + }); + } + if (shouldSkip) { + return (React.createElement(WrappedComponent, tslib_1.__assign({}, props, {}))); + } + var result = Object.assign(r, data || {}); + var name = operationOptions.name || 'data'; + var childProps = (_b = {}, _b[name] = result, _b); + if (operationOptions.props) { + var newResult = (_c = {}, + _c[name] = result, + _c.ownProps = props, + _c); + lastResultProps = operationOptions.props(newResult, lastResultProps); + childProps = lastResultProps; + } + return (React.createElement(WrappedComponent, tslib_1.__assign({}, props, childProps))); + })); + }; + GraphQL.displayName = graphQLDisplayName; + GraphQL.WrappedComponent = WrappedComponent; + return GraphQL; + }(hoc_utils_1.GraphQLBase)); + return hoist_non_react_statics_1.default(GraphQL, WrappedComponent, {}); + }; +} +exports.withSubscription = withSubscription; +//# sourceMappingURL=subscription-hoc.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/subscription-hoc.js.map b/node_modules/react-apollo/subscription-hoc.js.map new file mode 100644 index 000000000..8fbcd7cce --- /dev/null +++ b/node_modules/react-apollo/subscription-hoc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"subscription-hoc.js","sourceRoot":"","sources":["../src/subscription-hoc.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAE/B,4FAA2D;AAE3D,mCAAkC;AAElC,0EAA0D;AAC1D,yCAMqB;AAErB,SAAgB,gBAAgB,CAM9B,QAAsB,EACtB,gBAAqF;IAArF,iCAAA,EAAA,qBAAqF;IAGrF,IAAM,SAAS,GAAG,eAAM,CAAC,QAAQ,CAAC,CAAC;IAGjC,IAAA,6BAAkC,EAAlC,mEAAkC,EAClC,0BAA4B,EAA5B,6DAA4B,EAC5B,2BAAgB,EAAhB,qCAAgB,EAChB,sDAAiB,CACE;IAErB,IAAI,iBAAiB,GAAG,O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O,iCAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AA/GD,4CA+GC"} \ No newline at end of file diff --git a/node_modules/react-apollo/test-links.d.ts b/node_modules/react-apollo/test-links.d.ts new file mode 100644 index 000000000..3d34b4ad5 --- /dev/null +++ b/node_modules/react-apollo/test-links.d.ts @@ -0,0 +1,40 @@ +import { Operation, GraphQLRequest, ApolloLink, FetchResult, Observable } from 'apollo-link'; +declare type ResultFunction = () => T; +export interface MockedResponse { + request: GraphQLRequest; + result?: FetchResult | ResultFunction; + error?: Error; + delay?: number; + newData?: ResultFunction; +} +export interface MockedSubscriptionResult { + result?: FetchResult; + error?: Error; + delay?: number; +} +export interface MockedSubscription { + request: GraphQLRequest; +} +export declare class MockLink extends ApolloLink { + addTypename: Boolean; + private mockedResponsesByKey; + constructor(mockedResponses: ReadonlyArray, addTypename?: Boolean); + addMockedResponse(mockedResponse: MockedResponse): void; + request(operation: Operation): Observable<{}>; + private normalizeMockedResponse; +} +export declare class MockSubscriptionLink extends ApolloLink { + unsubscribers: any[]; + setups: any[]; + private observer; + constructor(); + request(_req: any): Observable, Record>>; + simulateResult(result: MockedSubscriptionResult, complete?: boolean): void; + onSetup(listener: any): void; + onUnsubscribe(listener: any): void; +} +export declare function mockSingleLink(...mockedResponses: Array): ApolloLink; +export declare function mockObservableLink(): MockSubscriptionLink; +export {}; diff --git a/node_modules/react-apollo/test-links.js b/node_modules/react-apollo/test-links.js new file mode 100644 index 000000000..cc4021b18 --- /dev/null +++ b/node_modules/react-apollo/test-links.js @@ -0,0 +1,155 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var apollo_link_1 = require("apollo-link"); +var fast_json_stable_stringify_1 = tslib_1.__importDefault(require("fast-json-stable-stringify")); +var printer_1 = require("graphql/language/printer"); +var apollo_utilities_1 = require("apollo-utilities"); +var isEqual = require('lodash.isequal'); +var MockLink = (function (_super) { + tslib_1.__extends(MockLink, _super); + function MockLink(mockedResponses, addTypename) { + if (addTypename === void 0) { addTypename = true; } + var _this = _super.call(this) || this; + _this.addTypename = true; + _this.mockedResponsesByKey = {}; + _this.addTypename = addTypename; + if (mockedResponses) + mockedResponses.forEach(function (mockedResponse) { + _this.addMockedResponse(mockedResponse); + }); + return _this; + } + MockLink.prototype.addMockedResponse = function (mockedResponse) { + var normalizedMockedResponse = this.normalizeMockedResponse(mockedResponse); + var key = requestToKey(normalizedMockedResponse.request, this.addTypename); + var mockedResponses = this.mockedResponsesByKey[key]; + if (!mockedResponses) { + mockedResponses = []; + this.mockedResponsesByKey[key] = mockedResponses; + } + mockedResponses.push(normalizedMockedResponse); + }; + MockLink.prototype.request = function (operation) { + var key = requestToKey(operation, this.addTypename); + var responseIndex; + var response = (this.mockedResponsesByKey[key] || []).find(function (res, index) { + var requestVariables = operation.variables || {}; + var mockedResponseVariables = res.request.variables || {}; + if (!isEqual(fast_json_stable_stringify_1.default(requestVariables), fast_json_stable_stringify_1.default(mockedResponseVariables))) { + return false; + } + responseIndex = index; + return true; + }); + if (!response || typeof responseIndex === 'undefined') { + throw new Error("No more mocked responses for the query: " + printer_1.print(operation.query) + ", variables: " + JSON.stringify(operation.variables)); + } + this.mockedResponsesByKey[key].splice(responseIndex, 1); + var result = response.result, error = response.error, delay = response.delay, newData = response.newData; + if (newData) { + response.result = newData(); + this.mockedResponsesByKey[key].push(response); + } + if (!result && !error) { + throw new Error("Mocked response should contain either result or error: " + key); + } + return new apollo_link_1.Observable(function (observer) { + var timer = setTimeout(function () { + if (error) { + observer.error(error); + } + else { + if (result) { + observer.next(typeof result === 'function' + ? result() + : result); + } + observer.complete(); + } + }, delay ? delay : 0); + return function () { + clearTimeout(timer); + }; + }); + }; + MockLink.prototype.normalizeMockedResponse = function (mockedResponse) { + var newMockedResponse = apollo_utilities_1.cloneDeep(mockedResponse); + newMockedResponse.request.query = + apollo_utilities_1.removeConnectionDirectiveFromDocument(newMockedResponse.request.query); + var query = apollo_utilities_1.removeClientSetsFromDocument(newMockedResponse.request.query); + if (query) { + newMockedResponse.request.query = query; + } + return newMockedResponse; + }; + return MockLink; +}(apollo_link_1.ApolloLink)); +exports.MockLink = MockLink; +var MockSubscriptionLink = (function (_super) { + tslib_1.__extends(MockSubscriptionLink, _super); + function MockSubscriptionLink() { + var _this = _super.call(this) || this; + _this.unsubscribers = []; + _this.setups = []; + return _this; + } + MockSubscriptionLink.prototype.request = function (_req) { + var _this = this; + return new apollo_link_1.Observable(function (observer) { + _this.setups.forEach(function (x) { return x(); }); + _this.observer = observer; + return function () { + _this.unsubscribers.forEach(function (x) { return x(); }); + }; + }); + }; + MockSubscriptionLink.prototype.simulateResult = function (result, complete) { + var _this = this; + if (complete === void 0) { complete = false; } + setTimeout(function () { + var observer = _this.observer; + if (!observer) + throw new Error('subscription torn down'); + if (complete && observer.complete) + observer.complete(); + if (result.result && observer.next) + observer.next(result.result); + if (result.error && observer.error) + observer.error(result.error); + }, result.delay || 0); + }; + MockSubscriptionLink.prototype.onSetup = function (listener) { + this.setups = this.setups.concat([listener]); + }; + MockSubscriptionLink.prototype.onUnsubscribe = function (listener) { + this.unsubscribers = this.unsubscribers.concat([listener]); + }; + return MockSubscriptionLink; +}(apollo_link_1.ApolloLink)); +exports.MockSubscriptionLink = MockSubscriptionLink; +function requestToKey(request, addTypename) { + var queryString = request.query && + printer_1.print(addTypename ? apollo_utilities_1.addTypenameToDocument(request.query) : request.query); + var requestKey = { query: queryString }; + return JSON.stringify(requestKey); +} +function mockSingleLink() { + var mockedResponses = []; + for (var _i = 0; _i < arguments.length; _i++) { + mockedResponses[_i] = arguments[_i]; + } + var maybeTypename = mockedResponses[mockedResponses.length - 1]; + var mocks = mockedResponses.slice(0, mockedResponses.length - 1); + if (typeof maybeTypename !== 'boolean') { + mocks = mockedResponses; + maybeTypename = true; + } + return new MockLink(mocks, maybeTypename); +} +exports.mockSingleLink = mockSingleLink; +function mockObservableLink() { + return new MockSubscriptionLink(); +} +exports.mockObservableLink = mockObservableLink; +//# sourceMappingURL=test-links.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/test-links.js.map b/node_modules/react-apollo/test-links.js.map new file mode 100644 index 000000000..0f94a5fa7 --- /dev/null +++ b/node_modules/react-apollo/test-links.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-links.js","sourceRoot":"","sources":["../src/test-links.ts"],"names":[],"mappings":";;;AAAA,2CAOqB;AACrB,kGAAmD;AAEnD,oDAAiD;AACjD,qDAK0B;AAC1B,IAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAsB1C;IAA8B,oCAAU;IAItC,kBAAY,eAA8C,EAAE,WAA2B;QAA3B,4BAAA,EAAA,kBAA2B;QAAvF,YACE,iBAAO,SAMR;QAVM,iBAAW,GAAY,IAAI,CAAC;QAC3B,0BAAoB,GAAwC,EAAE,CAAC;QAIrE,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,eAAe;YACjB,eAAe,CAAC,OAAO,CAAC,UAAA,cAAc;gBACpC,KAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;;IACP,CAAC;IAEM,oCAAiB,GAAxB,UAAyB,cAA8B;QACrD,IAAM,wBAAwB,GAC5B,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAM,GAAG,GAAG,YAAY,CAAC,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7E,IAAI,eAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe,EAAE;YACpB,eAAe,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;SAClD;QACD,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACjD,CAAC;IAEM,0BAAO,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IACH,2BAAC;AAAD,CAAC,AArCD,CAA0C,wBAAU,GAqCnD;AArCY,oDAAoB;AAuCjC,SAAS,YAAY,CAAC,OAAuB,EAAE,WAAoB;IACjE,IAAM,WAAW,GACf,OAAO,CAAC,KAAK;QACb,eAAK,CAAC,WAAW,CAAC,CAAC,CAAC,wCAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5E,IAAM,UAAU,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAKD,SAAgB,cAAc;IAAC,yBAA8B;SAA9B,UAA8B,EAA9B,qBAA8B,EAA9B,IAA8B;QAA9B,oCAA8B;;IAE3D,IAAI,aAAa,GAAG,eAAe,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAChE,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEjE,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,KAAK,GAAG,eAAe,CAAC;QACxB,aAAa,GAAG,IAAI,CAAC;KACtB;IAED,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC5C,CAAC;AAXD,wCAWC;AAED,SAAgB,kBAAkB;IAChC,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC;AAFD,gDAEC"} \ No newline at end of file diff --git a/node_modules/react-apollo/test-utils.d.ts b/node_modules/react-apollo/test-utils.d.ts new file mode 100644 index 000000000..c9b7ed5c2 --- /dev/null +++ b/node_modules/react-apollo/test-utils.d.ts @@ -0,0 +1,24 @@ +import * as React from 'react'; +import ApolloClient from 'apollo-client'; +import { DefaultOptions, Resolvers } from 'apollo-client'; +import { MockedResponse } from './test-links'; +import { ApolloCache } from 'apollo-cache'; +export * from './test-links'; +export interface MockedProviderProps { + mocks?: ReadonlyArray; + addTypename?: boolean; + defaultOptions?: DefaultOptions; + cache?: ApolloCache; + resolvers?: Resolvers; + childProps?: object; + children?: React.ReactElement; +} +export interface MockedProviderState { + client: ApolloClient; +} +export declare class MockedProvider extends React.Component { + static defaultProps: MockedProviderProps; + constructor(props: MockedProviderProps); + render(): JSX.Element | null; + componentWillUnmount(): void; +} diff --git a/node_modules/react-apollo/test-utils.js b/node_modules/react-apollo/test-utils.js new file mode 100644 index 000000000..2eb00efd6 --- /dev/null +++ b/node_modules/react-apollo/test-utils.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var apollo_client_1 = tslib_1.__importDefault(require("apollo-client")); +var apollo_cache_inmemory_1 = require("apollo-cache-inmemory"); +var _1 = require("./"); +var test_links_1 = require("./test-links"); +tslib_1.__exportStar(require("./test-links"), exports); +var MockedProvider = (function (_super) { + tslib_1.__extends(MockedProvider, _super); + function MockedProvider(props) { + var _this = _super.call(this, props) || this; + var _a = _this.props, mocks = _a.mocks, addTypename = _a.addTypename, defaultOptions = _a.defaultOptions, cache = _a.cache, resolvers = _a.resolvers; + var client = new apollo_client_1.default({ + cache: cache || new apollo_cache_inmemory_1.InMemoryCache({ addTypename: addTypename }), + defaultOptions: defaultOptions, + link: new test_links_1.MockLink(mocks || [], addTypename), + resolvers: resolvers, + }); + _this.state = { client: client }; + return _this; + } + MockedProvider.prototype.render = function () { + var _a = this.props, children = _a.children, childProps = _a.childProps; + return children + ? (React.createElement(_1.ApolloProvider, { client: this.state.client }, React.cloneElement(React.Children.only(children), tslib_1.__assign({}, childProps)))) + : null; + }; + MockedProvider.prototype.componentWillUnmount = function () { + this.state.client.stop(); + }; + MockedProvider.defaultProps = { + addTypename: true, + }; + return MockedProvider; +}(React.Component)); +exports.MockedProvider = MockedProvider; +//# sourceMappingURL=test-utils.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/test-utils.js.map b/node_modules/react-apollo/test-utils.js.map new file mode 100644 index 000000000..e9ecf75d7 --- /dev/null +++ b/node_modules/react-apollo/test-utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../src/test-utils.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,wEAAyC;AAEzC,+DAA+D;AAE/D,uBAAoC;AACpC,2CAAwD;AAExD,uDAA6B;AAgB7B;IAAoC,0CAAyD;IAK3F,wBAAY,KAA0B;QAAtC,YACE,kBAAM,KAAK,CAAC,SAiBb;QAfO,IAAA,gBAMQ,EALZ,gBAAK,EACL,4BAAW,EACX,kCAAc,EACd,gBAAK,EACL,wBACY,CAAC;QACf,IAAM,MAAM,GAAG,IAAI,uBAAY,CAAC;YAC9B,KAAK,EAAE,KAAK,IAAI,IAAI,qCAAK,CAAC,EAAE,WAAW,aAAA,EAAE,CAAC;YAC1C,cAAc,gBAAA;YACd,IAAI,EAAE,IAAI,qBAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,WAAW,CAAC;YAC5C,SAAS,WAAA;SACV,CAAC,CAAC;QAEH,KAAI,CAAC,KAAK,GAAG,EAAE,MAAM,QAAA,EAAE,CAAC;;IAC1B,CAAC;IAEM,+BAAM,GAAb;QACQ,IAAA,eAAqC,EAAnC,sBAAQ,EAAE,0BAAyB,CAAC;QAC5C,OAAO,QAAQ;YACb,CAAC,CAAC,CACA,oBAAC,iBAAc,IAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,IACtC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,uBAAO,UAAU,EAAG,CACtD,CAClB;YACD,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IAEM,6CAAoB,GAA3B;QAGE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAvCa,2BAAY,GAAwB;QAChD,WAAW,EAAE,IAAI;KAClB,CAAC;IAsCJ,qBAAC;CAAA,AAzCD,CAAoC,KAAK,CAAC,SAAS,GAyClD;AAzCY,wCAAc"} \ No newline at end of file diff --git a/node_modules/react-apollo/types.d.ts b/node_modules/react-apollo/types.d.ts new file mode 100644 index 000000000..f023904f2 --- /dev/null +++ b/node_modules/react-apollo/types.d.ts @@ -0,0 +1,76 @@ +import ApolloClient, { ApolloQueryResult, ApolloError, FetchPolicy, WatchQueryFetchPolicy, ErrorPolicy, FetchMoreOptions, UpdateQueryOptions, FetchMoreQueryOptions, SubscribeToMoreOptions, PureQueryOptions, MutationUpdaterFn } from 'apollo-client'; +import { MutationFn, MutationResult } from './Mutation'; +export interface Context { + [key: string]: any; +} +export declare type OperationVariables = { + [key: string]: any; +}; +export declare type RefetchQueriesProviderFn = (...args: any[]) => Array; +export interface MutationOpts { + variables?: TGraphQLVariables; + optimisticResponse?: TData; + refetchQueries?: Array | RefetchQueriesProviderFn; + awaitRefetchQueries?: boolean; + errorPolicy?: ErrorPolicy; + update?: MutationUpdaterFn; + client?: ApolloClient; + notifyOnNetworkStatusChange?: boolean; + context?: Context; + onCompleted?: (data: TData) => void; + onError?: (error: ApolloError) => void; + fetchPolicy?: FetchPolicy; +} +export interface QueryOpts { + ssr?: boolean; + variables?: TGraphQLVariables; + fetchPolicy?: WatchQueryFetchPolicy; + errorPolicy?: ErrorPolicy; + pollInterval?: number; + client?: ApolloClient; + notifyOnNetworkStatusChange?: boolean; + context?: Context; + partialRefetch?: boolean; + returnPartialData?: boolean; +} +export interface QueryControls { + error?: ApolloError; + networkStatus: number; + loading: boolean; + variables: TGraphQLVariables; + fetchMore: (fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions) => Promise>; + refetch: (variables?: TGraphQLVariables) => Promise>; + startPolling: (pollInterval: number) => void; + stopPolling: () => void; + subscribeToMore: (options: SubscribeToMoreOptions) => () => void; + updateQuery: (mapFn: (previousQueryResult: any, options: UpdateQueryOptions) => any) => void; +} +export interface GraphqlQueryControls extends QueryControls { +} +export declare type MutationFunc = MutationFn; +export declare type DataValue = QueryControls & Partial; +export interface DataProps { + data: DataValue; +} +export interface MutateProps { + mutate: MutationFn; + result: MutationResult; +} +export declare type ChildProps = TProps & Partial> & Partial>; +export declare type ChildDataProps = TProps & DataProps; +export declare type ChildMutateProps = TProps & MutateProps; +export declare type NamedProps = TProps & { + ownProps: R; +}; +export interface OptionProps extends Partial>, Partial> { + ownProps: TProps; +} +export interface OperationOption> { + options?: QueryOpts | MutationOpts | ((props: TProps) => QueryOpts | MutationOpts); + props?: (props: OptionProps, lastProps?: TChildProps | void) => TChildProps; + skip?: boolean | ((props: TProps) => boolean); + name?: string; + withRef?: boolean; + shouldResubscribe?: (props: TProps, nextProps: TProps) => boolean; + alias?: string; +} diff --git a/node_modules/react-apollo/types.js b/node_modules/react-apollo/types.js new file mode 100644 index 000000000..2004e03da --- /dev/null +++ b/node_modules/react-apollo/types.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/types.js.map b/node_modules/react-apollo/types.js.map new file mode 100644 index 000000000..8724daea4 --- /dev/null +++ b/node_modules/react-apollo/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAiBC,CAAC"} \ No newline at end of file diff --git a/node_modules/react-apollo/utils/flowRight.d.ts b/node_modules/react-apollo/utils/flowRight.d.ts new file mode 100644 index 000000000..c1ed58922 --- /dev/null +++ b/node_modules/react-apollo/utils/flowRight.d.ts @@ -0,0 +1 @@ +export declare function compose(...funcs: Function[]): (...args: any[]) => any; diff --git a/node_modules/react-apollo/utils/flowRight.js b/node_modules/react-apollo/utils/flowRight.js new file mode 100644 index 000000000..cd45a2d15 --- /dev/null +++ b/node_modules/react-apollo/utils/flowRight.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function compose() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i] = arguments[_i]; + } + var functions = funcs.reverse(); + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var firstFunction = functions[0], restFunctions = functions.slice(1); + var result = firstFunction.apply(null, args); + restFunctions.forEach(function (fnc) { + result = fnc.call(null, result); + }); + return result; + }; +} +exports.compose = compose; +//# sourceMappingURL=flowRight.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/utils/flowRight.js.map b/node_modules/react-apollo/utils/flowRight.js.map new file mode 100644 index 000000000..32620afc7 --- /dev/null +++ b/node_modules/react-apollo/utils/flowRight.js.map @@ -0,0 +1 @@ +{"version":3,"file":"flowRight.js","sourceRoot":"","sources":["../../src/utils/flowRight.ts"],"names":[],"mappings":";;AAAA,SAAgB,OAAO;IAAC,eAAoB;SAApB,UAAoB,EAApB,qBAAoB,EAApB,IAAoB;QAApB,0BAAoB;;IAC1C,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAClC,OAAO;QAAU,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QACtB,IAAA,4BAAa,EAAE,kCAAgB,CAAa;QACnD,IAAI,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,aAAa,CAAC,OAAO,CAAC,UAAC,GAAG;YACxB,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAA;AACH,CAAC;AAVD,0BAUC"} \ No newline at end of file diff --git a/node_modules/react-apollo/utils/shallowEqual.d.ts b/node_modules/react-apollo/utils/shallowEqual.d.ts new file mode 100644 index 000000000..23d43e010 --- /dev/null +++ b/node_modules/react-apollo/utils/shallowEqual.d.ts @@ -0,0 +1 @@ +export default function shallowEqual(objA: any, objB: any): boolean; diff --git a/node_modules/react-apollo/utils/shallowEqual.js b/node_modules/react-apollo/utils/shallowEqual.js new file mode 100644 index 000000000..c0c7cbcf8 --- /dev/null +++ b/node_modules/react-apollo/utils/shallowEqual.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var hasOwnProperty = Object.prototype.hasOwnProperty; +function is(x, y) { + if (x === y) { + return x !== 0 || y !== 0 || 1 / x === 1 / y; + } + return x !== x && y !== y; +} +function isObject(obj) { + return obj !== null && typeof obj === "object"; +} +function shallowEqual(objA, objB) { + if (is(objA, objB)) { + return true; + } + if (!isObject(objA) || !isObject(objB)) { + return false; + } + var keys = Object.keys(objA); + if (keys.length !== Object.keys(objB).length) { + return false; + } + return keys.every(function (key) { return hasOwnProperty.call(objB, key) && is(objA[key], objB[key]); }); +} +exports.default = shallowEqual; +//# sourceMappingURL=shallowEqual.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/utils/shallowEqual.js.map b/node_modules/react-apollo/utils/shallowEqual.js.map new file mode 100644 index 000000000..21f83aeaf --- /dev/null +++ b/node_modules/react-apollo/utils/shallowEqual.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shallowEqual.js","sourceRoot":"","sources":["../../src/utils/shallowEqual.ts"],"names":[],"mappings":";;AAAQ,IAAA,gDAAc,CAAsB;AAE5C,SAAS,EAAE,CAAC,CAAM,EAAE,CAAM;IACxB,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC9C;IACD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AACjD,CAAC;AAED,SAAwB,YAAY,CAAC,IAAS,EAAE,IAAS;IACvD,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACtC,OAAO,KAAK,CAAC;KACd;IAED,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;QAC5C,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC,KAAK,CACf,UAAA,GAAG,IAAI,OAAA,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAA1D,CAA0D,CAClE,CAAC;AACJ,CAAC;AAlBD,+BAkBC"} \ No newline at end of file diff --git a/node_modules/react-apollo/walkTree.d.ts b/node_modules/react-apollo/walkTree.d.ts new file mode 100644 index 000000000..4a1809602 --- /dev/null +++ b/node_modules/react-apollo/walkTree.d.ts @@ -0,0 +1,3 @@ +import * as React from 'react'; +import { Context } from './types'; +export declare function walkTree(element: React.ReactNode, context: Context, visitor: (element: React.ReactNode, instance: React.Component | null, newContextMap: Map, context: Context, childContext?: Context) => boolean | void, newContext?: Map): void; diff --git a/node_modules/react-apollo/walkTree.js b/node_modules/react-apollo/walkTree.js new file mode 100644 index 000000000..c22e5828d --- /dev/null +++ b/node_modules/react-apollo/walkTree.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +function getProps(element) { + return element.props || element.attributes; +} +function isReactElement(element) { + return !!element.type; +} +function isComponentClass(Comp) { + return Comp.prototype && (Comp.prototype.render || Comp.prototype.isReactComponent); +} +function providesChildContext(instance) { + return !!instance.getChildContext; +} +function walkTree(element, context, visitor, newContext) { + if (newContext === void 0) { newContext = new Map(); } + if (!element) { + return; + } + if (Array.isArray(element)) { + element.forEach(function (item) { return walkTree(item, context, visitor, newContext); }); + return; + } + if (isReactElement(element)) { + if (typeof element.type === 'function') { + var Comp = element.type; + var childContext_1 = context; + var child = void 0; + if (isComponentClass(Comp)) { + var props = Object.assign({}, Comp.defaultProps, getProps(element)); + var instance_1 = new Comp(props, context); + Object.defineProperty(instance_1, 'props', { + value: instance_1.props || props, + }); + instance_1.context = instance_1.context || context; + instance_1.state = instance_1.state || null; + instance_1.setState = function (newState) { + if (typeof newState === 'function') { + newState = newState(instance_1.state, instance_1.props, instance_1.context); + } + instance_1.state = Object.assign({}, instance_1.state, newState); + }; + if (Comp.getDerivedStateFromProps) { + var result = Comp.getDerivedStateFromProps(instance_1.props, instance_1.state); + if (result !== null) { + instance_1.state = Object.assign({}, instance_1.state, result); + } + } + else if (instance_1.UNSAFE_componentWillMount) { + instance_1.UNSAFE_componentWillMount(); + } + else if (instance_1.componentWillMount) { + instance_1.componentWillMount(); + } + if (providesChildContext(instance_1)) { + childContext_1 = Object.assign({}, context, instance_1.getChildContext()); + } + if (visitor(element, instance_1, newContext, context, childContext_1) === false) { + return; + } + child = instance_1.render(); + } + else { + if (visitor(element, null, newContext, context) === false) { + return; + } + var FC = Comp; + child = FC(getProps(element), context); + } + if (child) { + if (Array.isArray(child)) { + child.forEach(function (item) { return walkTree(item, childContext_1, visitor, newContext); }); + } + else { + walkTree(child, childContext_1, visitor, newContext); + } + } + } + else if (element.type._context || element.type.Consumer) { + if (visitor(element, null, newContext, context) === false) { + return; + } + var child = void 0; + if (!!element.type._context) { + newContext = new Map(newContext); + newContext.set(element.type, element.props.value); + child = element.props.children; + } + else { + var value = element.type._currentValue; + if (newContext.has(element.type.Provider)) { + value = newContext.get(element.type.Provider); + } + child = element.props.children(value); + } + if (child) { + if (Array.isArray(child)) { + child.forEach(function (item) { return walkTree(item, context, visitor, newContext); }); + } + else { + walkTree(child, context, visitor, newContext); + } + } + } + else { + if (visitor(element, null, newContext, context) === false) { + return; + } + if (element.props && element.props.children) { + React.Children.forEach(element.props.children, function (child) { + if (child) { + walkTree(child, context, visitor, newContext); + } + }); + } + } + } + else if (typeof element === 'string' || typeof element === 'number') { + visitor(element, null, newContext, context); + } +} +exports.walkTree = walkTree; +//# sourceMappingURL=walkTree.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/walkTree.js.map b/node_modules/react-apollo/walkTree.js.map new file mode 100644 index 000000000..62782d6e0 --- /dev/null +++ b/node_modules/react-apollo/walkTree.js.map @@ -0,0 +1 @@ +{"version":3,"file":"walkTree.js","sourceRoot":"","sources":["../src/walkTree.ts"],"names":[],"mappings":";;;AAAA,mDAA+B;AAO/B,SAAS,QAAQ,CAAI,OAAiD;IACpE,OAAQ,OAAiC,CAAC,KAAK,IAAK,OAA4B,CAAC,UAAU,CAAC;AAC9F,CAAC;AAED,SAAS,cAAc,CAAC,OAAwB;IAC9C,OAAO,CAAC,CAAE,OAAe,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAA8B;IACtD,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,oBAAoB,CAC3B,QAA8B;IAE9B,OAAO,CAAC,CAAE,QAAgB,CAAC,eAAe,CAAC;AAC7C,CAAC;AAKD,SAAgB,QAAQ,CACtB,OAAwB,EACxB,OAAgB,EAChB,OAMmB,EACnB,UAAqC;IAArC,2BAAA,EAAA,iBAAgC,GAAG,EAAE;IAErC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IAED,IAAI,KAAK,C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CAA4C,CAAC,CAAC;iBACrE;qBAAM;oBACL,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;iBAC/C;aACF;SACF;aAAM;YAEL,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,KAAK,KAAK,EAAE;gBACzD,OAAO;aACR;YAED,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;gBAC3C,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAC,KAAU;oBACxD,IAAI,KAAK,EAAE;wBACT,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;qBAC/C;gBACH,CAAC,CAAC,CAAC;aACJ;SACF;KACF;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAErE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;KAC7C;AAEH,CAAC;AA/ID,4BA+IC"} \ No newline at end of file diff --git a/node_modules/react-apollo/withApollo.d.ts b/node_modules/react-apollo/withApollo.d.ts new file mode 100644 index 000000000..997d2e361 --- /dev/null +++ b/node_modules/react-apollo/withApollo.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +import { OperationOption } from './types'; +import { ApolloClient } from 'apollo-client'; +export declare type WithApolloClient

    = P & { + client: ApolloClient; +}; +export default function withApollo(WrappedComponent: React.ComponentType>, operationOptions?: OperationOption): React.ComponentClass; diff --git a/node_modules/react-apollo/withApollo.js b/node_modules/react-apollo/withApollo.js new file mode 100644 index 000000000..44ac1e45d --- /dev/null +++ b/node_modules/react-apollo/withApollo.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var React = tslib_1.__importStar(require("react")); +var ApolloConsumer_1 = tslib_1.__importDefault(require("./ApolloConsumer")); +var hoist_non_react_statics_1 = tslib_1.__importDefault(require("hoist-non-react-statics")); +var ts_invariant_1 = require("ts-invariant"); +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +function withApollo(WrappedComponent, operationOptions) { + if (operationOptions === void 0) { operationOptions = {}; } + var withDisplayName = "withApollo(" + getDisplayName(WrappedComponent) + ")"; + var WithApollo = (function (_super) { + tslib_1.__extends(WithApollo, _super); + function WithApollo(props) { + var _this = _super.call(this, props) || this; + _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); + return _this; + } + WithApollo.prototype.getWrappedInstance = function () { + ts_invariant_1.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options"); + return this.wrappedInstance; + }; + WithApollo.prototype.setWrappedInstance = function (ref) { + this.wrappedInstance = ref; + }; + WithApollo.prototype.render = function () { + var _this = this; + return (React.createElement(ApolloConsumer_1.default, null, function (client) { + var props = Object.assign({}, _this.props, { + client: client, + ref: operationOptions.withRef ? _this.setWrappedInstance : undefined, + }); + return React.createElement(WrappedComponent, tslib_1.__assign({}, props)); + })); + }; + WithApollo.displayName = withDisplayName; + WithApollo.WrappedComponent = WrappedComponent; + return WithApollo; + }(React.Component)); + return hoist_non_react_statics_1.default(WithApollo, WrappedComponent, {}); +} +exports.default = withApollo; +//# sourceMappingURL=withApollo.js.map \ No newline at end of file diff --git a/node_modules/react-apollo/withApollo.js.map b/node_modules/react-apollo/withApollo.js.map new file mode 100644 index 000000000..d589ebc25 --- /dev/null +++ b/node_modules/react-apollo/withApollo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"withApollo.js","sourceRoot":"","sources":["../src/withApollo.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAE/B,4EAA8C;AAE9C,4FAA2D;AAE3D,6CAAyC;AAEzC,SAAS,cAAc,CAAI,gBAAwC;IACjE,OAAO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EAAE,CAAC,CAAC;AAChE,CAAC;AAhDD,6BAgDC"} \ No newline at end of file diff --git a/node_modules/react-is/LICENSE b/node_modules/react-is/LICENSE new file mode 100644 index 000000000..b96dcb048 --- /dev/null +++ b/node_modules/react-is/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react-is/README.md b/node_modules/react-is/README.md new file mode 100644 index 000000000..f01acef95 --- /dev/null +++ b/node_modules/react-is/README.md @@ -0,0 +1,114 @@ +# `react-is` + +This package allows you to test arbitrary values and see if they're a particular React element type. + +## Installation + +```sh +# Yarn +yarn add react-is + +# NPM +npm install react-is +``` + +## Usage + +### Determining if a Component is Valid + +```js +import React from "react"; +import * as ReactIs from "react-is"; + +class ClassComponent extends React.Component { + render() { + return React.createElement("div"); + } +} + +const StatelessComponent = () => React.createElement("div"); + +const ForwardRefComponent = React.forwardRef((props, ref) => + React.createElement(Component, { forwardedRef: ref, ...props }) +); + +const Context = React.createContext(false); + +ReactIs.isValidElementType("div"); // true +ReactIs.isValidElementType(ClassComponent); // true +ReactIs.isValidElementType(StatelessComponent); // true +ReactIs.isValidElementType(ForwardRefComponent); // true +ReactIs.isValidElementType(Context.Provider); // true +ReactIs.isValidElementType(Context.Consumer); // true +ReactIs.isValidElementType(React.createFactory("div")); // true +``` + +### Determining an Element's Type + +#### ConcurrentMode + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isConcurrentMode(); // true +ReactIs.typeOf() === ReactIs.ConcurrentMode; // true +``` + +#### Context + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +const ThemeContext = React.createContext("blue"); + +ReactIs.isContextConsumer(); // true +ReactIs.isContextProvider(); // true +ReactIs.typeOf() === ReactIs.ContextProvider; // true +ReactIs.typeOf() === ReactIs.ContextConsumer; // true +``` + +#### Element + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isElement(

    ); // true +ReactIs.typeOf(
    ) === ReactIs.Element; // true +``` + +#### Fragment + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isFragment(<>); // true +ReactIs.typeOf(<>) === ReactIs.Fragment; // true +``` + +#### Portal + +```js +import React from "react"; +import ReactDOM from "react-dom"; +import * as ReactIs from 'react-is'; + +const div = document.createElement("div"); +const portal = ReactDOM.createPortal(
    , div); + +ReactIs.isPortal(portal); // true +ReactIs.typeOf(portal) === ReactIs.Portal; // true +``` + +#### StrictMode + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isStrictMode(); // true +ReactIs.typeOf() === ReactIs.StrictMode; // true +``` diff --git a/node_modules/react-is/build-info.json b/node_modules/react-is/build-info.json new file mode 100644 index 000000000..e1796b482 --- /dev/null +++ b/node_modules/react-is/build-info.json @@ -0,0 +1,8 @@ +{ + "branch": "pull/15226", + "buildNumber": "14079", + "checksum": "4a4c239", + "commit": "297165f1e", + "environment": "ci", + "reactVersion": "16.8.5-canary-297165f1e" +} diff --git a/node_modules/react-is/cjs/react-is.development.js b/node_modules/react-is/cjs/react-is.development.js new file mode 100644 index 000000000..b3c38465d --- /dev/null +++ b/node_modules/react-is/cjs/react-is.development.js @@ -0,0 +1,227 @@ +/** @license React v16.8.6 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + + + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + })(); +} diff --git a/node_modules/react-is/cjs/react-is.production.min.js b/node_modules/react-is/cjs/react-is.production.min.js new file mode 100644 index 000000000..b88bb327c --- /dev/null +++ b/node_modules/react-is/cjs/react-is.production.min.js @@ -0,0 +1,15 @@ +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): +60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; +exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; +exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; +exports.isSuspense=function(a){return t(a)===p}; diff --git a/node_modules/react-is/index.js b/node_modules/react-is/index.js new file mode 100644 index 000000000..3ae098d07 --- /dev/null +++ b/node_modules/react-is/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-is.production.min.js'); +} else { + module.exports = require('./cjs/react-is.development.js'); +} diff --git a/node_modules/react-is/package.json b/node_modules/react-is/package.json new file mode 100644 index 000000000..6e502546f --- /dev/null +++ b/node_modules/react-is/package.json @@ -0,0 +1,27 @@ +{ + "name": "react-is", + "version": "16.8.6", + "description": "Brand checking of React Elements.", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/facebook/react.git", + "directory": "packages/react-is" + }, + "keywords": [ + "react" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/facebook/react/issues" + }, + "homepage": "https://reactjs.org/", + "files": [ + "LICENSE", + "README.md", + "build-info.json", + "index.js", + "cjs/", + "umd/" + ] +} diff --git a/node_modules/react-is/umd/react-is.development.js b/node_modules/react-is/umd/react-is.development.js new file mode 100644 index 000000000..ee0eb9704 --- /dev/null +++ b/node_modules/react-is/umd/react-is.development.js @@ -0,0 +1,227 @@ +/** @license React v16.8.6 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.ReactIs = {}))); +}(this, (function (exports) { 'use strict'; + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/react-is/umd/react-is.production.min.js b/node_modules/react-is/umd/react-is.production.min.js new file mode 100644 index 000000000..4db65b645 --- /dev/null +++ b/node_modules/react-is/umd/react-is.production.min.js @@ -0,0 +1,13 @@ +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';(function(b,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports):"function"===typeof define&&define.amd?define(["exports"],c):c(b.ReactIs={})})(this,function(b){function c(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case r:switch(a=a.type,a){case t:case e:case f:case g:case h:case k:return a;default:switch(a=a&&a.$$typeof,a){case l:case m:case n:return a;default:return b}}case p:case q:case u:return b}}}function v(a){return c(a)===e}var d="function"=== +typeof Symbol&&Symbol.for,r=d?Symbol.for("react.element"):60103,u=d?Symbol.for("react.portal"):60106,f=d?Symbol.for("react.fragment"):60107,h=d?Symbol.for("react.strict_mode"):60108,g=d?Symbol.for("react.profiler"):60114,n=d?Symbol.for("react.provider"):60109,l=d?Symbol.for("react.context"):60110,t=d?Symbol.for("react.async_mode"):60111,e=d?Symbol.for("react.concurrent_mode"):60111,m=d?Symbol.for("react.forward_ref"):60112,k=d?Symbol.for("react.suspense"):60113,q=d?Symbol.for("react.memo"):60115, +p=d?Symbol.for("react.lazy"):60116;b.typeOf=c;b.AsyncMode=t;b.ConcurrentMode=e;b.ContextConsumer=l;b.ContextProvider=n;b.Element=r;b.ForwardRef=m;b.Fragment=f;b.Lazy=p;b.Memo=q;b.Portal=u;b.Profiler=g;b.StrictMode=h;b.Suspense=k;b.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===f||a===e||a===g||a===h||a===k||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===q||a.$$typeof===n||a.$$typeof===l||a.$$typeof===m)};b.isAsyncMode=function(a){return v(a)||c(a)=== +t};b.isConcurrentMode=v;b.isContextConsumer=function(a){return c(a)===l};b.isContextProvider=function(a){return c(a)===n};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===r};b.isForwardRef=function(a){return c(a)===m};b.isFragment=function(a){return c(a)===f};b.isLazy=function(a){return c(a)===p};b.isMemo=function(a){return c(a)===q};b.isPortal=function(a){return c(a)===u};b.isProfiler=function(a){return c(a)===g};b.isStrictMode=function(a){return c(a)===h};b.isSuspense=function(a){return c(a)=== +k};Object.defineProperty(b,"__esModule",{value:!0})}); diff --git a/node_modules/symbol-observable/CHANGELOG.md b/node_modules/symbol-observable/CHANGELOG.md new file mode 100644 index 000000000..d6f13d877 --- /dev/null +++ b/node_modules/symbol-observable/CHANGELOG.md @@ -0,0 +1,136 @@ + +# [1.2.0](https://github.com/blesh/symbol-observable/compare/1.1.0...v1.2.0) (2018-01-26) + + +### Bug Fixes + +* **TypeScript:** Remove global Symbol declaration ([427c3d7](https://github.com/blesh/symbol-observable/commit/427c3d7)) +* common js usage example (#30) ([42c2ffa](https://github.com/blesh/symbol-observable/commit/42c2ffa)) + + +### Features + +* **bundlers:** Add module and main entries in package.json (#33) ([97673e1](https://github.com/blesh/symbol-observable/commit/97673e1)) + + + + +# [1.1.0](https://github.com/blesh/symbol-observable/compare/1.0.4...v1.1.0) (2017-11-28) + + +### Bug Fixes + +* **TypeScript:** update TS to 2.0, fix typings ([e08474e](https://github.com/blesh/symbol-observable/commit/e08474e)), closes [#27](https://github.com/blesh/symbol-observable/issues/27) + + +### Features + +* **browser:** Fully qualified import for native esm browser support (#31) ([8ae5f8e](https://github.com/blesh/symbol-observable/commit/8ae5f8e)) +* **index.d.ts:** add type info to Symbol.observable ([e4be157](https://github.com/blesh/symbol-observable/commit/e4be157)) + + + + +## [1.0.4](https://github.com/blesh/symbol-observable/compare/1.0.3...v1.0.4) (2016-10-13) + + +### Bug Fixes + +* **global:** global variable location no longer assumes `module` exists ([4f85ede](https://github.com/blesh/symbol-observable/commit/4f85ede)), closes [#24](https://github.com/blesh/symbol-observable/issues/24) + + + + +## [1.0.3](https://github.com/blesh/symbol-observable/compare/1.0.2...v1.0.3) (2016-10-11) + + +### Bug Fixes + +* **mozilla addons support:** fix obtaining global object (#23) ([38da34d](https://github.com/blesh/symbol-observable/commit/38da34d)), closes [#23](https://github.com/blesh/symbol-observable/issues/23) + + + + +## [1.0.2](https://github.com/blesh/symbol-observable/compare/1.0.1...v1.0.2) (2016-08-09) + +### Bug Fixes + +* **ECMAScript 3**: ensure output is ES3 compatible ([3f37af3](https://github.com/blesh/symbol-observable/commit/3f37af3)) + + + + +## [1.0.1](https://github.com/blesh/symbol-observable/compare/1.0.0...v1.0.1) (2016-06-15) + + +### Bug Fixes + +* **bundlers:** fix issue that caused some bundlers not to be able to locate `/lib` (#19) ([dd8fdfe](https://github.com/blesh/symbol-observable/commit/dd8fdfe)), closes [(#19](https://github.com/(/issues/19) [#17](https://github.com/blesh/symbol-observable/issues/17) + + + + +# [1.0.0](https://github.com/blesh/symbol-observable/compare/0.2.4...v1.0.0) (2016-06-13) + + +### Bug Fixes + +* **index.js:** use typeof to check for global or window definitions (#8) ([5f4c2c6](https://github.com/blesh/symbol-observable/commit/5f4c2c6)) +* **types:** use default syntax for typedef ([240e3a6](https://github.com/blesh/symbol-observable/commit/240e3a6)) +* **TypeScript:** exported ponyfill now works with TypeScript ([c0b894e](https://github.com/blesh/symbol-observable/commit/c0b894e)) + +### Features + +* **es2015:** add es2015 implementation to support rollup (#10) ([7a41de9](https://github.com/blesh/symbol-observable/commit/7a41de9)) + + +### BREAKING CHANGES + +* TypeScript: CJS users will now have to `require('symbol-observable').default` rather than just `require('symbol-observable')` this was done to better support ES6 module bundlers. + + + + +## [0.2.4](https://github.com/blesh/symbol-observable/compare/0.2.2...v0.2.4) (2016-04-25) + + +### Bug Fixes + +* **IE8 support:** Ensure ES3 support so IE8 is happy ([9aaa7c3](https://github.com/blesh/symbol-observable/commit/9aaa7c3)) +* **Symbol.observable:** should NOT equal `Symbol.for('observable')`. ([3b0fdee](https://github.com/blesh/symbol-observable/commit/3b0fdee)), closes [#7](https://github.com/blesh/symbol-observable/issues/7) + + + + +## [0.2.3](https://github.com/blesh/symbol-observable/compare/0.2.3...v0.2.3) (2016-04-24) + +### Bug Fixes + +- **IE8/ECMAScript 3**: Make sure legacy browsers don't choke on a property named `for`. ([9aaa7c](https://github.com/blesh/symbol-observable/9aaa7c)) + + + +## [0.2.2](https://github.com/sindresorhus/symbol-observable/compare/0.2.1...v0.2.2) (2016-04-19) + +### Features + +* **TypeScript:** add TypeScript typings file ([befd7a](https://github.com/sindresorhus/symbol-observable/commit/befd7a)) + + + +## [0.2.1](https://github.com/sindresorhus/symbol-observable/compare/0.2.0...v0.2.1) (2016-04-19) + + +### Bug Fixes + +* **publish:** publish all required files ([5f26c3a](https://github.com/sindresorhus/symbol-observable/commit/5f26c3a)) + + + + +# [0.2.0](https://github.com/sindresorhus/symbol-observable/compare/v0.1.0...v0.2.0) (2016-04-19) + + +### Bug Fixes + +* **Symbol.observable:** ensure Symbol.for(\'observable\') matches Symbol.observable ([ada343f](https://github.com/sindresorhus/symbol-observable/commit/ada343f)), closes [#1](https://github.com/sindresorhus/symbol-observable/issues/1) [#2](https://github.com/sindresorhus/symbol-observable/issues/2) diff --git a/node_modules/symbol-observable/es/index.js b/node_modules/symbol-observable/es/index.js new file mode 100644 index 000000000..4ed892d25 --- /dev/null +++ b/node_modules/symbol-observable/es/index.js @@ -0,0 +1,19 @@ +/* global window */ +import ponyfill from './ponyfill.js'; + +var root; + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = ponyfill(root); +export default result; diff --git a/node_modules/symbol-observable/es/ponyfill.js b/node_modules/symbol-observable/es/ponyfill.js new file mode 100644 index 000000000..95dedc2e5 --- /dev/null +++ b/node_modules/symbol-observable/es/ponyfill.js @@ -0,0 +1,17 @@ +export default function symbolObservablePonyfill(root) { + var result; + var Symbol = root.Symbol; + + if (typeof Symbol === 'function') { + if (Symbol.observable) { + result = Symbol.observable; + } else { + result = Symbol('observable'); + Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; diff --git a/node_modules/symbol-observable/index.d.ts b/node_modules/symbol-observable/index.d.ts new file mode 100644 index 000000000..7426c5225 --- /dev/null +++ b/node_modules/symbol-observable/index.d.ts @@ -0,0 +1,12 @@ +declare const observableSymbol: symbol; +export default observableSymbol; + +declare global { + export interface SymbolConstructor { + readonly observable: symbol; + } +} + +export interface Symbol { + readonly [Symbol.observable]: symbol; +} diff --git a/node_modules/symbol-observable/index.js b/node_modules/symbol-observable/index.js new file mode 100644 index 000000000..b58e228f6 --- /dev/null +++ b/node_modules/symbol-observable/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/index'); diff --git a/node_modules/symbol-observable/lib/index.js b/node_modules/symbol-observable/lib/index.js new file mode 100644 index 000000000..de74e7845 --- /dev/null +++ b/node_modules/symbol-observable/lib/index.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ponyfill = require('./ponyfill.js'); + +var _ponyfill2 = _interopRequireDefault(_ponyfill); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var root; /* global window */ + + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = (0, _ponyfill2['default'])(root); +exports['default'] = result; \ No newline at end of file diff --git a/node_modules/symbol-observable/lib/ponyfill.js b/node_modules/symbol-observable/lib/ponyfill.js new file mode 100644 index 000000000..be68acaad --- /dev/null +++ b/node_modules/symbol-observable/lib/ponyfill.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports['default'] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var _Symbol = root.Symbol; + + if (typeof _Symbol === 'function') { + if (_Symbol.observable) { + result = _Symbol.observable; + } else { + result = _Symbol('observable'); + _Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; \ No newline at end of file diff --git a/node_modules/symbol-observable/license b/node_modules/symbol-observable/license new file mode 100644 index 000000000..0239f4730 --- /dev/null +++ b/node_modules/symbol-observable/license @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Ben Lesh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/symbol-observable/package.json b/node_modules/symbol-observable/package.json new file mode 100644 index 000000000..0e14c55c8 --- /dev/null +++ b/node_modules/symbol-observable/package.json @@ -0,0 +1,49 @@ +{ + "name": "symbol-observable", + "version": "1.2.0", + "description": "Symbol.observable ponyfill", + "license": "MIT", + "repository": "blesh/symbol-observable", + "author": { + "name": "Ben Lesh", + "email": "ben@benlesh.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "npm run build && mocha && tsc && node ./ts-test/test.js && check-es3-syntax -p lib/ --kill", + "build": "babel es --out-dir lib", + "prepublish": "npm test" + }, + "files": [ + "index.js", + "ponyfill.js", + "index.d.ts", + "es/index.js", + "es/ponyfill/js", + "lib/index.js", + "lib/ponyfill.js" + ], + "main": "lib/index.js", + "module": "es/index.js", + "jsnext:main": "es/index.js", + "typings": "index.d.ts", + "keywords": [ + "symbol", + "observable", + "observables", + "ponyfill", + "polyfill", + "shim" + ], + "devDependencies": { + "babel-cli": "^6.9.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-es3": "^1.0.0", + "chai": "^3.5.0", + "check-es3-syntax-cli": "^0.1.0", + "mocha": "^2.4.5", + "typescript": "^2.1.4" + } +} diff --git a/node_modules/symbol-observable/readme.md b/node_modules/symbol-observable/readme.md new file mode 100644 index 000000000..153a1ca0c --- /dev/null +++ b/node_modules/symbol-observable/readme.md @@ -0,0 +1,31 @@ +# symbol-observable [![Build Status](https://travis-ci.org/benlesh/symbol-observable.svg?branch=master)](https://travis-ci.org/benlesh/symbol-observable) + +> [`Symbol.observable`](https://github.com/zenparsing/es-observable) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save symbol-observable +``` + + +## Usage + +```js +const symbolObservable = require('symbol-observable').default; + +console.log(symbolObservable); +//=> Symbol(observable) +``` + + +## Related + +- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable +- [observable-to-promise](https://github.com/sindresorhus/observable-to-promise) - Convert an Observable to a Promise + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) and [Ben Lesh](https://github.com/benlesh) diff --git a/node_modules/ts-invariant/LICENSE b/node_modules/ts-invariant/LICENSE new file mode 100644 index 000000000..3033d0003 --- /dev/null +++ b/node_modules/ts-invariant/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Apollo GraphQL + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/ts-invariant/README.md b/node_modules/ts-invariant/README.md new file mode 100644 index 000000000..b4c1c9bca --- /dev/null +++ b/node_modules/ts-invariant/README.md @@ -0,0 +1,4 @@ +# ts-invariant + +[TypeScript](https://www.typescriptlang.org) implementation of +[`invariant(condition, message)`](https://www.npmjs.com/package/invariant). diff --git a/node_modules/ts-invariant/lib/invariant.d.ts b/node_modules/ts-invariant/lib/invariant.d.ts new file mode 100644 index 000000000..7bdd2a70f --- /dev/null +++ b/node_modules/ts-invariant/lib/invariant.d.ts @@ -0,0 +1,14 @@ +/// +export declare class InvariantError extends Error { + framesToPop: number; + name: string; + constructor(message?: string | number); +} +export declare function invariant(condition: any, message?: string | number): void; +export declare namespace invariant { + const warn: (...args: any[]) => void; + const error: (...args: any[]) => void; +} +declare let processStub: NodeJS.Process; +export { processStub as process }; +export default invariant; diff --git a/node_modules/ts-invariant/lib/invariant.esm.js b/node_modules/ts-invariant/lib/invariant.esm.js new file mode 100644 index 000000000..5b5cc07f7 --- /dev/null +++ b/node_modules/ts-invariant/lib/invariant.esm.js @@ -0,0 +1,62 @@ +import { __extends } from 'tslib'; + +var genericMessage = "Invariant Violation"; +var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { + obj.__proto__ = proto; + return obj; +} : _a; +var InvariantError = /** @class */ (function (_super) { + __extends(InvariantError, _super); + function InvariantError(message) { + if (message === void 0) { message = genericMessage; } + var _this = _super.call(this, typeof message === "number" + ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" + : message) || this; + _this.framesToPop = 1; + _this.name = genericMessage; + setPrototypeOf(_this, InvariantError.prototype); + return _this; + } + return InvariantError; +}(Error)); +function invariant(condition, message) { + if (!condition) { + throw new InvariantError(message); + } +} +function wrapConsoleMethod(method) { + return function () { + return console[method].apply(console, arguments); + }; +} +(function (invariant) { + invariant.warn = wrapConsoleMethod("warn"); + invariant.error = wrapConsoleMethod("error"); +})(invariant || (invariant = {})); +// Code that uses ts-invariant with rollup-plugin-invariant may want to +// import this process stub to avoid errors evaluating process.env.NODE_ENV. +// However, because most ESM-to-CJS compilers will rewrite the process import +// as tsInvariant.process, which prevents proper replacement by minifiers, we +// also attempt to define the stub globally when it is not already defined. +var processStub = { env: {} }; +if (typeof process === "object") { + processStub = process; +} +else + try { + // Using Function to evaluate this assignment in global scope also escapes + // the strict mode of the current module, thereby allowing the assignment. + // Inspired by https://github.com/facebook/regenerator/pull/369. + Function("stub", "process = stub")(processStub); + } + catch (atLeastWeTried) { + // The assignment can fail if a Content Security Policy heavy-handedly + // forbids Function usage. In those environments, developers should take + // extra care to replace process.env.NODE_ENV in their production builds, + // or define an appropriate global.process polyfill. + } +var invariant$1 = invariant; + +export default invariant$1; +export { InvariantError, invariant, processStub as process }; +//# sourceMappingURL=invariant.esm.js.map diff --git a/node_modules/ts-invariant/lib/invariant.esm.js.map b/node_modules/ts-invariant/lib/invariant.esm.js.map new file mode 100644 index 000000000..a1931f285 --- /dev/null +++ b/node_modules/ts-invariant/lib/invariant.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"invariant.esm.js","sources":["../src/invariant.ts"],"sourcesContent":["const genericMessage = \"Invariant Violation\";\nconst {\n setPrototypeOf = function (obj: any, proto: any) {\n obj.__proto__ = proto;\n return obj;\n },\n} = Object as any;\n\nexport class InvariantError extends Error {\n framesToPop = 1;\n name = genericMessage;\n constructor(message: string | number = genericMessage) {\n super(\n typeof message === \"number\"\n ? `${genericMessage}: ${message} (see https://github.com/apollographql/invariant-packages)`\n : message\n );\n setPrototypeOf(this, InvariantError.prototype);\n }\n}\n\nexport function invariant(condition: any, message?: string | number) {\n if (!condition) {\n throw new InvariantError(message);\n }\n}\n\nfunction wrapConsoleMethod(method: \"warn\" | \"error\") {\n return function () {\n return console[method].apply(console, arguments as any);\n } as (...args: any[]) => void;\n}\n\nexport namespace invariant {\n export const warn = wrapConsoleMethod(\"warn\");\n export const error = wrapConsoleMethod(\"error\");\n}\n\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\n// However, because most ESM-to-CJS compilers will rewrite the process import\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\n// also attempt to define the stub globally when it is not already defined.\nlet processStub: NodeJS.Process = { env: {} } as any;\nexport { processStub as process };\nif (typeof process === \"object\") {\n processStub = process;\n} else try {\n // Using Function to evaluate this assignment in global scope also escapes\n // the strict mode of the current module, thereby allowing the assignment.\n // Inspired by https://github.com/facebook/regenerator/pull/369.\n Function(\"stub\", \"process = stub\")(processStub);\n} catch (atLeastWeTried) {\n // The assignment can fail if a Content Security Policy heavy-handedly\n // forbids Function usage. In those environments, developers should take\n // extra care to replace process.env.NODE_ENV in their production builds,\n // or define an appropriate global.process polyfill.\n}\n\nexport default invariant;\n"],"names":["tslib_1.__extends"],"mappings":";;AAAA,IAAM,cAAc,GAAG,qBAAqB,CAAC;AAE3C,IAAA,0BAGC,EAHD;;;MAGC,CACe;AAElB;IAAoCA,kCAAK;IAGvC,wBAAY,OAAyC;QAAzC,wBAAA,EAAA,wBAAyC;QAArD,YACE,kBACE,OAAO,OAAO,KAAK,QAAQ;cACpB,cAAc,UAAK,OAAO,+DAA4D;cACzF,OAAO,CACZ,SAEF;QATD,iBAAW,GAAG,CAAC,CAAC;QAChB,UAAI,GAAG,cAAc,CAAC;QAOpB,cAAc,CAAC,KAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;;KAChD;IACH,qBAAC;CAXD,CAAoC,KAAK,GAWxC;SAEe,SAAS,CAAC,SAAc,EAAE,OAAyB;IACjE,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;KACnC;CACF;AAED,SAAS,iBAAiB,CAAC,MAAwB;IACjD,OAAO;QACL,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,SAAgB,CAAC,CAAC;KAC7B,CAAC;CAC/B;AAED,WAAiB,SAAS;IACX,cAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACjC,eAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACjD,EAHgB,SAAS,KAAT,SAAS,QAGzB;;;;;;AAOD,IAAI,WAAW,GAAmB,EAAE,GAAG,EAAE,EAAE,EAAS,CAAC;AACrD,AACA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;IAC/B,WAAW,GAAG,OAAO,CAAC;CACvB;;IAAM,IAAI;;;;QAIT,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,WAAW,CAAC,CAAC;KACjD;IAAC,OAAO,cAAc,EAAE;;;;;KAKxB;AAED,kBAAe,SAAS,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/ts-invariant/lib/invariant.js b/node_modules/ts-invariant/lib/invariant.js new file mode 100644 index 000000000..df611e27c --- /dev/null +++ b/node_modules/ts-invariant/lib/invariant.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var tslib = require('tslib'); + +var genericMessage = "Invariant Violation"; +var _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) { + obj.__proto__ = proto; + return obj; +} : _a; +var InvariantError = /** @class */ (function (_super) { + tslib.__extends(InvariantError, _super); + function InvariantError(message) { + if (message === void 0) { message = genericMessage; } + var _this = _super.call(this, typeof message === "number" + ? genericMessage + ": " + message + " (see https://github.com/apollographql/invariant-packages)" + : message) || this; + _this.framesToPop = 1; + _this.name = genericMessage; + setPrototypeOf(_this, InvariantError.prototype); + return _this; + } + return InvariantError; +}(Error)); +function invariant(condition, message) { + if (!condition) { + throw new InvariantError(message); + } +} +function wrapConsoleMethod(method) { + return function () { + return console[method].apply(console, arguments); + }; +} +(function (invariant) { + invariant.warn = wrapConsoleMethod("warn"); + invariant.error = wrapConsoleMethod("error"); +})(invariant || (invariant = {})); +// Code that uses ts-invariant with rollup-plugin-invariant may want to +// import this process stub to avoid errors evaluating process.env.NODE_ENV. +// However, because most ESM-to-CJS compilers will rewrite the process import +// as tsInvariant.process, which prevents proper replacement by minifiers, we +// also attempt to define the stub globally when it is not already defined. +exports.process = { env: {} }; +if (typeof process === "object") { + exports.process = process; +} +else + try { + // Using Function to evaluate this assignment in global scope also escapes + // the strict mode of the current module, thereby allowing the assignment. + // Inspired by https://github.com/facebook/regenerator/pull/369. + Function("stub", "process = stub")(exports.process); + } + catch (atLeastWeTried) { + // The assignment can fail if a Content Security Policy heavy-handedly + // forbids Function usage. In those environments, developers should take + // extra care to replace process.env.NODE_ENV in their production builds, + // or define an appropriate global.process polyfill. + } +var invariant$1 = invariant; + +exports.default = invariant$1; +exports.InvariantError = InvariantError; +exports.invariant = invariant; +//# sourceMappingURL=invariant.js.map diff --git a/node_modules/ts-invariant/lib/invariant.js.map b/node_modules/ts-invariant/lib/invariant.js.map new file mode 100644 index 000000000..4f451522f --- /dev/null +++ b/node_modules/ts-invariant/lib/invariant.js.map @@ -0,0 +1 @@ +{"version":3,"file":"invariant.js","sources":["invariant.esm.js"],"sourcesContent":["import { __extends } from 'tslib';\n\nvar genericMessage = \"Invariant Violation\";\r\nvar _a = Object.setPrototypeOf, setPrototypeOf = _a === void 0 ? function (obj, proto) {\r\n obj.__proto__ = proto;\r\n return obj;\r\n} : _a;\r\nvar InvariantError = /** @class */ (function (_super) {\r\n __extends(InvariantError, _super);\r\n function InvariantError(message) {\r\n if (message === void 0) { message = genericMessage; }\r\n var _this = _super.call(this, typeof message === \"number\"\r\n ? genericMessage + \": \" + message + \" (see https://github.com/apollographql/invariant-packages)\"\r\n : message) || this;\r\n _this.framesToPop = 1;\r\n _this.name = genericMessage;\r\n setPrototypeOf(_this, InvariantError.prototype);\r\n return _this;\r\n }\r\n return InvariantError;\r\n}(Error));\r\nfunction invariant(condition, message) {\r\n if (!condition) {\r\n throw new InvariantError(message);\r\n }\r\n}\r\nfunction wrapConsoleMethod(method) {\r\n return function () {\r\n return console[method].apply(console, arguments);\r\n };\r\n}\r\n(function (invariant) {\r\n invariant.warn = wrapConsoleMethod(\"warn\");\r\n invariant.error = wrapConsoleMethod(\"error\");\r\n})(invariant || (invariant = {}));\r\n// Code that uses ts-invariant with rollup-plugin-invariant may want to\r\n// import this process stub to avoid errors evaluating process.env.NODE_ENV.\r\n// However, because most ESM-to-CJS compilers will rewrite the process import\r\n// as tsInvariant.process, which prevents proper replacement by minifiers, we\r\n// also attempt to define the stub globally when it is not already defined.\r\nvar processStub = { env: {} };\r\nif (typeof process === \"object\") {\r\n processStub = process;\r\n}\r\nelse\r\n try {\r\n // Using Function to evaluate this assignment in global scope also escapes\r\n // the strict mode of the current module, thereby allowing the assignment.\r\n // Inspired by https://github.com/facebook/regenerator/pull/369.\r\n Function(\"stub\", \"process = stub\")(processStub);\r\n }\r\n catch (atLeastWeTried) {\r\n // The assignment can fail if a Content Security Policy heavy-handedly\r\n // forbids Function usage. In those environments, developers should take\r\n // extra care to replace process.env.NODE_ENV in their production builds,\r\n // or define an appropriate global.process polyfill.\r\n }\r\nvar invariant$1 = invariant;\n\nexport default invariant$1;\nexport { InvariantError, invariant, processStub as process };\n//# sourceMappingURL=invariant.esm.js.map\n"],"names":["__extends","processStub"],"mappings":";;;;;;AAEA,IAAI,cAAc,GAAG,qBAAqB,CAAC;AAC3C,IAAI,EAAE,GAAG,MAAM,CAAC,cAAc,EAAE,cAAc,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,EAAE,KAAK,EAAE;IACnF,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO,GAAG,CAAC;CACd,GAAG,EAAE,CAAC;AACP,AAAG,IAAC,cAAc,kBAAkB,UAAU,MAAM,EAAE;IAClDA,eAAS,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAClC,SAAS,cAAc,CAAC,OAAO,EAAE;QAC7B,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,cAAc,CAAC,EAAE;QACrD,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,OAAO,KAAK,QAAQ;cACnD,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,4DAA4D;cAC9F,OAAO,CAAC,IAAI,IAAI,CAAC;QACvB,KAAK,CAAC,WAAW,GAAG,CAAC,CAAC;QACtB,KAAK,CAAC,IAAI,GAAG,cAAc,CAAC;QAC5B,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,cAAc,CAAC;CACzB,CAAC,KAAK,CAAC,CAAC,CAAC;AACV,SAAS,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE;IACnC,IAAI,CAAC,SAAS,EAAE;QACZ,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;KACrC;CACJ;AACD,SAAS,iBAAiB,CAAC,MAAM,EAAE;IAC/B,OAAO,YAAY;QACf,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KACpD,CAAC;CACL;AACD,CAAC,UAAU,SAAS,EAAE;IAClB,SAAS,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC3C,SAAS,CAAC,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;CAChD,EAAE,SAAS,KAAK,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC;;;;;;AAMlC,AAAIC,eAAW,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;AAC9B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;IAC7BA,eAAW,GAAG,OAAO,CAAC;CACzB;;IAEG,IAAI;;;;QAIA,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAACA,eAAW,CAAC,CAAC;KACnD;IACD,OAAO,cAAc,EAAE;;;;;KAKtB;AACL,IAAI,WAAW,GAAG,SAAS,CAAC;;;;;;"} \ No newline at end of file diff --git a/node_modules/ts-invariant/package.json b/node_modules/ts-invariant/package.json new file mode 100644 index 000000000..9b072f00b --- /dev/null +++ b/node_modules/ts-invariant/package.json @@ -0,0 +1,41 @@ +{ + "name": "ts-invariant", + "version": "0.4.4", + "author": "Ben Newman ", + "description": "TypeScript implementation of invariant(condition, message)", + "license": "MIT", + "main": "lib/invariant.js", + "module": "lib/invariant.esm.js", + "types": "lib/invariant.d.ts", + "keywords": [ + "invariant", + "assertion", + "precondition", + "TypeScript" + ], + "homepage": "https://github.com/apollographql/invariant-packages", + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/invariant-packages.git" + }, + "bugs": { + "url": "https://github.com/apollographql/invariant-packages/issues" + }, + "scripts": { + "build": "tsc && rollup -c", + "mocha": "mocha --reporter spec --full-trace lib/tests.js", + "prepublish": "npm run build", + "test": "npm run build && npm run mocha" + }, + "dependencies": { + "tslib": "^1.9.3" + }, + "devDependencies": { + "@types/invariant": "^2.2.29", + "invariant": "^2.2.4", + "mocha": "^5.2.0", + "rollup": "^1.1.2", + "rollup-plugin-typescript2": "^0.19.2" + }, + "gitHead": "c83c2aeb7917b93751d17706d800a7ea16d8fe3e" +} diff --git a/node_modules/ts-invariant/rollup.config.js b/node_modules/ts-invariant/rollup.config.js new file mode 100644 index 000000000..97f09f441 --- /dev/null +++ b/node_modules/ts-invariant/rollup.config.js @@ -0,0 +1,40 @@ +import typescriptPlugin from 'rollup-plugin-typescript2'; +import typescript from 'typescript'; + +const globals = { + __proto__: null, + tslib: "tslib", +}; + +function external(id) { + return id in globals; +} + +export default [{ + input: "src/invariant.ts", + external, + output: { + file: "lib/invariant.esm.js", + format: "esm", + sourcemap: true, + globals, + }, + plugins: [ + typescriptPlugin({ + typescript, + tsconfig: "./tsconfig.rollup.json", + }), + ], +}, { + input: "lib/invariant.esm.js", + external, + output: { + // Intentionally overwrite the invariant.js file written by tsc: + file: "lib/invariant.js", + format: "cjs", + exports: "named", + sourcemap: true, + name: "ts-invariant", + globals, + }, +}]; diff --git a/node_modules/ts-invariant/tsconfig.json b/node_modules/ts-invariant/tsconfig.json new file mode 100644 index 000000000..1a79ad1e2 --- /dev/null +++ b/node_modules/ts-invariant/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + } +} diff --git a/node_modules/ts-invariant/tsconfig.rollup.json b/node_modules/ts-invariant/tsconfig.rollup.json new file mode 100644 index 000000000..02085be65 --- /dev/null +++ b/node_modules/ts-invariant/tsconfig.rollup.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "es2015", + }, +} diff --git a/node_modules/tslib/CopyrightNotice.txt b/node_modules/tslib/CopyrightNotice.txt new file mode 100644 index 000000000..884a03132 --- /dev/null +++ b/node_modules/tslib/CopyrightNotice.txt @@ -0,0 +1,15 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + diff --git a/node_modules/tslib/LICENSE.txt b/node_modules/tslib/LICENSE.txt new file mode 100644 index 000000000..edc24fd6e --- /dev/null +++ b/node_modules/tslib/LICENSE.txt @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/node_modules/tslib/README.md b/node_modules/tslib/README.md new file mode 100644 index 000000000..da2126517 --- /dev/null +++ b/node_modules/tslib/README.md @@ -0,0 +1,134 @@ +# tslib + +This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. + +This library is primarily used by the `--importHelpers` flag in TypeScript. +When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: + +```ts +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +exports.x = {}; +exports.y = __assign({}, exports.x); + +``` + +will instead be emitted as something like the following: + +```ts +var tslib_1 = require("tslib"); +exports.x = {}; +exports.y = tslib_1.__assign({}, exports.x); +``` + +Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. +For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. + +# Installing + +For the latest stable version, run: + +## npm + +```sh +# TypeScript 2.3.3 or later +npm install --save tslib + +# TypeScript 2.3.2 or earlier +npm install --save tslib@1.6.1 +``` + +## bower + +```sh +# TypeScript 2.3.3 or later +bower install tslib + +# TypeScript 2.3.2 or earlier +bower install tslib@1.6.1 +``` + +## JSPM + +```sh +# TypeScript 2.3.3 or later +jspm install tslib + +# TypeScript 2.3.2 or earlier +jspm install tslib@1.6.1 +``` + +# Usage + +Set the `importHelpers` compiler option on the command line: + +``` +tsc --importHelpers file.ts +``` + +or in your tsconfig.json: + +```json +{ + "compilerOptions": { + "importHelpers": true + } +} +``` + +#### For bower and JSPM users + +You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: + +```json +{ + "compilerOptions": { + "module": "amd", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["bower_components/tslib/tslib.d.ts"] + } + } +} +``` + +For JSPM users: + +```json +{ + "compilerOptions": { + "module": "system", + "importHelpers": true, + "baseUrl": "./", + "paths": { + "tslib" : ["jspm_packages/npm/tslib@1.10.0/tslib.d.ts"] + } + } +} +``` + + +# Contribute + +There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. + +* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. +* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). +* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). +* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. +* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). +* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)). + +# Documentation + +* [Quick tutorial](http://www.typescriptlang.org/Tutorial) +* [Programming handbook](http://www.typescriptlang.org/Handbook) +* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) +* [Homepage](http://www.typescriptlang.org/) diff --git a/node_modules/tslib/package.json b/node_modules/tslib/package.json new file mode 100644 index 000000000..8d7b92dd6 --- /dev/null +++ b/node_modules/tslib/package.json @@ -0,0 +1,28 @@ +{ + "name": "tslib", + "author": "Microsoft Corp.", + "homepage": "http://typescriptlang.org/", + "version": "1.10.0", + "license": "Apache-2.0", + "description": "Runtime library for TypeScript helper functions", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript", + "tslib", + "runtime" + ], + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/tslib.git" + }, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", + "typings": "tslib.d.ts" +} diff --git a/node_modules/tslib/tslib.d.ts b/node_modules/tslib/tslib.d.ts new file mode 100644 index 000000000..e5bfc963b --- /dev/null +++ b/node_modules/tslib/tslib.d.ts @@ -0,0 +1,34 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +export declare function __extends(d: Function, b: Function): void; +export declare function __assign(t: any, ...sources: any[]): any; +export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; +export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; +export declare function __param(paramIndex: number, decorator: Function): Function; +export declare function __metadata(metadataKey: any, metadataValue: any): Function; +export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; +export declare function __generator(thisArg: any, body: Function): any; +export declare function __exportStar(m: any, exports: any): void; +export declare function __values(o: any): any; +export declare function __read(o: any, n?: number): any[]; +export declare function __spread(...args: any[][]): any[]; +export declare function __spreadArrays(...args: any[][]): any[]; +export declare function __await(v: any): any; +export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; +export declare function __asyncDelegator(o: any): any; +export declare function __asyncValues(o: any): any; +export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; +export declare function __importStar(mod: T): T; +export declare function __importDefault(mod: T): T | { default: T }; diff --git a/node_modules/tslib/tslib.es6.html b/node_modules/tslib/tslib.es6.html new file mode 100644 index 000000000..b122e41b0 --- /dev/null +++ b/node_modules/tslib/tslib.es6.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/tslib/tslib.es6.js b/node_modules/tslib/tslib.es6.js new file mode 100644 index 000000000..4294ef285 --- /dev/null +++ b/node_modules/tslib/tslib.es6.js @@ -0,0 +1,196 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +export function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +export var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +export function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +export function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +export function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +export function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +export function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +export function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + 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; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +export function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +export function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +export function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +export function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +export function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +export function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +export function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +export function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +export function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +export function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +export function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +export function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} diff --git a/node_modules/tslib/tslib.html b/node_modules/tslib/tslib.html new file mode 100644 index 000000000..44c9ba51e --- /dev/null +++ b/node_modules/tslib/tslib.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/node_modules/tslib/tslib.js b/node_modules/tslib/tslib.js new file mode 100644 index 000000000..89f00d653 --- /dev/null +++ b/node_modules/tslib/tslib.js @@ -0,0 +1,255 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if (typeof module === "object" && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + __extends = function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + 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; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function (m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + }; + + __values = function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + __importStar = function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); +}); diff --git a/node_modules/zen-observable-ts/CHANGELOG.md b/node_modules/zen-observable-ts/CHANGELOG.md new file mode 100644 index 000000000..116b7d965 --- /dev/null +++ b/node_modules/zen-observable-ts/CHANGELOG.md @@ -0,0 +1,28 @@ +# Change log + +---- + +**NOTE:** This changelog is no longer maintained. Changes are now tracked in +the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). + +---- + +### 0.8.11 + +- No changes + +### 0.8.10 +- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
    + [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) + +### 0.8.9 +- fix to stop combining require and export [PR#559](https://github.com/apollographql/apollo-link/pull/559) + +### 0.8.8 +- revert to zen-observable 0.7 + +### 0.8.7 +- fixed typings + +### 0.8.6 +- initial publishing mirrors `zen-observable`'s versioning diff --git a/node_modules/zen-observable-ts/LICENSE b/node_modules/zen-observable-ts/LICENSE new file mode 100644 index 000000000..84df90591 --- /dev/null +++ b/node_modules/zen-observable-ts/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 zenparsing (Kevin Smith) +Copyright (c) 2016 - 2018 Meteor Development Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/zen-observable-ts/lib/bundle.cjs.js b/node_modules/zen-observable-ts/lib/bundle.cjs.js new file mode 100644 index 000000000..4edc07aff --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.cjs.js @@ -0,0 +1,13 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var zenObservable = _interopDefault(require('zen-observable')); + +var Observable = zenObservable; + +exports.Observable = Observable; +exports.default = Observable; +//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/zen-observable-ts/lib/bundle.cjs.js.map b/node_modules/zen-observable-ts/lib/bundle.cjs.js.map new file mode 100644 index 000000000..ab0a3c567 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import zenObservable from 'zen-observable';\n\nvar Observable = zenObservable;\n\nexport default Observable;\nexport { Observable };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":[],"mappings":";;;;;;;;AAEG,IAAC,UAAU,GAAG,aAAa;;;;;"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/bundle.esm.js b/node_modules/zen-observable-ts/lib/bundle.esm.js new file mode 100644 index 000000000..b00615b48 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.esm.js @@ -0,0 +1,7 @@ +import zenObservable from 'zen-observable'; + +var Observable = zenObservable; + +export default Observable; +export { Observable }; +//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/zen-observable-ts/lib/bundle.esm.js.map b/node_modules/zen-observable-ts/lib/bundle.esm.js.map new file mode 100644 index 000000000..da66441b0 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.esm.js","sources":["../src/zenObservable.ts"],"sourcesContent":["/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n"],"names":[],"mappings":";;IAgBa,UAAU,GAMd,aAAa;;;;;"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/bundle.umd.js b/node_modules/zen-observable-ts/lib/bundle.umd.js new file mode 100644 index 000000000..aa9ac0bed --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.umd.js @@ -0,0 +1,17 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('zen-observable')) : + typeof define === 'function' && define.amd ? define(['exports', 'zen-observable'], factory) : + (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.zenObservable = {}), global.Observable)); +}(this, function (exports, zenObservable) { 'use strict'; + + zenObservable = zenObservable && zenObservable.hasOwnProperty('default') ? zenObservable['default'] : zenObservable; + + var Observable = zenObservable; + + exports.Observable = Observable; + exports.default = Observable; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/zen-observable-ts/lib/bundle.umd.js.map b/node_modules/zen-observable-ts/lib/bundle.umd.js.map new file mode 100644 index 000000000..ba1521774 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/bundle.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.umd.js","sources":["../src/zenObservable.ts"],"sourcesContent":["/* tslint:disable */\n\nimport zenObservable from 'zen-observable';\n\nnamespace Observable {\n\n}\n\nimport { ZenObservable } from './types';\n\nexport { ZenObservable };\n\nexport type Observer = ZenObservable.Observer;\nexport type Subscriber = ZenObservable.Subscriber;\nexport type ObservableLike = ZenObservable.ObservableLike;\n\nexport const Observable: {\n new (subscriber: Subscriber): Observable;\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n} = zenObservable;\n\nexport interface Observable {\n subscribe(\n observerOrNext: ((value: T) => void) | ZenObservable.Observer,\n error?: (error: any) => void,\n complete?: () => void,\n ): ZenObservable.Subscription;\n\n forEach(fn: (value: T) => void): Promise;\n\n map(fn: (value: T) => R): Observable;\n\n filter(fn: (value: T) => boolean): Observable;\n\n reduce(\n fn: (previousValue: R | T, currentValue: T) => R | T,\n initialValue?: R | T,\n ): Observable;\n\n flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable;\n\n from(\n observable: Observable | ZenObservable.ObservableLike | ArrayLike,\n ): Observable;\n of(...args: Array): Observable;\n}\n"],"names":[],"mappings":";;;;;;;;MAgBa,UAAU,GAMd,aAAa;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/index.d.ts b/node_modules/zen-observable-ts/lib/index.d.ts new file mode 100644 index 000000000..6b55561e6 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/index.d.ts @@ -0,0 +1,4 @@ +import { Observable } from './zenObservable'; +export * from './zenObservable'; +export default Observable; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/index.d.ts.map b/node_modules/zen-observable-ts/lib/index.d.ts.map new file mode 100644 index 000000000..7f7917243 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAChC,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/index.js b/node_modules/zen-observable-ts/lib/index.js new file mode 100644 index 000000000..86761b086 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var zenObservable_1 = require("./zenObservable"); +tslib_1.__exportStar(require("./zenObservable"), exports); +exports.default = zenObservable_1.Observable; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/index.js.map b/node_modules/zen-observable-ts/lib/index.js.map new file mode 100644 index 000000000..c2112a7db --- /dev/null +++ b/node_modules/zen-observable-ts/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAE7C,0DAAgC;AAChC,kBAAe,0BAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/types.d.ts b/node_modules/zen-observable-ts/lib/types.d.ts new file mode 100644 index 000000000..80bfde6a3 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/types.d.ts @@ -0,0 +1,23 @@ +export declare namespace ZenObservable { + interface SubscriptionObserver { + closed: boolean; + next(value: T): void; + error(errorValue: any): void; + complete(): void; + } + interface Subscription { + closed: boolean; + unsubscribe(): void; + } + interface Observer { + start?(subscription: Subscription): any; + next?(value: T): void; + error?(errorValue: any): void; + complete?(): void; + } + type Subscriber = (observer: SubscriptionObserver) => void | (() => void) | Subscription; + interface ObservableLike { + subscribe?: Subscriber; + } +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/types.d.ts.map b/node_modules/zen-observable-ts/lib/types.d.ts.map new file mode 100644 index 000000000..1494bc534 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,oBAAoB,CAAC,CAAC;QACrC,MAAM,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QACrB,KAAK,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAAC;QAC7B,QAAQ,IAAI,IAAI,CAAC;KAClB;IAED,UAAiB,YAAY;QAC3B,MAAM,EAAE,OAAO,CAAC;QAChB,WAAW,IAAI,IAAI,CAAC;KACrB;IAED,UAAiB,QAAQ,CAAC,CAAC;QACzB,KAAK,CAAC,CAAC,YAAY,EAAE,YAAY,GAAG,GAAG,CAAC;QACxC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,CAAC,UAAU,EAAE,GAAG,GAAG,IAAI,CAAC;QAC9B,QAAQ,CAAC,IAAI,IAAI,CAAC;KACnB;IAED,KAAY,UAAU,CAAC,CAAC,IAAI,CAC1B,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAC9B,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,YAAY,CAAC;IAExC,UAAiB,cAAc,CAAC,CAAC;QAC/B,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;KAC3B;CACF"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/types.js b/node_modules/zen-observable-ts/lib/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/zen-observable-ts/lib/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/types.js.map b/node_modules/zen-observable-ts/lib/types.js.map new file mode 100644 index 000000000..c768b7900 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/zenObservable.d.ts b/node_modules/zen-observable-ts/lib/zenObservable.d.ts new file mode 100644 index 000000000..2142733fb --- /dev/null +++ b/node_modules/zen-observable-ts/lib/zenObservable.d.ts @@ -0,0 +1,21 @@ +import { ZenObservable } from './types'; +export { ZenObservable }; +export declare type Observer = ZenObservable.Observer; +export declare type Subscriber = ZenObservable.Subscriber; +export declare type ObservableLike = ZenObservable.ObservableLike; +export declare const Observable: { + new (subscriber: Subscriber): Observable; + from(observable: Observable | ZenObservable.ObservableLike | ArrayLike): Observable; + of(...args: Array): Observable; +}; +export interface Observable { + subscribe(observerOrNext: ((value: T) => void) | ZenObservable.Observer, error?: (error: any) => void, complete?: () => void): ZenObservable.Subscription; + forEach(fn: (value: T) => void): Promise; + map(fn: (value: T) => R): Observable; + filter(fn: (value: T) => boolean): Observable; + reduce(fn: (previousValue: R | T, currentValue: T) => R | T, initialValue?: R | T): Observable; + flatMap(fn: (value: T) => ZenObservable.ObservableLike): Observable; + from(observable: Observable | ZenObservable.ObservableLike | ArrayLike): Observable; + of(...args: Array): Observable; +} +//# sourceMappingURL=zenObservable.d.ts.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map b/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map new file mode 100644 index 000000000..54855d1e4 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"zenObservable.d.ts","sourceRoot":"","sources":["src/zenObservable.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,oBAAY,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACpD,oBAAY,UAAU,CAAC,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACxD,oBAAY,cAAc,CAAC,CAAC,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEhE,eAAO,MAAM,UAAU,EAAE;IACvB,KAAK,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,CAAC,CAAC,EACJ,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GACzE,UAAU,CAAC,CAAC,CAAC,CAAC;IACjB,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;CACpB,CAAC;AAEvB,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,SAAS,CACP,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAChE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAC5B,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,aAAa,CAAC,YAAY,CAAC;IAE9B,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAE3C,MAAM,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,CAAC,GAAG,CAAC,EACV,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EACpD,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GACnB,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAErB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAE7E,IAAI,CAAC,CAAC,EACJ,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GACzE,UAAU,CAAC,CAAC,CAAC,CAAC;IACjB,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;CACzC"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/zenObservable.js b/node_modules/zen-observable-ts/lib/zenObservable.js new file mode 100644 index 000000000..747d83d23 --- /dev/null +++ b/node_modules/zen-observable-ts/lib/zenObservable.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var zen_observable_1 = tslib_1.__importDefault(require("zen-observable")); +exports.Observable = zen_observable_1.default; +//# sourceMappingURL=zenObservable.js.map \ No newline at end of file diff --git a/node_modules/zen-observable-ts/lib/zenObservable.js.map b/node_modules/zen-observable-ts/lib/zenObservable.js.map new file mode 100644 index 000000000..86e8589de --- /dev/null +++ b/node_modules/zen-observable-ts/lib/zenObservable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"zenObservable.js","sourceRoot":"","sources":["../src/zenObservable.ts"],"names":[],"mappings":";;;AAEA,0EAA2C;AAc9B,QAAA,UAAU,GAMd,wBAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/zen-observable-ts/package.json b/node_modules/zen-observable-ts/package.json new file mode 100644 index 000000000..8f0bda947 --- /dev/null +++ b/node_modules/zen-observable-ts/package.json @@ -0,0 +1,58 @@ +{ + "name": "zen-observable-ts", + "version": "0.8.19", + "description": "An Implementation of ES Observables in Typescript", + "author": "Evans Hauser ", + "contributors": [], + "license": "MIT", + "main": "./lib/index.js", + "module": "./lib/bundle.esm.js", + "typings": "./lib/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "git+https://github.com/apollographql/apollo-link.git" + }, + "bugs": { + "url": "https://github.com/apollographql/apollo-link/issues" + }, + "homepage": "https://github.com/zenparsing/zen-observable", + "scripts": { + "build": "tsc && rollup -c", + "clean": "rimraf lib/* && rimraf coverage/*", + "coverage": "jest --coverage", + "filesize": "../../scripts/minify", + "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", + "prebuild": "npm run clean", + "prepare": "npm run build", + "test": "npm run lint && jest", + "watch": "tsc -w -p ." + }, + "devDependencies": { + "@types/jest": "24.0.14", + "jest": "24.8.0", + "rimraf": "2.6.3", + "rollup": "1.15.4", + "ts-jest": "22.4.6", + "tslint": "5.17.0", + "typescript": "3.0.3" + }, + "jest": { + "transform": { + ".(ts|tsx)": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ], + "testURL": "http://localhost" + }, + "dependencies": { + "tslib": "^1.9.3", + "zen-observable": "^0.8.0" + }, + "gitHead": "f902ab977d7d173951528a0bc2e38521b2afc096" +} diff --git a/node_modules/zen-observable/.editorconfig b/node_modules/zen-observable/.editorconfig new file mode 100644 index 000000000..d4eed8406 --- /dev/null +++ b/node_modules/zen-observable/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +indent_size = 2 diff --git a/node_modules/zen-observable/.eslintrc.js b/node_modules/zen-observable/.eslintrc.js new file mode 100644 index 000000000..3def7dc80 --- /dev/null +++ b/node_modules/zen-observable/.eslintrc.js @@ -0,0 +1,47 @@ +module.exports = { + "extends": ["eslint:recommended"], + + "env": { + "es6": true, + "node": true + }, + + "globals": { + "setTimeout": true + }, + + "parserOptions": { + "sourceType": "module" + }, + + "rules": { + "no-console": ["error", { "allow": ["warn", "error"] }], + "no-unsafe-finally": ["off"], + "camelcase": ["error", { "properties": "always" }], + "brace-style": ["off"], + "eqeqeq": ["error", "smart"], + "indent": ["error", 2, { "SwitchCase": 1 }], + "no-throw-literal": ["error"], + "comma-spacing": ["error", { "before": false, "after": true }], + "comma-style": ["error", "last"], + "comma-dangle": ["error", "always-multiline"], + "keyword-spacing": ["error"], + "no-trailing-spaces": ["error"], + "no-multi-spaces": ["error"], + "no-spaced-func": ["error"], + "no-whitespace-before-property": ["error"], + "space-before-blocks": ["error"], + "space-before-function-paren": ["error", "never"], + "space-in-parens": ["error", "never"], + "eol-last": ["error"], + "quotes": ["error", "single", { "avoidEscape": true }], + "no-implicit-globals": ["error"], + "no-useless-concat": ["error"], + "space-infix-ops": ["error", { "int32Hint": true }], + "semi-spacing": ["error", { "before": false, "after": true }], + "semi": ["error", "always", { "omitLastInOneLineBlock": true }], + "object-curly-spacing": ["error", "always"], + "array-bracket-spacing": ["error"], + "max-len": ["error", 100] + } +}; diff --git a/node_modules/zen-observable/LICENSE b/node_modules/zen-observable/LICENSE new file mode 100644 index 000000000..d850f5272 --- /dev/null +++ b/node_modules/zen-observable/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2018 zenparsing (Kevin Smith) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/zen-observable/README.md b/node_modules/zen-observable/README.md new file mode 100644 index 000000000..eff7a5c56 --- /dev/null +++ b/node_modules/zen-observable/README.md @@ -0,0 +1,176 @@ +# zen-observable + +An implementation of Observables for JavaScript. Requires Promises or a Promise polyfill. + +## Install + +```sh +npm install zen-observable +``` + +## Usage + +```js +import Observable from 'zen-observable'; + +Observable.of(1, 2, 3).subscribe(x => console.log(x)); +``` + +## API + +### new Observable(subscribe) + +```js +let observable = new Observable(observer => { + // Emit a single value after 1 second + let timer = setTimeout(() => { + observer.next('hello'); + observer.complete(); + }, 1000); + + // On unsubscription, cancel the timer + return () => clearTimeout(timer); +}); +``` + +Creates a new Observable object using the specified subscriber function. The subscriber function is called whenever the `subscribe` method of the observable object is invoked. The subscriber function is passed an *observer* object which has the following methods: + +- `next(value)` Sends the next value in the sequence. +- `error(exception)` Terminates the sequence with an exception. +- `complete()` Terminates the sequence successfully. +- `closed` A boolean property whose value is `true` if the observer's subscription is closed. + +The subscriber function can optionally return either a cleanup function or a subscription object. If it returns a cleanup function, that function will be called when the subscription has closed. If it returns a subscription object, then the subscription's `unsubscribe` method will be invoked when the subscription has closed. + +### Observable.of(...items) + +```js +// Logs 1, 2, 3 +Observable.of(1, 2, 3).subscribe(x => { + console.log(x); +}); +``` + +Returns an observable which will emit each supplied argument. + +### Observable.from(value) + +```js +let list = [1, 2, 3]; + +// Iterate over an object +Observable.from(list).subscribe(x => { + console.log(x); +}); +``` + +```js +// Convert something 'observable' to an Observable instance +Observable.from(otherObservable).subscribe(x => { + console.log(x); +}); +``` + +Converts `value` to an Observable. + +- If `value` is an implementation of Observable, then it is converted to an instance of Observable as defined by this library. +- Otherwise, it is converted to an Observable which synchronously iterates over `value`. + +### observable.subscribe([observer]) + +```js +let subscription = observable.subscribe({ + next(x) { console.log(x) }, + error(err) { console.log(`Finished with error: ${ err }`) }, + complete() { console.log('Finished') } +}); +``` + +Subscribes to the observable. Observer objects may have any of the following methods: + +- `next(value)` Receives the next value of the sequence. +- `error(exception)` Receives the terminating error of the sequence. +- `complete()` Called when the stream has completed successfully. + +Returns a subscription object that can be used to cancel the stream. + +### observable.subscribe(nextCallback[, errorCallback, completeCallback]) + +```js +let subscription = observable.subscribe( + x => console.log(x), + err => console.log(`Finished with error: ${ err }`), + () => console.log('Finished') +); +``` + +Subscribes to the observable with callback functions. Returns a subscription object that can be used to cancel the stream. + +### observable.forEach(callback) + +```js +observable.forEach(x => { + console.log(`Received value: ${ x }`); +}).then(() => { + console.log('Finished successfully') +}).catch(err => { + console.log(`Finished with error: ${ err }`); +}) +``` + +Subscribes to the observable and returns a Promise for the completion value of the stream. The `callback` argument is called once for each value in the stream. + +### observable.filter(callback) + +```js +Observable.of(1, 2, 3).filter(value => { + return value > 2; +}).subscribe(value => { + console.log(value); +}); +// 3 +``` + +Returns a new Observable that emits all values which pass the test implemented by the `callback` argument. + +### observable.map(callback) + +Returns a new Observable that emits the results of calling the `callback` argument for every value in the stream. + +```js +Observable.of(1, 2, 3).map(value => { + return value * 2; +}).subscribe(value => { + console.log(value); +}); +// 2 +// 4 +// 6 +``` + +### observable.reduce(callback [,initialValue]) + +```js +Observable.of(0, 1, 2, 3, 4).reduce((previousValue, currentValue) => { + return previousValue + currentValue; +}).subscribe(result => { + console.log(result); +}); +// 10 +``` + +Returns a new Observable that applies a function against an accumulator and each value of the stream to reduce it to a single value. + +### observable.concat(...sources) + +```js +Observable.of(1, 2, 3).concat( + Observable.of(4, 5, 6), + Observable.of(7, 8, 9) +).subscribe(result => { + console.log(result); +}); +// 1, 2, 3, 4, 5, 6, 7, 8, 9 +``` + +Merges the current observable with additional observables. diff --git a/node_modules/zen-observable/extras.js b/node_modules/zen-observable/extras.js new file mode 100644 index 000000000..ab87de364 --- /dev/null +++ b/node_modules/zen-observable/extras.js @@ -0,0 +1 @@ +module.exports = require('./lib/extras.js'); diff --git a/node_modules/zen-observable/index.js b/node_modules/zen-observable/index.js new file mode 100644 index 000000000..25c8a63c3 --- /dev/null +++ b/node_modules/zen-observable/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/Observable.js').Observable; diff --git a/node_modules/zen-observable/lib/Observable.js b/node_modules/zen-observable/lib/Observable.js new file mode 100644 index 000000000..952d3d785 --- /dev/null +++ b/node_modules/zen-observable/lib/Observable.js @@ -0,0 +1,610 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// === Symbol Support === + +var hasSymbols = function () { + return typeof Symbol === 'function'; +}; +var hasSymbol = function (name) { + return hasSymbols() && Boolean(Symbol[name]); +}; +var getSymbol = function (name) { + return hasSymbol(name) ? Symbol[name] : '@@' + name; +}; + +if (hasSymbols() && !hasSymbol('observable')) { + Symbol.observable = Symbol('observable'); +} + +var SymbolIterator = getSymbol('iterator'); +var SymbolObservable = getSymbol('observable'); +var SymbolSpecies = getSymbol('species'); + +// === Abstract Operations === + +function getMethod(obj, key) { + var value = obj[key]; + + if (value == null) return undefined; + + if (typeof value !== 'function') throw new TypeError(value + ' is not a function'); + + return value; +} + +function getSpecies(obj) { + var ctor = obj.constructor; + if (ctor !== undefined) { + ctor = ctor[SymbolSpecies]; + if (ctor === null) { + ctor = undefined; + } + } + return ctor !== undefined ? ctor : Observable; +} + +function isObservable(x) { + return x instanceof Observable; // SPEC: Brand check +} + +function hostReportError(e) { + if (hostReportError.log) { + hostReportError.log(e); + } else { + setTimeout(function () { + throw e; + }); + } +} + +function enqueue(fn) { + Promise.resolve().then(function () { + try { + fn(); + } catch (e) { + hostReportError(e); + } + }); +} + +function cleanupSubscription(subscription) { + var cleanup = subscription._cleanup; + if (cleanup === undefined) return; + + subscription._cleanup = undefined; + + if (!cleanup) { + return; + } + + try { + if (typeof cleanup === 'function') { + cleanup(); + } else { + var unsubscribe = getMethod(cleanup, 'unsubscribe'); + if (unsubscribe) { + unsubscribe.call(cleanup); + } + } + } catch (e) { + hostReportError(e); + } +} + +function closeSubscription(subscription) { + subscription._observer = undefined; + subscription._queue = undefined; + subscription._state = 'closed'; +} + +function flushSubscription(subscription) { + var queue = subscription._queue; + if (!queue) { + return; + } + subscription._queue = undefined; + subscription._state = 'ready'; + for (var i = 0; i < queue.length; ++i) { + notifySubscription(subscription, queue[i].type, queue[i].value); + if (subscription._state === 'closed') break; + } +} + +function notifySubscription(subscription, type, value) { + subscription._state = 'running'; + + var observer = subscription._observer; + + try { + var m = getMethod(observer, type); + switch (type) { + case 'next': + if (m) m.call(observer, value); + break; + case 'error': + closeSubscription(subscription); + if (m) m.call(observer, value);else throw value; + break; + case 'complete': + closeSubscription(subscription); + if (m) m.call(observer); + break; + } + } catch (e) { + hostReportError(e); + } + + if (subscription._state === 'closed') cleanupSubscription(subscription);else if (subscription._state === 'running') subscription._state = 'ready'; +} + +function onNotify(subscription, type, value) { + if (subscription._state === 'closed') return; + + if (subscription._state === 'buffering') { + subscription._queue.push({ type: type, value: value }); + return; + } + + if (subscription._state !== 'ready') { + subscription._state = 'buffering'; + subscription._queue = [{ type: type, value: value }]; + enqueue(function () { + return flushSubscription(subscription); + }); + return; + } + + notifySubscription(subscription, type, value); +} + +var Subscription = function () { + function Subscription(observer, subscriber) { + _classCallCheck(this, Subscription); + + // ASSERT: observer is an object + // ASSERT: subscriber is callable + + this._cleanup = undefined; + this._observer = observer; + this._queue = undefined; + this._state = 'initializing'; + + var subscriptionObserver = new SubscriptionObserver(this); + + try { + this._cleanup = subscriber.call(undefined, subscriptionObserver); + } catch (e) { + subscriptionObserver.error(e); + } + + if (this._state === 'initializing') this._state = 'ready'; + } + + _createClass(Subscription, [{ + key: 'unsubscribe', + value: function unsubscribe() { + if (this._state !== 'closed') { + closeSubscription(this); + cleanupSubscription(this); + } + } + }, { + key: 'closed', + get: function () { + return this._state === 'closed'; + } + }]); + + return Subscription; +}(); + +var SubscriptionObserver = function () { + function SubscriptionObserver(subscription) { + _classCallCheck(this, SubscriptionObserver); + + this._subscription = subscription; + } + + _createClass(SubscriptionObserver, [{ + key: 'next', + value: function next(value) { + onNotify(this._subscription, 'next', value); + } + }, { + key: 'error', + value: function error(value) { + onNotify(this._subscription, 'error', value); + } + }, { + key: 'complete', + value: function complete() { + onNotify(this._subscription, 'complete'); + } + }, { + key: 'closed', + get: function () { + return this._subscription._state === 'closed'; + } + }]); + + return SubscriptionObserver; +}(); + +var Observable = exports.Observable = function () { + function Observable(subscriber) { + _classCallCheck(this, Observable); + + if (!(this instanceof Observable)) throw new TypeError('Observable cannot be called as a function'); + + if (typeof subscriber !== 'function') throw new TypeError('Observable initializer must be a function'); + + this._subscriber = subscriber; + } + + _createClass(Observable, [{ + key: 'subscribe', + value: function subscribe(observer) { + if (typeof observer !== 'object' || observer === null) { + observer = { + next: observer, + error: arguments[1], + complete: arguments[2] + }; + } + return new Subscription(observer, this._subscriber); + } + }, { + key: 'forEach', + value: function forEach(fn) { + var _this = this; + + return new Promise(function (resolve, reject) { + if (typeof fn !== 'function') { + reject(new TypeError(fn + ' is not a function')); + return; + } + + function done() { + subscription.unsubscribe(); + resolve(); + } + + var subscription = _this.subscribe({ + next: function (value) { + try { + fn(value, done); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + + error: reject, + complete: resolve + }); + }); + } + }, { + key: 'map', + value: function map(fn) { + var _this2 = this; + + if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); + + var C = getSpecies(this); + + return new C(function (observer) { + return _this2.subscribe({ + next: function (value) { + try { + value = fn(value); + } catch (e) { + return observer.error(e); + } + observer.next(value); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + observer.complete(); + } + }); + }); + } + }, { + key: 'filter', + value: function filter(fn) { + var _this3 = this; + + if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); + + var C = getSpecies(this); + + return new C(function (observer) { + return _this3.subscribe({ + next: function (value) { + try { + if (!fn(value)) return; + } catch (e) { + return observer.error(e); + } + observer.next(value); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + observer.complete(); + } + }); + }); + } + }, { + key: 'reduce', + value: function reduce(fn) { + var _this4 = this; + + if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); + + var C = getSpecies(this); + var hasSeed = arguments.length > 1; + var hasValue = false; + var seed = arguments[1]; + var acc = seed; + + return new C(function (observer) { + return _this4.subscribe({ + next: function (value) { + var first = !hasValue; + hasValue = true; + + if (!first || hasSeed) { + try { + acc = fn(acc, value); + } catch (e) { + return observer.error(e); + } + } else { + acc = value; + } + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + if (!hasValue && !hasSeed) return observer.error(new TypeError('Cannot reduce an empty sequence')); + + observer.next(acc); + observer.complete(); + } + }); + }); + } + }, { + key: 'concat', + value: function concat() { + var _this5 = this; + + for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) { + sources[_key] = arguments[_key]; + } + + var C = getSpecies(this); + + return new C(function (observer) { + var subscription = void 0; + var index = 0; + + function startNext(next) { + subscription = next.subscribe({ + next: function (v) { + observer.next(v); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + if (index === sources.length) { + subscription = undefined; + observer.complete(); + } else { + startNext(C.from(sources[index++])); + } + } + }); + } + + startNext(_this5); + + return function () { + if (subscription) { + subscription.unsubscribe(); + subscription = undefined; + } + }; + }); + } + }, { + key: 'flatMap', + value: function flatMap(fn) { + var _this6 = this; + + if (typeof fn !== 'function') throw new TypeError(fn + ' is not a function'); + + var C = getSpecies(this); + + return new C(function (observer) { + var subscriptions = []; + + var outer = _this6.subscribe({ + next: function (value) { + if (fn) { + try { + value = fn(value); + } catch (e) { + return observer.error(e); + } + } + + var inner = C.from(value).subscribe({ + next: function (value) { + observer.next(value); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + var i = subscriptions.indexOf(inner); + if (i >= 0) subscriptions.splice(i, 1); + completeIfDone(); + } + }); + + subscriptions.push(inner); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + completeIfDone(); + } + }); + + function completeIfDone() { + if (outer.closed && subscriptions.length === 0) observer.complete(); + } + + return function () { + subscriptions.forEach(function (s) { + return s.unsubscribe(); + }); + outer.unsubscribe(); + }; + }); + } + }, { + key: SymbolObservable, + value: function () { + return this; + } + }], [{ + key: 'from', + value: function from(x) { + var C = typeof this === 'function' ? this : Observable; + + if (x == null) throw new TypeError(x + ' is not an object'); + + var method = getMethod(x, SymbolObservable); + if (method) { + var observable = method.call(x); + + if (Object(observable) !== observable) throw new TypeError(observable + ' is not an object'); + + if (isObservable(observable) && observable.constructor === C) return observable; + + return new C(function (observer) { + return observable.subscribe(observer); + }); + } + + if (hasSymbol('iterator')) { + method = getMethod(x, SymbolIterator); + if (method) { + return new C(function (observer) { + enqueue(function () { + if (observer.closed) return; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = method.call(x)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var item = _step.value; + + observer.next(item); + if (observer.closed) return; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + observer.complete(); + }); + }); + } + } + + if (Array.isArray(x)) { + return new C(function (observer) { + enqueue(function () { + if (observer.closed) return; + for (var i = 0; i < x.length; ++i) { + observer.next(x[i]); + if (observer.closed) return; + } + observer.complete(); + }); + }); + } + + throw new TypeError(x + ' is not observable'); + } + }, { + key: 'of', + value: function of() { + for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + items[_key2] = arguments[_key2]; + } + + var C = typeof this === 'function' ? this : Observable; + + return new C(function (observer) { + enqueue(function () { + if (observer.closed) return; + for (var i = 0; i < items.length; ++i) { + observer.next(items[i]); + if (observer.closed) return; + } + observer.complete(); + }); + }); + } + }, { + key: SymbolSpecies, + get: function () { + return this; + } + }]); + + return Observable; +}(); + +if (hasSymbols()) { + Object.defineProperty(Observable, Symbol('extensions'), { + value: { + symbol: SymbolObservable, + hostReportError: hostReportError + }, + configurable: true + }); +} \ No newline at end of file diff --git a/node_modules/zen-observable/lib/extras.js b/node_modules/zen-observable/lib/extras.js new file mode 100644 index 000000000..42a2eecf4 --- /dev/null +++ b/node_modules/zen-observable/lib/extras.js @@ -0,0 +1,140 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.merge = merge; +exports.combineLatest = combineLatest; +exports.zip = zip; + +var _Observable = require('./Observable.js'); + +// Emits all values from all inputs in parallel +function merge() { + for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) { + sources[_key] = arguments[_key]; + } + + return new _Observable.Observable(function (observer) { + if (sources.length === 0) return _Observable.Observable.from([]); + + var count = sources.length; + + var subscriptions = sources.map(function (source) { + return _Observable.Observable.from(source).subscribe({ + next: function (v) { + observer.next(v); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + if (--count === 0) observer.complete(); + } + }); + }); + + return function () { + return subscriptions.forEach(function (s) { + return s.unsubscribe(); + }); + }; + }); +} + +// Emits arrays containing the most current values from each input +function combineLatest() { + for (var _len2 = arguments.length, sources = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + sources[_key2] = arguments[_key2]; + } + + return new _Observable.Observable(function (observer) { + if (sources.length === 0) return _Observable.Observable.from([]); + + var count = sources.length; + var seen = new Set(); + var seenAll = false; + var values = sources.map(function () { + return undefined; + }); + + var subscriptions = sources.map(function (source, index) { + return _Observable.Observable.from(source).subscribe({ + next: function (v) { + values[index] = v; + + if (!seenAll) { + seen.add(index); + if (seen.size !== sources.length) return; + + seen = null; + seenAll = true; + } + + observer.next(Array.from(values)); + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + if (--count === 0) observer.complete(); + } + }); + }); + + return function () { + return subscriptions.forEach(function (s) { + return s.unsubscribe(); + }); + }; + }); +} + +// Emits arrays containing the matching index values from each input +function zip() { + for (var _len3 = arguments.length, sources = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + sources[_key3] = arguments[_key3]; + } + + return new _Observable.Observable(function (observer) { + if (sources.length === 0) return _Observable.Observable.from([]); + + var queues = sources.map(function () { + return []; + }); + + function done() { + return queues.some(function (q, i) { + return q.length === 0 && subscriptions[i].closed; + }); + } + + var subscriptions = sources.map(function (source, index) { + return _Observable.Observable.from(source).subscribe({ + next: function (v) { + queues[index].push(v); + if (queues.every(function (q) { + return q.length > 0; + })) { + observer.next(queues.map(function (q) { + return q.shift(); + })); + if (done()) observer.complete(); + } + }, + error: function (e) { + observer.error(e); + }, + complete: function () { + if (done()) observer.complete(); + } + }); + }); + + return function () { + return subscriptions.forEach(function (s) { + return s.unsubscribe(); + }); + }; + }); +} \ No newline at end of file diff --git a/node_modules/zen-observable/package.json b/node_modules/zen-observable/package.json new file mode 100644 index 000000000..2024f73d0 --- /dev/null +++ b/node_modules/zen-observable/package.json @@ -0,0 +1,21 @@ +{ + "name": "zen-observable", + "version": "0.8.14", + "repository": "zenparsing/zen-observable", + "description": "An Implementation of ES Observables", + "homepage": "https://github.com/zenparsing/zen-observable", + "license": "MIT", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "eslint": "^5.16.0", + "mocha": "^6.1.2" + }, + "dependencies": {}, + "scripts": { + "test": "mocha --recursive --require ./scripts/mocha-require", + "lint": "eslint src/*", + "build": "git clean -dfX ./lib && node ./scripts/build", + "prepublishOnly": "eslint src/* && npm test && npm run build" + } +} diff --git a/node_modules/zen-observable/scripts/babel-plugins.js b/node_modules/zen-observable/scripts/babel-plugins.js new file mode 100644 index 000000000..144266cd8 --- /dev/null +++ b/node_modules/zen-observable/scripts/babel-plugins.js @@ -0,0 +1,16 @@ +module.exports = [ + 'transform-es2015-arrow-functions', + 'transform-es2015-block-scoped-functions', + 'transform-es2015-block-scoping', + 'transform-es2015-classes', + 'transform-es2015-computed-properties', + 'transform-es2015-destructuring', + 'transform-es2015-duplicate-keys', + 'transform-es2015-for-of', + 'transform-es2015-literals', + 'transform-es2015-modules-commonjs', + 'transform-es2015-parameters', + 'transform-es2015-shorthand-properties', + 'transform-es2015-spread', + 'transform-es2015-template-literals', +]; diff --git a/node_modules/zen-observable/scripts/build.js b/node_modules/zen-observable/scripts/build.js new file mode 100644 index 000000000..f4c8fa638 --- /dev/null +++ b/node_modules/zen-observable/scripts/build.js @@ -0,0 +1,7 @@ +const { execSync } = require('child_process'); +const plugins = require('./babel-plugins'); + +execSync('babel src --out-dir lib --plugins=' + plugins.join(','), { + env: process.env, + stdio: 'inherit', +}); diff --git a/node_modules/zen-observable/scripts/mocha-require.js b/node_modules/zen-observable/scripts/mocha-require.js new file mode 100644 index 000000000..c93f68ccf --- /dev/null +++ b/node_modules/zen-observable/scripts/mocha-require.js @@ -0,0 +1,3 @@ +require('babel-core/register')({ + plugins: require('./babel-plugins'), +}); diff --git a/node_modules/zen-observable/src/Observable.js b/node_modules/zen-observable/src/Observable.js new file mode 100644 index 000000000..9364bc0aa --- /dev/null +++ b/node_modules/zen-observable/src/Observable.js @@ -0,0 +1,476 @@ +// === Symbol Support === + +const hasSymbols = () => typeof Symbol === 'function'; +const hasSymbol = name => hasSymbols() && Boolean(Symbol[name]); +const getSymbol = name => hasSymbol(name) ? Symbol[name] : '@@' + name; + +if (hasSymbols() && !hasSymbol('observable')) { + Symbol.observable = Symbol('observable'); +} + +const SymbolIterator = getSymbol('iterator'); +const SymbolObservable = getSymbol('observable'); +const SymbolSpecies = getSymbol('species'); + +// === Abstract Operations === + +function getMethod(obj, key) { + let value = obj[key]; + + if (value == null) + return undefined; + + if (typeof value !== 'function') + throw new TypeError(value + ' is not a function'); + + return value; +} + +function getSpecies(obj) { + let ctor = obj.constructor; + if (ctor !== undefined) { + ctor = ctor[SymbolSpecies]; + if (ctor === null) { + ctor = undefined; + } + } + return ctor !== undefined ? ctor : Observable; +} + +function isObservable(x) { + return x instanceof Observable; // SPEC: Brand check +} + +function hostReportError(e) { + if (hostReportError.log) { + hostReportError.log(e); + } else { + setTimeout(() => { throw e }); + } +} + +function enqueue(fn) { + Promise.resolve().then(() => { + try { fn() } + catch (e) { hostReportError(e) } + }); +} + +function cleanupSubscription(subscription) { + let cleanup = subscription._cleanup; + if (cleanup === undefined) + return; + + subscription._cleanup = undefined; + + if (!cleanup) { + return; + } + + try { + if (typeof cleanup === 'function') { + cleanup(); + } else { + let unsubscribe = getMethod(cleanup, 'unsubscribe'); + if (unsubscribe) { + unsubscribe.call(cleanup); + } + } + } catch (e) { + hostReportError(e); + } +} + +function closeSubscription(subscription) { + subscription._observer = undefined; + subscription._queue = undefined; + subscription._state = 'closed'; +} + +function flushSubscription(subscription) { + let queue = subscription._queue; + if (!queue) { + return; + } + subscription._queue = undefined; + subscription._state = 'ready'; + for (let i = 0; i < queue.length; ++i) { + notifySubscription(subscription, queue[i].type, queue[i].value); + if (subscription._state === 'closed') + break; + } +} + +function notifySubscription(subscription, type, value) { + subscription._state = 'running'; + + let observer = subscription._observer; + + try { + let m = getMethod(observer, type); + switch (type) { + case 'next': + if (m) m.call(observer, value); + break; + case 'error': + closeSubscription(subscription); + if (m) m.call(observer, value); + else throw value; + break; + case 'complete': + closeSubscription(subscription); + if (m) m.call(observer); + break; + } + } catch (e) { + hostReportError(e); + } + + if (subscription._state === 'closed') + cleanupSubscription(subscription); + else if (subscription._state === 'running') + subscription._state = 'ready'; +} + +function onNotify(subscription, type, value) { + if (subscription._state === 'closed') + return; + + if (subscription._state === 'buffering') { + subscription._queue.push({ type, value }); + return; + } + + if (subscription._state !== 'ready') { + subscription._state = 'buffering'; + subscription._queue = [{ type, value }]; + enqueue(() => flushSubscription(subscription)); + return; + } + + notifySubscription(subscription, type, value); +} + + +class Subscription { + + constructor(observer, subscriber) { + // ASSERT: observer is an object + // ASSERT: subscriber is callable + + this._cleanup = undefined; + this._observer = observer; + this._queue = undefined; + this._state = 'initializing'; + + let subscriptionObserver = new SubscriptionObserver(this); + + try { + this._cleanup = subscriber.call(undefined, subscriptionObserver); + } catch (e) { + subscriptionObserver.error(e); + } + + if (this._state === 'initializing') + this._state = 'ready'; + } + + get closed() { + return this._state === 'closed'; + } + + unsubscribe() { + if (this._state !== 'closed') { + closeSubscription(this); + cleanupSubscription(this); + } + } +} + +class SubscriptionObserver { + constructor(subscription) { this._subscription = subscription } + get closed() { return this._subscription._state === 'closed' } + next(value) { onNotify(this._subscription, 'next', value) } + error(value) { onNotify(this._subscription, 'error', value) } + complete() { onNotify(this._subscription, 'complete') } +} + +export class Observable { + + constructor(subscriber) { + if (!(this instanceof Observable)) + throw new TypeError('Observable cannot be called as a function'); + + if (typeof subscriber !== 'function') + throw new TypeError('Observable initializer must be a function'); + + this._subscriber = subscriber; + } + + subscribe(observer) { + if (typeof observer !== 'object' || observer === null) { + observer = { + next: observer, + error: arguments[1], + complete: arguments[2], + }; + } + return new Subscription(observer, this._subscriber); + } + + forEach(fn) { + return new Promise((resolve, reject) => { + if (typeof fn !== 'function') { + reject(new TypeError(fn + ' is not a function')); + return; + } + + function done() { + subscription.unsubscribe(); + resolve(); + } + + let subscription = this.subscribe({ + next(value) { + try { + fn(value, done); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve, + }); + }); + } + + map(fn) { + if (typeof fn !== 'function') + throw new TypeError(fn + ' is not a function'); + + let C = getSpecies(this); + + return new C(observer => this.subscribe({ + next(value) { + try { value = fn(value) } + catch (e) { return observer.error(e) } + observer.next(value); + }, + error(e) { observer.error(e) }, + complete() { observer.complete() }, + })); + } + + filter(fn) { + if (typeof fn !== 'function') + throw new TypeError(fn + ' is not a function'); + + let C = getSpecies(this); + + return new C(observer => this.subscribe({ + next(value) { + try { if (!fn(value)) return; } + catch (e) { return observer.error(e) } + observer.next(value); + }, + error(e) { observer.error(e) }, + complete() { observer.complete() }, + })); + } + + reduce(fn) { + if (typeof fn !== 'function') + throw new TypeError(fn + ' is not a function'); + + let C = getSpecies(this); + let hasSeed = arguments.length > 1; + let hasValue = false; + let seed = arguments[1]; + let acc = seed; + + return new C(observer => this.subscribe({ + + next(value) { + let first = !hasValue; + hasValue = true; + + if (!first || hasSeed) { + try { acc = fn(acc, value) } + catch (e) { return observer.error(e) } + } else { + acc = value; + } + }, + + error(e) { observer.error(e) }, + + complete() { + if (!hasValue && !hasSeed) + return observer.error(new TypeError('Cannot reduce an empty sequence')); + + observer.next(acc); + observer.complete(); + }, + + })); + } + + concat(...sources) { + let C = getSpecies(this); + + return new C(observer => { + let subscription; + let index = 0; + + function startNext(next) { + subscription = next.subscribe({ + next(v) { observer.next(v) }, + error(e) { observer.error(e) }, + complete() { + if (index === sources.length) { + subscription = undefined; + observer.complete(); + } else { + startNext(C.from(sources[index++])); + } + }, + }); + } + + startNext(this); + + return () => { + if (subscription) { + subscription.unsubscribe(); + subscription = undefined; + } + }; + }); + } + + flatMap(fn) { + if (typeof fn !== 'function') + throw new TypeError(fn + ' is not a function'); + + let C = getSpecies(this); + + return new C(observer => { + let subscriptions = []; + + let outer = this.subscribe({ + next(value) { + if (fn) { + try { value = fn(value) } + catch (e) { return observer.error(e) } + } + + let inner = C.from(value).subscribe({ + next(value) { observer.next(value) }, + error(e) { observer.error(e) }, + complete() { + let i = subscriptions.indexOf(inner); + if (i >= 0) subscriptions.splice(i, 1); + completeIfDone(); + }, + }); + + subscriptions.push(inner); + }, + error(e) { observer.error(e) }, + complete() { completeIfDone() }, + }); + + function completeIfDone() { + if (outer.closed && subscriptions.length === 0) + observer.complete(); + } + + return () => { + subscriptions.forEach(s => s.unsubscribe()); + outer.unsubscribe(); + }; + }); + } + + [SymbolObservable]() { return this } + + static from(x) { + let C = typeof this === 'function' ? this : Observable; + + if (x == null) + throw new TypeError(x + ' is not an object'); + + let method = getMethod(x, SymbolObservable); + if (method) { + let observable = method.call(x); + + if (Object(observable) !== observable) + throw new TypeError(observable + ' is not an object'); + + if (isObservable(observable) && observable.constructor === C) + return observable; + + return new C(observer => observable.subscribe(observer)); + } + + if (hasSymbol('iterator')) { + method = getMethod(x, SymbolIterator); + if (method) { + return new C(observer => { + enqueue(() => { + if (observer.closed) return; + for (let item of method.call(x)) { + observer.next(item); + if (observer.closed) return; + } + observer.complete(); + }); + }); + } + } + + if (Array.isArray(x)) { + return new C(observer => { + enqueue(() => { + if (observer.closed) return; + for (let i = 0; i < x.length; ++i) { + observer.next(x[i]); + if (observer.closed) return; + } + observer.complete(); + }); + }); + } + + throw new TypeError(x + ' is not observable'); + } + + static of(...items) { + let C = typeof this === 'function' ? this : Observable; + + return new C(observer => { + enqueue(() => { + if (observer.closed) return; + for (let i = 0; i < items.length; ++i) { + observer.next(items[i]); + if (observer.closed) return; + } + observer.complete(); + }); + }); + } + + static get [SymbolSpecies]() { return this } + +} + +if (hasSymbols()) { + Object.defineProperty(Observable, Symbol('extensions'), { + value: { + symbol: SymbolObservable, + hostReportError, + }, + configurable: true, + }); +} diff --git a/node_modules/zen-observable/src/extras.js b/node_modules/zen-observable/src/extras.js new file mode 100644 index 000000000..ca6b6f7b1 --- /dev/null +++ b/node_modules/zen-observable/src/extras.js @@ -0,0 +1,99 @@ +import { Observable } from './Observable.js'; + +// Emits all values from all inputs in parallel +export function merge(...sources) { + return new Observable(observer => { + if (sources.length === 0) + return Observable.from([]); + + let count = sources.length; + + let subscriptions = sources.map(source => Observable.from(source).subscribe({ + next(v) { + observer.next(v); + }, + error(e) { + observer.error(e); + }, + complete() { + if (--count === 0) + observer.complete(); + }, + })); + + return () => subscriptions.forEach(s => s.unsubscribe()); + }); +} + +// Emits arrays containing the most current values from each input +export function combineLatest(...sources) { + return new Observable(observer => { + if (sources.length === 0) + return Observable.from([]); + + let count = sources.length; + let seen = new Set(); + let seenAll = false; + let values = sources.map(() => undefined); + + let subscriptions = sources.map((source, index) => Observable.from(source).subscribe({ + next(v) { + values[index] = v; + + if (!seenAll) { + seen.add(index); + if (seen.size !== sources.length) + return; + + seen = null; + seenAll = true; + } + + observer.next(Array.from(values)); + }, + error(e) { + observer.error(e); + }, + complete() { + if (--count === 0) + observer.complete(); + }, + })); + + return () => subscriptions.forEach(s => s.unsubscribe()); + }); +} + +// Emits arrays containing the matching index values from each input +export function zip(...sources) { + return new Observable(observer => { + if (sources.length === 0) + return Observable.from([]); + + let queues = sources.map(() => []); + + function done() { + return queues.some((q, i) => q.length === 0 && subscriptions[i].closed); + } + + let subscriptions = sources.map((source, index) => Observable.from(source).subscribe({ + next(v) { + queues[index].push(v); + if (queues.every(q => q.length > 0)) { + observer.next(queues.map(q => q.shift())); + if (done()) + observer.complete(); + } + }, + error(e) { + observer.error(e); + }, + complete() { + if (done()) + observer.complete(); + }, + })); + + return () => subscriptions.forEach(s => s.unsubscribe()); + }); +} diff --git a/node_modules/zen-observable/test/concat.js b/node_modules/zen-observable/test/concat.js new file mode 100644 index 000000000..30079d488 --- /dev/null +++ b/node_modules/zen-observable/test/concat.js @@ -0,0 +1,30 @@ +import assert from 'assert'; + +describe('concat', () => { + it('concatenates the supplied Observable arguments', async () => { + let list = []; + + await Observable + .from([1, 2, 3, 4]) + .concat(Observable.of(5, 6, 7)) + .forEach(x => list.push(x)); + + assert.deepEqual(list, [1, 2, 3, 4, 5, 6, 7]); + }); + + it('can be used multiple times to produce the same results', async () => { + const list1 = []; + const list2 = []; + + const concatenated = Observable.from([1, 2, 3, 4]) + .concat(Observable.of(5, 6, 7)); + + await concatenated + .forEach(x => list1.push(x)); + await concatenated + .forEach(x => list2.push(x)); + + assert.deepEqual(list1, [1, 2, 3, 4, 5, 6, 7]); + assert.deepEqual(list2, [1, 2, 3, 4, 5, 6, 7]); + }); +}); diff --git a/node_modules/zen-observable/test/constructor.js b/node_modules/zen-observable/test/constructor.js new file mode 100644 index 000000000..4d93b7fd5 --- /dev/null +++ b/node_modules/zen-observable/test/constructor.js @@ -0,0 +1,36 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('constructor', () => { + it('throws if called as a function', () => { + assert.throws(() => Observable(() => {})); + assert.throws(() => Observable.call({}, () => {})); + }); + + it('throws if the argument is not callable', () => { + assert.throws(() => new Observable({})); + assert.throws(() => new Observable()); + assert.throws(() => new Observable(1)); + assert.throws(() => new Observable('string')); + }); + + it('accepts a function argument', () => { + let result = new Observable(() => {}); + assert.ok(result instanceof Observable); + }); + + it('is the value of Observable.prototype.constructor', () => { + testMethodProperty(Observable.prototype, 'constructor', { + configurable: true, + writable: true, + length: 1, + }); + }); + + it('does not call the subscriber function', () => { + let called = 0; + new Observable(() => { called++ }); + assert.equal(called, 0); + }); + +}); diff --git a/node_modules/zen-observable/test/extras/combine-latest.js b/node_modules/zen-observable/test/extras/combine-latest.js new file mode 100644 index 000000000..ec2c920ed --- /dev/null +++ b/node_modules/zen-observable/test/extras/combine-latest.js @@ -0,0 +1,43 @@ +import assert from 'assert'; +import { parse } from './parse.js'; +import { combineLatest } from '../../src/extras.js'; + +describe('extras/combineLatest', () => { + it('should emit arrays containing the most recent values', async () => { + let output = []; + await combineLatest( + parse('a-b-c-d'), + parse('-A-B-C-D') + ).forEach( + value => output.push(value.join('')) + ); + assert.deepEqual(output, [ + 'aA', + 'bA', + 'bB', + 'cB', + 'cC', + 'dC', + 'dD', + ]); + }); + + it('should emit values in the correct order', async () => { + let output = []; + await combineLatest( + parse('-a-b-c-d'), + parse('A-B-C-D') + ).forEach( + value => output.push(value.join('')) + ); + assert.deepEqual(output, [ + 'aA', + 'aB', + 'bB', + 'bC', + 'cC', + 'cD', + 'dD', + ]); + }); +}); diff --git a/node_modules/zen-observable/test/extras/merge.js b/node_modules/zen-observable/test/extras/merge.js new file mode 100644 index 000000000..4b637ca46 --- /dev/null +++ b/node_modules/zen-observable/test/extras/merge.js @@ -0,0 +1,16 @@ +import assert from 'assert'; +import { parse } from './parse.js'; +import { merge } from '../../src/extras.js'; + +describe('extras/merge', () => { + it('should emit all data from each input in parallel', async () => { + let output = ''; + await merge( + parse('a-b-c-d'), + parse('-A-B-C-D') + ).forEach( + value => output += value + ); + assert.equal(output, 'aAbBcCdD'); + }); +}); diff --git a/node_modules/zen-observable/test/extras/parse.js b/node_modules/zen-observable/test/extras/parse.js new file mode 100644 index 000000000..f22de31d8 --- /dev/null +++ b/node_modules/zen-observable/test/extras/parse.js @@ -0,0 +1,11 @@ +export function parse(string) { + return new Observable(async observer => { + await null; + for (let char of string) { + if (observer.closed) return; + else if (char !== '-') observer.next(char); + await null; + } + observer.complete(); + }); +} diff --git a/node_modules/zen-observable/test/extras/zip.js b/node_modules/zen-observable/test/extras/zip.js new file mode 100644 index 000000000..94225d24e --- /dev/null +++ b/node_modules/zen-observable/test/extras/zip.js @@ -0,0 +1,21 @@ +import assert from 'assert'; +import { parse } from './parse.js'; +import { zip } from '../../src/extras.js'; + +describe('extras/zip', () => { + it('should emit pairs of corresponding index values', async () => { + let output = []; + await zip( + parse('a-b-c-d'), + parse('-A-B-C-D') + ).forEach( + value => output.push(value.join('')) + ); + assert.deepEqual(output, [ + 'aA', + 'bB', + 'cC', + 'dD', + ]); + }); +}); diff --git a/node_modules/zen-observable/test/filter.js b/node_modules/zen-observable/test/filter.js new file mode 100644 index 000000000..36ad88fe9 --- /dev/null +++ b/node_modules/zen-observable/test/filter.js @@ -0,0 +1,14 @@ +import assert from 'assert'; + +describe('filter', () => { + it('filters the results using the supplied callback', async () => { + let list = []; + + await Observable + .from([1, 2, 3, 4]) + .filter(x => x > 2) + .forEach(x => list.push(x)); + + assert.deepEqual(list, [3, 4]); + }); +}); diff --git a/node_modules/zen-observable/test/flat-map.js b/node_modules/zen-observable/test/flat-map.js new file mode 100644 index 000000000..64cca896a --- /dev/null +++ b/node_modules/zen-observable/test/flat-map.js @@ -0,0 +1,23 @@ +import assert from 'assert'; + +describe('flatMap', () => { + it('maps and flattens the results using the supplied callback', async () => { + let list = []; + + await Observable.of('a', 'b', 'c').flatMap(x => + Observable.of(1, 2, 3).map(y => [x, y]) + ).forEach(x => list.push(x)); + + assert.deepEqual(list, [ + ['a', 1], + ['a', 2], + ['a', 3], + ['b', 1], + ['b', 2], + ['b', 3], + ['c', 1], + ['c', 2], + ['c', 3], + ]); + }); +}); diff --git a/node_modules/zen-observable/test/for-each.js b/node_modules/zen-observable/test/for-each.js new file mode 100644 index 000000000..69c55907b --- /dev/null +++ b/node_modules/zen-observable/test/for-each.js @@ -0,0 +1,70 @@ +import assert from 'assert'; + +describe('forEach', () => { + + it('rejects if the argument is not a function', async () => { + let promise = Observable.of(1, 2, 3).forEach(); + try { + await promise; + assert.ok(false); + } catch (err) { + assert.equal(err.name, 'TypeError'); + } + }); + + it('rejects if the callback throws', async () => { + let error = {}; + try { + await Observable.of(1, 2, 3).forEach(x => { throw error }); + assert.ok(false); + } catch (err) { + assert.equal(err, error); + } + }); + + it('does not execute callback after callback throws', async () => { + let calls = []; + try { + await Observable.of(1, 2, 3).forEach(x => { + calls.push(x); + throw {}; + }); + assert.ok(false); + } catch (err) { + assert.deepEqual(calls, [1]); + } + }); + + it('rejects if the producer calls error', async () => { + let error = {}; + try { + let observer; + let promise = new Observable(x => { observer = x }).forEach(() => {}); + observer.error(error); + await promise; + assert.ok(false); + } catch (err) { + assert.equal(err, error); + } + }); + + it('resolves with undefined if the producer calls complete', async () => { + let observer; + let promise = new Observable(x => { observer = x }).forEach(() => {}); + observer.complete(); + assert.equal(await promise, undefined); + }); + + it('provides a cancellation function as the second argument', async () => { + let observer; + let results = []; + await Observable.of(1, 2, 3).forEach((value, cancel) => { + results.push(value); + if (value > 1) { + return cancel(); + } + }); + assert.deepEqual(results, [1, 2]); + }); + +}); diff --git a/node_modules/zen-observable/test/from.js b/node_modules/zen-observable/test/from.js new file mode 100644 index 000000000..cc7378e84 --- /dev/null +++ b/node_modules/zen-observable/test/from.js @@ -0,0 +1,95 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('from', () => { + const iterable = { + *[Symbol.iterator]() { + yield 1; + yield 2; + yield 3; + }, + }; + + it('is a method on Observable', () => { + testMethodProperty(Observable, 'from', { + configurable: true, + writable: true, + length: 1, + }); + }); + + it('throws if the argument is null', () => { + assert.throws(() => Observable.from(null)); + }); + + it('throws if the argument is undefined', () => { + assert.throws(() => Observable.from(undefined)); + }); + + it('throws if the argument is not observable or iterable', () => { + assert.throws(() => Observable.from({})); + }); + + describe('observables', () => { + it('returns the input if the constructor matches "this"', () => { + let ctor = function() {}; + let observable = new Observable(() => {}); + observable.constructor = ctor; + assert.equal(Observable.from.call(ctor, observable), observable); + }); + + it('wraps the input if it is not an instance of Observable', () => { + let obj = { + 'constructor': Observable, + [Symbol.observable]() { return this }, + }; + assert.ok(Observable.from(obj) !== obj); + }); + + it('throws if @@observable property is not a method', () => { + assert.throws(() => Observable.from({ + [Symbol.observable]: 1 + })); + }); + + it('returns an observable wrapping @@observable result', () => { + let inner = { + subscribe(x) { + observer = x; + return () => { cleanupCalled = true }; + }, + }; + let observer; + let cleanupCalled = true; + let observable = Observable.from({ + [Symbol.observable]() { return inner }, + }); + observable.subscribe(); + assert.equal(typeof observer.next, 'function'); + observer.complete(); + assert.equal(cleanupCalled, true); + }); + }); + + describe('iterables', () => { + it('throws if @@iterator is not a method', () => { + assert.throws(() => Observable.from({ [Symbol.iterator]: 1 })); + }); + + it('returns an observable wrapping iterables', async () => { + let calls = []; + let subscription = Observable.from(iterable).subscribe({ + next(v) { calls.push(['next', v]) }, + complete() { calls.push(['complete']) }, + }); + assert.deepEqual(calls, []); + await null; + assert.deepEqual(calls, [ + ['next', 1], + ['next', 2], + ['next', 3], + ['complete'], + ]); + }); + }); +}); diff --git a/node_modules/zen-observable/test/map.js b/node_modules/zen-observable/test/map.js new file mode 100644 index 000000000..22d25d84a --- /dev/null +++ b/node_modules/zen-observable/test/map.js @@ -0,0 +1,13 @@ +import assert from 'assert'; + +describe('map', () => { + it('maps the results using the supplied callback', async () => { + let list = []; + + await Observable.from([1, 2, 3]) + .map(x => x * 2) + .forEach(x => list.push(x)); + + assert.deepEqual(list, [2, 4, 6]); + }); +}); diff --git a/node_modules/zen-observable/test/observer-closed.js b/node_modules/zen-observable/test/observer-closed.js new file mode 100644 index 000000000..b39db546b --- /dev/null +++ b/node_modules/zen-observable/test/observer-closed.js @@ -0,0 +1,35 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('observer.closed', () => { + it('is a getter on SubscriptionObserver.prototype', () => { + let observer; + new Observable(x => { observer = x }).subscribe(); + testMethodProperty(Object.getPrototypeOf(observer), 'closed', { + get: true, + configurable: true, + writable: true, + length: 1 + }); + }); + + it('returns false when the subscription is open', () => { + new Observable(observer => { + assert.equal(observer.closed, false); + }).subscribe(); + }); + + it('returns true when the subscription is completed', () => { + let observer; + new Observable(x => { observer = x; }).subscribe(); + observer.complete(); + assert.equal(observer.closed, true); + }); + + it('returns true when the subscription is errored', () => { + let observer; + new Observable(x => { observer = x; }).subscribe(null, () => {}); + observer.error(); + assert.equal(observer.closed, true); + }); +}); diff --git a/node_modules/zen-observable/test/observer-complete.js b/node_modules/zen-observable/test/observer-complete.js new file mode 100644 index 000000000..77ff824f3 --- /dev/null +++ b/node_modules/zen-observable/test/observer-complete.js @@ -0,0 +1,143 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('observer.complete', () => { + + function getObserver(inner) { + let observer; + new Observable(x => { observer = x }).subscribe(inner); + return observer; + } + + it('is a method of SubscriptionObserver', () => { + let observer = getObserver(); + testMethodProperty(Object.getPrototypeOf(observer), 'complete', { + configurable: true, + writable: true, + length: 0, + }); + }); + + it('does not forward arguments', () => { + let args; + let observer = getObserver({ complete(...a) { args = a } }); + observer.complete(1); + assert.deepEqual(args, []); + }); + + it('does not return a value', () => { + let observer = getObserver({ complete() { return 1 } }); + assert.equal(observer.complete(), undefined); + }); + + it('does not forward when the subscription is complete', () => { + let count = 0; + let observer = getObserver({ complete() { count++ } }); + observer.complete(); + observer.complete(); + assert.equal(count, 1); + }); + + it('does not forward when the subscription is cancelled', () => { + let count = 0; + let observer; + let subscription = new Observable(x => { observer = x }).subscribe({ + complete() { count++ }, + }); + subscription.unsubscribe(); + observer.complete(); + assert.equal(count, 0); + }); + + it('queues if the subscription is not initialized', async () => { + let completed = false; + new Observable(x => { x.complete() }).subscribe({ + complete() { completed = true }, + }); + assert.equal(completed, false); + await null; + assert.equal(completed, true); + }); + + it('queues if the observer is running', async () => { + let observer; + let completed = false + new Observable(x => { observer = x }).subscribe({ + next() { observer.complete() }, + complete() { completed = true }, + }); + observer.next(); + assert.equal(completed, false); + await null; + assert.equal(completed, true); + }); + + it('closes the subscription before invoking inner observer', () => { + let closed; + let observer = getObserver({ + complete() { closed = observer.closed }, + }); + observer.complete(); + assert.equal(closed, true); + }); + + it('reports error if "complete" is not a method', () => { + let observer = getObserver({ complete: 1 }); + observer.complete(); + assert.ok(hostError instanceof Error); + }); + + it('does not report error if "complete" is undefined', () => { + let observer = getObserver({ complete: undefined }); + observer.complete(); + assert.ok(!hostError); + }); + + it('does not report error if "complete" is null', () => { + let observer = getObserver({ complete: null }); + observer.complete(); + assert.ok(!hostError); + }); + + it('reports error if "complete" throws', () => { + let error = {}; + let observer = getObserver({ complete() { throw error } }); + observer.complete(); + assert.equal(hostError, error); + }); + + it('calls the cleanup method after "complete"', () => { + let calls = []; + let observer; + new Observable(x => { + observer = x; + return () => { calls.push('cleanup') }; + }).subscribe({ + complete() { calls.push('complete') }, + }); + observer.complete(); + assert.deepEqual(calls, ['complete', 'cleanup']); + }); + + it('calls the cleanup method if there is no "complete"', () => { + let calls = []; + let observer; + new Observable(x => { + observer = x; + return () => { calls.push('cleanup') }; + }).subscribe({}); + observer.complete(); + assert.deepEqual(calls, ['cleanup']); + }); + + it('reports error if the cleanup function throws', () => { + let error = {}; + let observer; + new Observable(x => { + observer = x; + return () => { throw error }; + }).subscribe(); + observer.complete(); + assert.equal(hostError, error); + }); +}); diff --git a/node_modules/zen-observable/test/observer-error.js b/node_modules/zen-observable/test/observer-error.js new file mode 100644 index 000000000..0a1d9f1b2 --- /dev/null +++ b/node_modules/zen-observable/test/observer-error.js @@ -0,0 +1,145 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('observer.error', () => { + + function getObserver(inner) { + let observer; + new Observable(x => { observer = x }).subscribe(inner); + return observer; + } + + it('is a method of SubscriptionObserver', () => { + let observer = getObserver(); + testMethodProperty(Object.getPrototypeOf(observer), 'error', { + configurable: true, + writable: true, + length: 1, + }); + }); + + it('forwards the argument', () => { + let args; + let observer = getObserver({ error(...a) { args = a } }); + observer.error(1); + assert.deepEqual(args, [1]); + }); + + it('does not return a value', () => { + let observer = getObserver({ error() { return 1 } }); + assert.equal(observer.error(), undefined); + }); + + it('does not throw when the subscription is complete', () => { + let observer = getObserver({ error() {} }); + observer.complete(); + observer.error('error'); + }); + + it('does not throw when the subscription is cancelled', () => { + let observer; + let subscription = new Observable(x => { observer = x }).subscribe({ + error() {}, + }); + subscription.unsubscribe(); + observer.error(1); + assert.ok(!hostError); + }); + + it('queues if the subscription is not initialized', async () => { + let error; + new Observable(x => { x.error({}) }).subscribe({ + error(err) { error = err }, + }); + assert.equal(error, undefined); + await null; + assert.ok(error); + }); + + it('queues if the observer is running', async () => { + let observer; + let error; + new Observable(x => { observer = x }).subscribe({ + next() { observer.error({}) }, + error(e) { error = e }, + }); + observer.next(); + assert.ok(!error); + await null; + assert.ok(error); + }); + + it('closes the subscription before invoking inner observer', () => { + let closed; + let observer = getObserver({ + error() { closed = observer.closed }, + }); + observer.error(1); + assert.equal(closed, true); + }); + + it('reports an error if "error" is not a method', () => { + let observer = getObserver({ error: 1 }); + observer.error(1); + assert.ok(hostError); + }); + + it('reports an error if "error" is undefined', () => { + let error = {}; + let observer = getObserver({ error: undefined }); + observer.error(error); + assert.equal(hostError, error); + }); + + it('reports an error if "error" is null', () => { + let error = {}; + let observer = getObserver({ error: null }); + observer.error(error); + assert.equal(hostError, error); + }); + + it('reports error if "error" throws', () => { + let error = {}; + let observer = getObserver({ error() { throw error } }); + observer.error(1); + assert.equal(hostError, error); + }); + + it('calls the cleanup method after "error"', () => { + let calls = []; + let observer; + new Observable(x => { + observer = x; + return () => { calls.push('cleanup') }; + }).subscribe({ + error() { calls.push('error') }, + }); + observer.error(); + assert.deepEqual(calls, ['error', 'cleanup']); + }); + + it('calls the cleanup method if there is no "error"', () => { + let calls = []; + let observer; + new Observable(x => { + observer = x; + return () => { calls.push('cleanup') }; + }).subscribe({}); + try { + observer.error(); + } catch (err) {} + assert.deepEqual(calls, ['cleanup']); + }); + + it('reports error if the cleanup function throws', () => { + let error = {}; + let observer; + new Observable(x => { + observer = x; + return () => { throw error }; + }).subscribe(); + observer.error(1); + assert.equal(hostError, error); + }); + +}); diff --git a/node_modules/zen-observable/test/observer-next.js b/node_modules/zen-observable/test/observer-next.js new file mode 100644 index 000000000..abe1b8510 --- /dev/null +++ b/node_modules/zen-observable/test/observer-next.js @@ -0,0 +1,137 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('observer.next', () => { + + function getObserver(inner) { + let observer; + new Observable(x => { observer = x }).subscribe(inner); + return observer; + } + + it('is a method of SubscriptionObserver', () => { + let observer = getObserver(); + testMethodProperty(Object.getPrototypeOf(observer), 'next', { + configurable: true, + writable: true, + length: 1, + }); + }); + + it('forwards the first argument', () => { + let args; + let observer = getObserver({ next(...a) { args = a } }); + observer.next(1, 2); + assert.deepEqual(args, [1]); + }); + + it('does not return a value', () => { + let observer = getObserver({ next() { return 1 } }); + assert.equal(observer.next(), undefined); + }); + + it('does not forward when the subscription is complete', () => { + let count = 0; + let observer = getObserver({ next() { count++ } }); + observer.complete(); + observer.next(); + assert.equal(count, 0); + }); + + it('does not forward when the subscription is cancelled', () => { + let count = 0; + let observer; + let subscription = new Observable(x => { observer = x }).subscribe({ + next() { count++ }, + }); + subscription.unsubscribe(); + observer.next(); + assert.equal(count, 0); + }); + + it('remains closed if the subscription is cancelled from "next"', () => { + let observer; + let subscription = new Observable(x => { observer = x }).subscribe({ + next() { subscription.unsubscribe() }, + }); + observer.next(); + assert.equal(observer.closed, true); + }); + + it('queues if the subscription is not initialized', async () => { + let values = []; + let observer; + new Observable(x => { observer = x, x.next(1) }).subscribe({ + next(val) { + values.push(val); + if (val === 1) { + observer.next(3); + } + }, + }); + observer.next(2); + assert.deepEqual(values, []); + await null; + assert.deepEqual(values, [1, 2]); + await null; + assert.deepEqual(values, [1, 2, 3]); + }); + + it('drops queue if subscription is closed', async () => { + let values = []; + let subscription = new Observable(x => { x.next(1) }).subscribe({ + next(val) { values.push(val) }, + }); + assert.deepEqual(values, []); + subscription.unsubscribe(); + await null; + assert.deepEqual(values, []); + }); + + it('queues if the observer is running', async () => { + let observer; + let values = []; + new Observable(x => { observer = x }).subscribe({ + next(val) { + values.push(val); + if (val === 1) observer.next(2); + }, + }); + observer.next(1); + assert.deepEqual(values, [1]); + await null; + assert.deepEqual(values, [1, 2]); + }); + + it('reports error if "next" is not a method', () => { + let observer = getObserver({ next: 1 }); + observer.next(); + assert.ok(hostError); + }); + + it('does not report error if "next" is undefined', () => { + let observer = getObserver({ next: undefined }); + observer.next(); + assert.ok(!hostError); + }); + + it('does not report error if "next" is null', () => { + let observer = getObserver({ next: null }); + observer.next(); + assert.ok(!hostError); + }); + + it('reports error if "next" throws', () => { + let error = {}; + let observer = getObserver({ next() { throw error } }); + observer.next(); + assert.equal(hostError, error); + }); + + it('does not close the subscription on error', () => { + let observer = getObserver({ next() { throw {} } }); + observer.next(); + assert.equal(observer.closed, false); + }); + +}); diff --git a/node_modules/zen-observable/test/of.js b/node_modules/zen-observable/test/of.js new file mode 100644 index 000000000..6e4558cd2 --- /dev/null +++ b/node_modules/zen-observable/test/of.js @@ -0,0 +1,32 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('of', () => { + it('is a method on Observable', () => { + testMethodProperty(Observable, 'of', { + configurable: true, + writable: true, + length: 0, + }); + }); + + it('uses the this value if it is a function', () => { + let usesThis = false; + Observable.of.call(function() { usesThis = true; }); + assert.ok(usesThis); + }); + + it('uses Observable if the this value is not a function', () => { + let result = Observable.of.call({}, 1, 2, 3, 4); + assert.ok(result instanceof Observable); + }); + + it('delivers arguments to next in a job', async () => { + let values = []; + let turns = 0; + Observable.of(1, 2, 3, 4).subscribe(v => values.push(v)); + assert.equal(values.length, 0); + await null; + assert.deepEqual(values, [1, 2, 3, 4]); + }); +}); diff --git a/node_modules/zen-observable/test/properties.js b/node_modules/zen-observable/test/properties.js new file mode 100644 index 000000000..5c530227f --- /dev/null +++ b/node_modules/zen-observable/test/properties.js @@ -0,0 +1,31 @@ +import assert from 'assert'; + +export function testMethodProperty(object, key, options) { + let desc = Object.getOwnPropertyDescriptor(object, key); + let { enumerable = false, configurable = false, writable = false, length } = options; + + assert.ok(desc, `Property ${ key.toString() } exists`); + + if (options.get || options.set) { + if (options.get) { + assert.equal(typeof desc.get, 'function', 'Getter is a function'); + assert.equal(desc.get.length, 0, 'Getter length is 0'); + } else { + assert.equal(desc.get, undefined, 'Getter is undefined'); + } + + if (options.set) { + assert.equal(typeof desc.set, 'function', 'Setter is a function'); + assert.equal(desc.set.length, 1, 'Setter length is 1'); + } else { + assert.equal(desc.set, undefined, 'Setter is undefined'); + } + } else { + assert.equal(typeof desc.value, 'function', 'Value is a function'); + assert.equal(desc.value.length, length, `Function length is ${ length }`); + assert.equal(desc.writable, writable, `Writable property is correct ${ writable }`); + } + + assert.equal(desc.enumerable, enumerable, `Enumerable property is ${ enumerable }`); + assert.equal(desc.configurable, configurable, `Configurable property is ${ configurable }`); +} diff --git a/node_modules/zen-observable/test/reduce.js b/node_modules/zen-observable/test/reduce.js new file mode 100644 index 000000000..a40023a57 --- /dev/null +++ b/node_modules/zen-observable/test/reduce.js @@ -0,0 +1,38 @@ +import assert from 'assert'; + +describe('reduce', () => { + it('reduces without a seed', async () => { + await Observable.from([1, 2, 3, 4, 5, 6]).reduce((a, b) => { + return a + b; + }).forEach(x => { + assert.equal(x, 21); + }); + }); + + it('errors if empty and no seed', async () => { + try { + await Observable.from([]).reduce((a, b) => { + return a + b; + }).forEach(() => null); + assert.ok(false); + } catch (err) { + assert.ok(true); + } + }); + + it('reduces with a seed', async () => { + Observable.from([1, 2, 3, 4, 5, 6]).reduce((a, b) => { + return a + b; + }, 100).forEach(x => { + assert.equal(x, 121); + }); + }); + + it('reduces an empty list with a seed', async () => { + await Observable.from([]).reduce((a, b) => { + return a + b; + }, 100).forEach(x => { + assert.equal(x, 100); + }); + }); +}); diff --git a/node_modules/zen-observable/test/setup.js b/node_modules/zen-observable/test/setup.js new file mode 100644 index 000000000..1cb733283 --- /dev/null +++ b/node_modules/zen-observable/test/setup.js @@ -0,0 +1,9 @@ +import { Observable } from '../src/Observable.js'; + +beforeEach(() => { + global.Observable = Observable; + global.hostError = null; + let $extensions = Object.getOwnPropertySymbols(Observable)[1]; + let { hostReportError } = Observable[$extensions]; + hostReportError.log = (e => global.hostError = e); +}); diff --git a/node_modules/zen-observable/test/species.js b/node_modules/zen-observable/test/species.js new file mode 100644 index 000000000..3774029b4 --- /dev/null +++ b/node_modules/zen-observable/test/species.js @@ -0,0 +1,28 @@ +import assert from 'assert'; + +describe('species', () => { + it('uses Observable when constructor is undefined', () => { + let instance = new Observable(() => {}); + instance.constructor = undefined; + assert.ok(instance.map(x => x) instanceof Observable); + }); + + it('uses Observable if species is null', () => { + let instance = new Observable(() => {}); + instance.constructor = { [Symbol.species]: null }; + assert.ok(instance.map(x => x) instanceof Observable); + }); + + it('uses Observable if species is undefined', () => { + let instance = new Observable(() => {}); + instance.constructor = { [Symbol.species]: undefined }; + assert.ok(instance.map(x => x) instanceof Observable); + }); + + it('uses value of Symbol.species', () => { + function ctor() {} + let instance = new Observable(() => {}); + instance.constructor = { [Symbol.species]: ctor }; + assert.ok(instance.map(x => x) instanceof ctor); + }); +}); diff --git a/node_modules/zen-observable/test/subscribe.js b/node_modules/zen-observable/test/subscribe.js new file mode 100644 index 000000000..4ed4aa34a --- /dev/null +++ b/node_modules/zen-observable/test/subscribe.js @@ -0,0 +1,137 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('subscribe', () => { + + it('is a method of Observable.prototype', () => { + testMethodProperty(Observable.prototype, 'subscribe', { + configurable: true, + writable: true, + length: 1, + }); + }); + + it('accepts an observer argument', () => { + let observer; + let nextValue; + new Observable(x => observer = x).subscribe({ + next(v) { nextValue = v }, + }); + observer.next(1); + assert.equal(nextValue, 1); + }); + + it('accepts a next function argument', () => { + let observer; + let nextValue; + new Observable(x => observer = x).subscribe( + v => nextValue = v + ); + observer.next(1); + assert.equal(nextValue, 1); + }); + + it('accepts an error function argument', () => { + let observer; + let errorValue; + let error = {}; + new Observable(x => observer = x).subscribe( + null, + e => errorValue = e + ); + observer.error(error); + assert.equal(errorValue, error); + }); + + it('accepts a complete function argument', () => { + let observer; + let completed = false; + new Observable(x => observer = x).subscribe( + null, + null, + () => completed = true + ); + observer.complete(); + assert.equal(completed, true); + }); + + it('uses function overload if first argument is null', () => { + let observer; + let completed = false; + new Observable(x => observer = x).subscribe( + null, + null, + () => completed = true + ); + observer.complete(); + assert.equal(completed, true); + }); + + it('uses function overload if first argument is undefined', () => { + let observer; + let completed = false; + new Observable(x => observer = x).subscribe( + undefined, + null, + () => completed = true + ); + observer.complete(); + assert.equal(completed, true); + }); + + it('uses function overload if first argument is a primative', () => { + let observer; + let completed = false; + new Observable(x => observer = x).subscribe( + 'abc', + null, + () => completed = true + ); + observer.complete(); + assert.equal(completed, true); + }); + + it('enqueues a job to send error if subscriber throws', async () => { + let error = {}; + let errorValue = undefined; + new Observable(() => { throw error }).subscribe({ + error(e) { errorValue = e }, + }); + assert.equal(errorValue, undefined); + await null; + assert.equal(errorValue, error); + }); + + it('does not send error if unsubscribed', async () => { + let error = {}; + let errorValue = undefined; + let subscription = new Observable(() => { throw error }).subscribe({ + error(e) { errorValue = e }, + }); + subscription.unsubscribe(); + assert.equal(errorValue, undefined); + await null; + assert.equal(errorValue, undefined); + }); + + it('accepts a cleanup function from the subscriber function', () => { + let cleanupCalled = false; + let subscription = new Observable(() => { + return () => cleanupCalled = true; + }).subscribe(); + subscription.unsubscribe(); + assert.equal(cleanupCalled, true); + }); + + it('accepts a subscription object from the subscriber function', () => { + let cleanupCalled = false; + let subscription = new Observable(() => { + return { + unsubscribe() { cleanupCalled = true }, + }; + }).subscribe(); + subscription.unsubscribe(); + assert.equal(cleanupCalled, true); + }); + +}); diff --git a/node_modules/zen-observable/test/subscription.js b/node_modules/zen-observable/test/subscription.js new file mode 100644 index 000000000..5d3f41fd0 --- /dev/null +++ b/node_modules/zen-observable/test/subscription.js @@ -0,0 +1,41 @@ +import assert from 'assert'; +import { testMethodProperty } from './properties.js'; + +describe('subscription', () => { + + function getSubscription(subscriber = () => {}) { + return new Observable(subscriber).subscribe(); + } + + describe('unsubscribe', () => { + it('is a method on Subscription.prototype', () => { + let subscription = getSubscription(); + testMethodProperty(Object.getPrototypeOf(subscription), 'unsubscribe', { + configurable: true, + writable: true, + length: 0, + }); + }); + + it('reports an error if the cleanup function throws', () => { + let error = {}; + let subscription = getSubscription(() => { + return () => { throw error }; + }); + subscription.unsubscribe(); + assert.equal(hostError, error); + }); + }); + + describe('closed', () => { + it('is a getter on Subscription.prototype', () => { + let subscription = getSubscription(); + testMethodProperty(Object.getPrototypeOf(subscription), 'closed', { + configurable: true, + writable: true, + get: true, + }); + }); + }); + +}); diff --git a/package.json b/package.json new file mode 100644 index 000000000..8497c5e7c --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "dependencies": { + "apollo-boost": "^0.4.3", + "graphql": "^14.4.2", + "react-apollo": "^2.5.8" + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..a85d59415 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,238 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/node@>=6": + version "12.6.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" + integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== + +"@types/zen-observable@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" + integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== + +"@wry/context@^0.4.0": + version "0.4.4" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.4.4.tgz#e50f5fa1d6cfaabf2977d1fda5ae91717f8815f8" + integrity sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag== + dependencies: + "@types/node" ">=6" + tslib "^1.9.3" + +"@wry/equality@^0.1.2": + version "0.1.9" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.9.tgz#b13e18b7a8053c6858aa6c85b54911fb31e3a909" + integrity sha512-mB6ceGjpMGz1ZTza8HYnrPGos2mC6So4NhS1PtZ8s4Qt0K7fBiIGhpSxUbQmhwcSWE3no+bYxmI2OL6KuXYmoQ== + dependencies: + tslib "^1.9.3" + +apollo-boost@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/apollo-boost/-/apollo-boost-0.4.3.tgz#107bd1dd0d349d8e363174ded69612a4aa823c8a" + integrity sha512-XE7hx4aXRnyZ4OGM8I7DjYq9SYLYWrVBoYpEFsv0GBtfIl6tipyks2Yo2/TEWKw7mhGmi1eFB2F3pbhIZbzKuQ== + dependencies: + apollo-cache "^1.3.2" + apollo-cache-inmemory "^1.6.2" + apollo-client "^2.6.3" + apollo-link "^1.0.6" + apollo-link-error "^1.0.3" + apollo-link-http "^1.3.1" + graphql-tag "^2.4.2" + ts-invariant "^0.4.0" + tslib "^1.9.3" + +apollo-cache-inmemory@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.2.tgz#bbf2e4e1eacdf82b2d526f5c2f3b37e5acee3c5e" + integrity sha512-AyCl3PGFv5Qv1w4N9vlg63GBPHXgMCekZy5mhlS042ji0GW84uTySX+r3F61ZX3+KM1vA4m9hQyctrEGiv5XjQ== + dependencies: + apollo-cache "^1.3.2" + apollo-utilities "^1.3.2" + optimism "^0.9.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + +apollo-cache@1.3.2, apollo-cache@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.2.tgz#df4dce56240d6c95c613510d7e409f7214e6d26a" + integrity sha512-+KA685AV5ETEJfjZuviRTEImGA11uNBp/MJGnaCvkgr+BYRrGLruVKBv6WvyFod27WEB2sp7SsG8cNBKANhGLg== + dependencies: + apollo-utilities "^1.3.2" + tslib "^1.9.3" + +apollo-client@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.6.3.tgz#9bb2d42fb59f1572e51417f341c5f743798d22db" + integrity sha512-DS8pmF5CGiiJ658dG+mDn8pmCMMQIljKJSTeMNHnFuDLV0uAPZoeaAwVFiAmB408Ujqt92oIZ/8yJJAwSIhd4A== + dependencies: + "@types/zen-observable" "^0.8.0" + apollo-cache "1.3.2" + apollo-link "^1.0.0" + apollo-utilities "1.3.2" + symbol-observable "^1.0.2" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable "^0.8.0" + +apollo-link-error@^1.0.3: + version "1.1.11" + resolved "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.11.tgz#7cd363179616fb90da7866cee85cb00ee45d2f3b" + integrity sha512-442DNqn3CNRikDaenMMkoDmCRmkoUx/XyUMlRTZBEFdTw3FYPQLsmDO3hzzC4doY5/BHcn9/jdYh9EeLx4HPsA== + dependencies: + apollo-link "^1.2.12" + apollo-link-http-common "^0.2.14" + tslib "^1.9.3" + +apollo-link-http-common@^0.2.14: + version "0.2.14" + resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.14.tgz#d3a195c12e00f4e311c417f121181dcc31f7d0c8" + integrity sha512-v6mRU1oN6XuX8beVIRB6OpF4q1ULhSnmy7ScnHnuo1qV6GaFmDcbdvXqxIkAV1Q8SQCo2lsv4HeqJOWhFfApOg== + dependencies: + apollo-link "^1.2.12" + ts-invariant "^0.4.0" + tslib "^1.9.3" + +apollo-link-http@^1.3.1: + version "1.5.15" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.15.tgz#106ab23bb8997bd55965d05855736d33119652cf" + integrity sha512-epZFhCKDjD7+oNTVK3P39pqWGn4LEhShAoA1Q9e2tDrBjItNfviiE33RmcLcCURDYyW5JA6SMgdODNI4Is8tvQ== + dependencies: + apollo-link "^1.2.12" + apollo-link-http-common "^0.2.14" + tslib "^1.9.3" + +apollo-link@^1.0.0, apollo-link@^1.0.6, apollo-link@^1.2.12: + version "1.2.12" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429" + integrity sha512-fsgIAXPKThyMVEMWQsUN22AoQI+J/pVXcjRGAShtk97h7D8O+SPskFinCGEkxPeQpE83uKaqafB2IyWdjN+J3Q== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.19" + +apollo-utilities@1.3.2, apollo-utilities@^1.3.0, apollo-utilities@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.2.tgz#8cbdcf8b012f664cd6cb5767f6130f5aed9115c9" + integrity sha512-JWNHj8XChz7S4OZghV6yc9FNnzEXj285QYp/nLNh943iObycI5GTDO3NGR9Dth12LRrSFMeDOConPfPln+WGfg== + dependencies: + "@wry/equality" "^0.1.2" + fast-json-stable-stringify "^2.0.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +graphql-tag@^2.4.2: + version "2.10.1" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.1.tgz#10aa41f1cd8fae5373eaf11f1f67260a3cad5e02" + integrity sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg== + +graphql@^14.4.2: + version "14.4.2" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.4.2.tgz#553a7d546d524663eda49ed6df77577be3203ae3" + integrity sha512-6uQadiRgnpnSS56hdZUSvFrVcQ6OF9y6wkxJfKquFtHlnl7+KSuWwSJsdwiK1vybm1HgcdbpGkCpvhvsVQ0UZQ== + dependencies: + iterall "^1.2.2" + +hoist-non-react-statics@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" + integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA== + dependencies: + react-is "^16.7.0" + +iterall@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" + integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + +loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +optimism@^0.9.0: + version "0.9.6" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.9.6.tgz#5621195486b294c3bfc518d17ac47767234b029f" + integrity sha512-bWr/ZP32UgFCQAoSkz33XctHwpq2via2sBvGvO5JIlrU8gaiM0LvoKj3QMle9LWdSKlzKik8XGSerzsdfYLNxA== + dependencies: + "@wry/context" "^0.4.0" + +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +react-apollo@^2.5.8: + version "2.5.8" + resolved "https://registry.yarnpkg.com/react-apollo/-/react-apollo-2.5.8.tgz#c7a593b027efeefdd8399885e0ac6bec3b32623c" + integrity sha512-60yOQrnNosxU/tRbOxGDaYNLFcOKmQqxHPhxyvKTlGIaF/rRCXQRKixUgWVffpEupSHHD7psY5k5ZOuZsdsSGQ== + dependencies: + apollo-utilities "^1.3.0" + fast-json-stable-stringify "^2.0.0" + hoist-non-react-statics "^3.3.0" + lodash.isequal "^4.5.0" + prop-types "^15.7.2" + ts-invariant "^0.4.2" + tslib "^1.9.3" + +react-is@^16.7.0, react-is@^16.8.1: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +symbol-observable@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== + +ts-invariant@^0.4.0, ts-invariant@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86" + integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA== + dependencies: + tslib "^1.9.3" + +tslib@^1.9.3: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + +zen-observable-ts@^0.8.19: + version "0.8.19" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.19.tgz#c094cd20e83ddb02a11144a6e2a89706946b5694" + integrity sha512-u1a2rpE13G+jSzrg3aiCqXU5tN2kw41b+cBZGmnc+30YimdkKiDj9bTowcB41eL77/17RF/h+393AuVgShyheQ== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + +zen-observable@^0.8.0: + version "0.8.14" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.14.tgz#d33058359d335bc0db1f0af66158b32872af3bf7" + integrity sha512-kQz39uonEjEESwh+qCi83kcC3rZJGh4mrZW7xjkSQYXkq//JZHTtKo+6yuVloTgMtzsIWOJrjIrKvk/dqm0L5g== From 270b50eb6d460d8fdf1fc87ca0321cb7840397f7 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 13:25:49 -0400 Subject: [PATCH 07/38] ammend app --- client/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/App.js b/client/src/App.js index dd9b8cd3e..77dcc8a0d 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,7 +1,6 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' import Login from './components/Login' -import './App.css'; function App() { return ( @@ -10,6 +9,7 @@ function App() {
    +
    From 6ec73e634d587d90ba05aa9b4e5e183e2803011b Mon Sep 17 00:00:00 2001 From: chef27615 Date: Tue, 30 Jul 2019 13:44:17 -0400 Subject: [PATCH 08/38] reorg --- client/.gitignore | 1 + client/package.json | 5 +-- client/src/App.js | 20 +++++++-- client/src/component/Game.js | 11 ----- client/src/component/Home.js | 11 ----- client/src/component/Login.js | 11 ----- client/src/component/Signup.js | 11 ----- client/src/component/constants.js | 1 + client/src/component/footer/Footer.js | 9 ++++ client/src/component/header/Header.js | 15 +++++++ client/src/component/login/Header.js | 45 +++++++++++++++++++ client/src/component/login/Login.js | 65 +++++++++++++++++++++++++++ client/src/index.js | 43 +++--------------- 13 files changed, 159 insertions(+), 89 deletions(-) delete mode 100644 client/src/component/Game.js delete mode 100644 client/src/component/Home.js delete mode 100644 client/src/component/Login.js delete mode 100644 client/src/component/Signup.js create mode 100644 client/src/component/constants.js create mode 100644 client/src/component/footer/Footer.js create mode 100644 client/src/component/header/Header.js create mode 100644 client/src/component/login/Header.js create mode 100644 client/src/component/login/Login.js diff --git a/client/.gitignore b/client/.gitignore index 960b87d28..222fa0af7 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -17,6 +17,7 @@ .env.development.local .env.test.local .env.production.local +/.DS_Store npm-debug.log* yarn-debug.log* diff --git a/client/package.json b/client/package.json index 825765103..236a31bec 100644 --- a/client/package.json +++ b/client/package.json @@ -3,11 +3,8 @@ "version": "0.1.0", "private": true, "dependencies": { - "apollo-boost": "^0.4.3", - "graphql": "^14.4.2", - "graphql-tag": "^2.10.1", + "axios": "^0.19.0", "react": "^16.8.6", - "react-apollo": "^2.5.8", "react-dom": "^16.8.6", "react-router-dom": "^5.0.1", "react-scripts": "3.0.1" diff --git a/client/src/App.js b/client/src/App.js index 3ba13e927..976d469b2 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,13 +1,25 @@ import React from 'react'; - -import './App.css'; +import { Switch, Route } from 'react-router-dom' +import Login from './component/login/Login' +import Header from './component/header/Header' +import Footer from './component/footer/Footer' function App() { return (
    - Hello + <> +
    +

    Hello from the APP!!

    +
    + + + + +
    +
    +
    ); } -export default App; +export default App; \ No newline at end of file diff --git a/client/src/component/Game.js b/client/src/component/Game.js deleted file mode 100644 index 3c2244bd0..000000000 --- a/client/src/component/Game.js +++ /dev/null @@ -1,11 +0,0 @@ -import React, { Component } from 'react' - -export default class Game extends Component { - render() { - return ( -
    - Game -
    - ) - } -} diff --git a/client/src/component/Home.js b/client/src/component/Home.js deleted file mode 100644 index f6796510d..000000000 --- a/client/src/component/Home.js +++ /dev/null @@ -1,11 +0,0 @@ -import React, { Component } from 'react' - -export default class Home extends Component { - render() { - return ( -
    - Home -
    - ) - } -} diff --git a/client/src/component/Login.js b/client/src/component/Login.js deleted file mode 100644 index 4b4401123..000000000 --- a/client/src/component/Login.js +++ /dev/null @@ -1,11 +0,0 @@ -import React, { Component } from 'react' - -export default class Login extends Component { - render() { - return ( -
    - Login -
    - ) - } -} diff --git a/client/src/component/Signup.js b/client/src/component/Signup.js deleted file mode 100644 index 9604dc4be..000000000 --- a/client/src/component/Signup.js +++ /dev/null @@ -1,11 +0,0 @@ -import React, { Component } from 'react' - -export default class Signup extends Component { - render() { - return ( -
    - Signup -
    - ) - } -} diff --git a/client/src/component/constants.js b/client/src/component/constants.js new file mode 100644 index 000000000..cf47ddd08 --- /dev/null +++ b/client/src/component/constants.js @@ -0,0 +1 @@ +export const AUTH_TOKEN = 'auth-token' \ No newline at end of file diff --git a/client/src/component/footer/Footer.js b/client/src/component/footer/Footer.js new file mode 100644 index 000000000..7c10d9c47 --- /dev/null +++ b/client/src/component/footer/Footer.js @@ -0,0 +1,9 @@ +import React from 'react' + +export default function Footer() { + return ( +
    + footer +
    + ) +} diff --git a/client/src/component/header/Header.js b/client/src/component/header/Header.js new file mode 100644 index 000000000..d0a10ec67 --- /dev/null +++ b/client/src/component/header/Header.js @@ -0,0 +1,15 @@ +import React from 'react' +import { Link } from 'react-router-dom' + + +export default function Header() { + return ( +
    + Home + +
    + ) +} diff --git a/client/src/component/login/Header.js b/client/src/component/login/Header.js new file mode 100644 index 000000000..93cb4bf7f --- /dev/null +++ b/client/src/component/login/Header.js @@ -0,0 +1,45 @@ +import React, { Component } from 'react' +import { Link } from 'react-router-dom' +import { withRouter } from 'react-router' +import { AUTH_TOKEN } from '../constants' + +class Header extends Component { + render() { + const authToken = localStorage.getItem(AUTH_TOKEN) + return ( +
    +
    +
    Treasure Hunt
    + + {authToken && ( +
    +
    |
    + + Enter Rooms -> + +
    + )} +
    +
    + {authToken ? ( +
    { + localStorage.removeItem(AUTH_TOKEN) + this.props.history.push(`/`) + }} + > + logout +
    + ) : ( + + login + + )} +
    +
    + ) + } +} + +export default withRouter(Header) \ No newline at end of file diff --git a/client/src/component/login/Login.js b/client/src/component/login/Login.js new file mode 100644 index 000000000..720919785 --- /dev/null +++ b/client/src/component/login/Login.js @@ -0,0 +1,65 @@ +import React, { Component } from "react"; +import { AUTH_TOKEN } from "../constants"; + +class Login extends Component { + state = { + login: true, // switch between Login and SignUp + email: "", + password: "", + name: "" + }; + + render() { + const { login, email, password, name } = this.state; + return ( +
    +

    {login ? "Login" : "Sign Up"}

    +
    + {!login && ( + this.setState({ name: e.target.value })} + type="text" + placeholder="Your name" + /> + )} + this.setState({ email: e.target.value })} + type="text" + placeholder="Your email address" + /> + this.setState({ password: e.target.value })} + type="password" + placeholder="Choose a safe password" + /> +
    +
    +
    this._confirm()}> + {login ? "login" : "create account"} +
    +
    this.setState({ login: !login })} + > + {login ? "need to create an account?" : "already have an account?"} +
    +
    +
    + ); + } + + _confirm = async () => { + // const { token } = this.state.login ? data.login : data.signup; + // this._saveUserData(token); + // this.props.history.push(`/`); + }; + + _saveUserData = token => { + localStorage.setItem(AUTH_TOKEN, token); + }; +} + +export default Login; diff --git a/client/src/index.js b/client/src/index.js index a12060c35..4e1833727 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -1,43 +1,12 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { - NavLink, - Link, - BrowserRouter as Router, - Route, - Switch -} from 'react-router-dom' -import { ApolloProvider } from 'react-apollo' -import ApolloClient from 'apollo-boost' -import Home from './component/Home' -import Game from './component/Game' -import Signup from './component/Signup' -import Login from './component/Login' +import { BrowserRouter as Router} from 'react-router-dom' import App from './App'; -const client = new ApolloClient({ uri: 'http://localhost:4000'}) - -ReactDOM.render( - - - <> - -
    - - - - - - -
    - -
    -
    , document.getElementById('root')); +ReactDOM.render( + + + +, document.getElementById('root')); From 6133d17d8624031da697768f452693f87bdcedd0 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 14:14:54 -0400 Subject: [PATCH 09/38] render login on home screen --- client/src/App.js | 3 +-- client/src/index.js | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 77dcc8a0d..7bcf403f7 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -8,8 +8,7 @@ function App() {

    Hello from the APP!!

    - - +
    diff --git a/client/src/index.js b/client/src/index.js index 4e594fed3..55db0255a 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -9,9 +9,7 @@ import { BrowserRouter } from 'react-router-dom' ReactDOM.render( - - , document.getElementById('root'), ) From 94b71b2d935976410ca0caa2629f422c5d0f5fd0 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 14:56:59 -0400 Subject: [PATCH 10/38] refactor login/register together, remove header --- client/package.json | 1 + client/src/App.js | 6 ++- client/src/components/Header.js | 45 ------------------- client/src/components/Login.js | 79 +++++++++++++++++++++++---------- client/src/constants.js | 1 - 5 files changed, 60 insertions(+), 72 deletions(-) delete mode 100644 client/src/components/Header.js delete mode 100644 client/src/constants.js diff --git a/client/package.json b/client/package.json index 4a48fe48e..b3bbb868c 100644 --- a/client/package.json +++ b/client/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "axios": "^0.19.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-router": "^5.0.1", diff --git a/client/src/App.js b/client/src/App.js index 7bcf403f7..98c5ae8b7 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,14 +1,16 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' + import Login from './components/Login' function App() { return (
    -

    Hello from the APP!!

    +
    - + +
    diff --git a/client/src/components/Header.js b/client/src/components/Header.js deleted file mode 100644 index 93cb4bf7f..000000000 --- a/client/src/components/Header.js +++ /dev/null @@ -1,45 +0,0 @@ -import React, { Component } from 'react' -import { Link } from 'react-router-dom' -import { withRouter } from 'react-router' -import { AUTH_TOKEN } from '../constants' - -class Header extends Component { - render() { - const authToken = localStorage.getItem(AUTH_TOKEN) - return ( -
    -
    -
    Treasure Hunt
    - - {authToken && ( -
    -
    |
    - - Enter Rooms -> - -
    - )} -
    -
    - {authToken ? ( -
    { - localStorage.removeItem(AUTH_TOKEN) - this.props.history.push(`/`) - }} - > - logout -
    - ) : ( - - login - - )} -
    -
    - ) - } -} - -export default withRouter(Header) \ No newline at end of file diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 720919785..a09b6a743 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -1,40 +1,79 @@ import React, { Component } from "react"; -import { AUTH_TOKEN } from "../constants"; +import axios from "axios"; class Login extends Component { state = { login: true, // switch between Login and SignUp - email: "", + username: "", password: "", - name: "" + password2: "" + }; + + handleInput = event => { + this.setState({ + [event.target.id]: event.target.value + }); + }; + + register = (username, password, password2) => { + axios + .post("https://lambda-mud-test.herokuapp.com/api/registration/", { + username: username, + password1: password, + password2: password2 + }) + .then(response => { + localStorage.setItem("key", response.data.key); + this.props.history.push("/init"); + }) + .catch(error => { + alert(error.response.data.error); + }); + }; + + login = (username, password) => { + axios + .post("https://lambda-mud-test.herokuapp.com/api/registration/", { + username: username, + password: password + }) + .then(response => { + localStorage.setItem("key", response.data.key); + this.props.history.push("/init"); + }) + .catch(error => { + console.log(error.response); + alert(error.response.data.error); + }); }; render() { - const { login, email, password, name } = this.state; + const { login, username, password, password2 } = this.state; return (

    {login ? "Login" : "Sign Up"}

    - {!login && ( - this.setState({ name: e.target.value })} - type="text" - placeholder="Your name" - /> - )} this.setState({ email: e.target.value })} + value={username} + onChange={e => this.setState({ username: e.target.value })} type="text" - placeholder="Your email address" + placeholder="Your username" /> + this.setState({ password: e.target.value })} type="password" - placeholder="Choose a safe password" + placeholder="Your password" /> + {!login && ( + this.setState({ password2: e.target.value })} + type="password" + placeholder="Retype your password" + /> + )}
    this._confirm()}> @@ -51,15 +90,7 @@ class Login extends Component { ); } - _confirm = async () => { - // const { token } = this.state.login ? data.login : data.signup; - // this._saveUserData(token); - // this.props.history.push(`/`); - }; - _saveUserData = token => { - localStorage.setItem(AUTH_TOKEN, token); - }; } export default Login; diff --git a/client/src/constants.js b/client/src/constants.js deleted file mode 100644 index cf47ddd08..000000000 --- a/client/src/constants.js +++ /dev/null @@ -1 +0,0 @@ -export const AUTH_TOKEN = 'auth-token' \ No newline at end of file From cc551db679303a497389ff41aa5b981e23b767d5 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 15:16:54 -0400 Subject: [PATCH 11/38] ammend register onclick --- client/src/App.js | 1 - client/src/components/Login.js | 15 +++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 98c5ae8b7..6e94f2772 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -9,7 +9,6 @@ function App() {
    -
    diff --git a/client/src/components/Login.js b/client/src/components/Login.js index a09b6a743..52121af2c 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -33,7 +33,7 @@ class Login extends Component { login = (username, password) => { axios - .post("https://lambda-mud-test.herokuapp.com/api/registration/", { + .post("https://lambda-mud-test.herokuapp.com/api/login/", { username: username, password: password }) @@ -76,7 +76,16 @@ class Login extends Component { )}
    -
    this._confirm()}> +
    + this.register( + this.state.username, + this.state.password, + this.state.password2 + ) + } + > {login ? "login" : "create account"}
    ); } - - } export default Login; From 3f14a81d1fee34084cc9ecbae963ce0aa7e75af6 Mon Sep 17 00:00:00 2001 From: sriley Date: Tue, 30 Jul 2019 15:53:07 -0400 Subject: [PATCH 12/38] registration and login working --- client/src/components/Login.js | 38 +++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 52121af2c..9f074e167 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -16,24 +16,26 @@ class Login extends Component { }; register = (username, password, password2) => { + let user = { + username: username, + password1: password, + password2: password2 + }; + console.log(user); axios - .post("https://lambda-mud-test.herokuapp.com/api/registration/", { - username: username, - password1: password, - password2: password2 - }) + .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) .then(response => { localStorage.setItem("key", response.data.key); this.props.history.push("/init"); }) .catch(error => { - alert(error.response.data.error); + console.log(error.response); }); }; login = (username, password) => { axios - .post("https://lambda-mud-test.herokuapp.com/api/login/", { + .post("https://f-troop-adventures.herokuapp.com/api/login/", { username: username, password: password }) @@ -43,7 +45,7 @@ class Login extends Component { }) .catch(error => { console.log(error.response); - alert(error.response.data.error); + console.log(error); }); }; @@ -78,12 +80,20 @@ class Login extends Component {
    - this.register( - this.state.username, - this.state.password, - this.state.password2 - ) + onClick={ + login + ? () => + this.login( + this.state.username, + this.state.password + + ) + : () => + this.register( + this.state.username, + this.state.password, + this.state.password2 + ) } > {login ? "login" : "create account"} From 370a381c87639ecb3cff767b9b8d16e50837dd03 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Tue, 30 Jul 2019 16:30:33 -0400 Subject: [PATCH 13/38] recode --- client/src/App.js | 24 ++---- client/src/component/constants.js | 1 - client/src/component/footer/Footer.js | 9 -- client/src/component/header/Header.js | 15 ---- client/src/component/login/Header.js | 45 ---------- client/src/component/login/Login.js | 65 --------------- client/src/components/Login.js | 113 ++++++++++++++++++++++++++ 7 files changed, 122 insertions(+), 150 deletions(-) delete mode 100644 client/src/component/constants.js delete mode 100644 client/src/component/footer/Footer.js delete mode 100644 client/src/component/header/Header.js delete mode 100644 client/src/component/login/Header.js delete mode 100644 client/src/component/login/Login.js create mode 100644 client/src/components/Login.js diff --git a/client/src/App.js b/client/src/App.js index 976d469b2..6e94f2772 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,25 +1,19 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' -import Login from './component/login/Login' -import Header from './component/header/Header' -import Footer from './component/footer/Footer' + +import Login from './components/Login' function App() { return (
    - <> -
    -

    Hello from the APP!!

    -
    - - - - -
    -
    - + +
    + + + +
    ); } -export default App; \ No newline at end of file +export default App; diff --git a/client/src/component/constants.js b/client/src/component/constants.js deleted file mode 100644 index cf47ddd08..000000000 --- a/client/src/component/constants.js +++ /dev/null @@ -1 +0,0 @@ -export const AUTH_TOKEN = 'auth-token' \ No newline at end of file diff --git a/client/src/component/footer/Footer.js b/client/src/component/footer/Footer.js deleted file mode 100644 index 7c10d9c47..000000000 --- a/client/src/component/footer/Footer.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -export default function Footer() { - return ( -
    - footer -
    - ) -} diff --git a/client/src/component/header/Header.js b/client/src/component/header/Header.js deleted file mode 100644 index d0a10ec67..000000000 --- a/client/src/component/header/Header.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import { Link } from 'react-router-dom' - - -export default function Header() { - return ( -
    - Home - -
    - ) -} diff --git a/client/src/component/login/Header.js b/client/src/component/login/Header.js deleted file mode 100644 index 93cb4bf7f..000000000 --- a/client/src/component/login/Header.js +++ /dev/null @@ -1,45 +0,0 @@ -import React, { Component } from 'react' -import { Link } from 'react-router-dom' -import { withRouter } from 'react-router' -import { AUTH_TOKEN } from '../constants' - -class Header extends Component { - render() { - const authToken = localStorage.getItem(AUTH_TOKEN) - return ( -
    -
    -
    Treasure Hunt
    - - {authToken && ( -
    -
    |
    - - Enter Rooms -> - -
    - )} -
    -
    - {authToken ? ( -
    { - localStorage.removeItem(AUTH_TOKEN) - this.props.history.push(`/`) - }} - > - logout -
    - ) : ( - - login - - )} -
    -
    - ) - } -} - -export default withRouter(Header) \ No newline at end of file diff --git a/client/src/component/login/Login.js b/client/src/component/login/Login.js deleted file mode 100644 index 720919785..000000000 --- a/client/src/component/login/Login.js +++ /dev/null @@ -1,65 +0,0 @@ -import React, { Component } from "react"; -import { AUTH_TOKEN } from "../constants"; - -class Login extends Component { - state = { - login: true, // switch between Login and SignUp - email: "", - password: "", - name: "" - }; - - render() { - const { login, email, password, name } = this.state; - return ( -
    -

    {login ? "Login" : "Sign Up"}

    -
    - {!login && ( - this.setState({ name: e.target.value })} - type="text" - placeholder="Your name" - /> - )} - this.setState({ email: e.target.value })} - type="text" - placeholder="Your email address" - /> - this.setState({ password: e.target.value })} - type="password" - placeholder="Choose a safe password" - /> -
    -
    -
    this._confirm()}> - {login ? "login" : "create account"} -
    -
    this.setState({ login: !login })} - > - {login ? "need to create an account?" : "already have an account?"} -
    -
    -
    - ); - } - - _confirm = async () => { - // const { token } = this.state.login ? data.login : data.signup; - // this._saveUserData(token); - // this.props.history.push(`/`); - }; - - _saveUserData = token => { - localStorage.setItem(AUTH_TOKEN, token); - }; -} - -export default Login; diff --git a/client/src/components/Login.js b/client/src/components/Login.js new file mode 100644 index 000000000..9f074e167 --- /dev/null +++ b/client/src/components/Login.js @@ -0,0 +1,113 @@ +import React, { Component } from "react"; +import axios from "axios"; + +class Login extends Component { + state = { + login: true, // switch between Login and SignUp + username: "", + password: "", + password2: "" + }; + + handleInput = event => { + this.setState({ + [event.target.id]: event.target.value + }); + }; + + register = (username, password, password2) => { + let user = { + username: username, + password1: password, + password2: password2 + }; + console.log(user); + axios + .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) + .then(response => { + localStorage.setItem("key", response.data.key); + this.props.history.push("/init"); + }) + .catch(error => { + console.log(error.response); + }); + }; + + login = (username, password) => { + axios + .post("https://f-troop-adventures.herokuapp.com/api/login/", { + username: username, + password: password + }) + .then(response => { + localStorage.setItem("key", response.data.key); + this.props.history.push("/init"); + }) + .catch(error => { + console.log(error.response); + console.log(error); + }); + }; + + render() { + const { login, username, password, password2 } = this.state; + return ( +
    +

    {login ? "Login" : "Sign Up"}

    +
    + this.setState({ username: e.target.value })} + type="text" + placeholder="Your username" + /> + + this.setState({ password: e.target.value })} + type="password" + placeholder="Your password" + /> + {!login && ( + this.setState({ password2: e.target.value })} + type="password" + placeholder="Retype your password" + /> + )} +
    +
    +
    + this.login( + this.state.username, + this.state.password + + ) + : () => + this.register( + this.state.username, + this.state.password, + this.state.password2 + ) + } + > + {login ? "login" : "create account"} +
    +
    this.setState({ login: !login })} + > + {login ? "need to create an account?" : "already have an account?"} +
    +
    +
    + ); + } +} + +export default Login; From d7b5f072e038d505b3000e620f929aaed6fdd0b7 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Tue, 30 Jul 2019 17:50:28 -0400 Subject: [PATCH 14/38] commit-madd init as deshbordand room and room_detail fi --- client/src/App.js | 5 +++- client/src/components/Init.js | 38 ++++++++++++++++++++++++++++ client/src/components/Login.js | 2 ++ client/src/components/Room.js | 30 ++++++++++++++++++++++ client/src/components/Room_detail.js | 10 ++++++++ 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 client/src/components/Init.js create mode 100644 client/src/components/Room.js create mode 100644 client/src/components/Room_detail.js diff --git a/client/src/App.js b/client/src/App.js index 6e94f2772..a622585c2 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -2,6 +2,8 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' import Login from './components/Login' +import Room from './components/Room'; +import Init from './components/Init'; function App() { return ( @@ -9,7 +11,8 @@ function App() {
    - + +
    diff --git a/client/src/components/Init.js b/client/src/components/Init.js new file mode 100644 index 000000000..85512ddd0 --- /dev/null +++ b/client/src/components/Init.js @@ -0,0 +1,38 @@ +import React, { Component } from 'react' +import axios from 'axios' +export default class Init extends Component { + state={ + uuid:'', + name:'', + title:'', + description:'', + players: [] + } + componentDidMount(){ + axios + .get('__link__') + .then(res => { + this.setState({ + uuid:res.data.uuid, + name:res.data.username, + title:res.data.title, + description: res.data.description, + players: res.data.players + }) + }) + } + + render() { + const {uuid, name, title, description, players} = this.state + return ( +
    +

    Your information

    +

    {uuid}

    +

    Your name: {name}

    +

    you are here at {title}

    +

    {description}

    +

    other player in the same area as you: {players.map(player => player)}

    +
    + ) + } +} diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 9f074e167..694bd140f 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -1,6 +1,8 @@ import React, { Component } from "react"; import axios from "axios"; + + class Login extends Component { state = { login: true, // switch between Login and SignUp diff --git a/client/src/components/Room.js b/client/src/components/Room.js new file mode 100644 index 000000000..4629acbab --- /dev/null +++ b/client/src/components/Room.js @@ -0,0 +1,30 @@ +import React, { Component } from 'react' +import axios from 'axios' + +import RoomDetail from './Room_detail' + +export default class Room extends Component { + state = { + room: [] + } + + componentDidMount(){ + axios + .get('https://lambda-mud-test.herokuapp.com/') //waiting for endpoint + .then(res => { + this.setState({ + room: res.data + }) + }) + } + + render() { + return ( +
    + {this.state.room.map(room => + + )} +
    + ) + } +} diff --git a/client/src/components/Room_detail.js b/client/src/components/Room_detail.js new file mode 100644 index 000000000..7f5800f39 --- /dev/null +++ b/client/src/components/Room_detail.js @@ -0,0 +1,10 @@ +import React from 'react' + +export default function Room_detail(props) { + return ( +
    + {props.title} + {props.description} +
    + ) +} From 3f404371dc528005d6f7f0a463e98ab13bd9dc34 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Tue, 30 Jul 2019 18:38:33 -0400 Subject: [PATCH 15/38] add checkAuth and PriivateRoute fn in App.js file --- client/src/App.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index a622585c2..61cdbd1e6 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,10 +1,26 @@ import React from 'react'; -import { Switch, Route } from 'react-router-dom' +import { Switch, Route, Redirect } from 'react-router-dom' import Login from './components/Login' -import Room from './components/Room'; import Init from './components/Init'; +const checkAuth = () => { + const token = localStorage.getItem('token'); + if(!token){ return false } + return true +} + +const PrivateRoute =({ component: Component, ...rest }) => { + ( + checkAuth() ? ( + + ) : ( + + ) + )} /> +} + + function App() { return (
    @@ -12,7 +28,7 @@ function App() {
    - +
    From f3f164a21d9933d7c2cd84d1a866e7e109e1c786 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Wed, 31 Jul 2019 10:28:51 -0400 Subject: [PATCH 16/38] update for data in room --- client/src/App.js | 18 ++---------------- client/src/components/Init.js | 2 +- client/src/components/Login.js | 2 +- client/src/components/Room.js | 19 ++++++++++++++++++- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 61cdbd1e6..1c8e1e37b 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -3,22 +3,8 @@ import { Switch, Route, Redirect } from 'react-router-dom' import Login from './components/Login' import Init from './components/Init'; +import Room from './components/Room'; -const checkAuth = () => { - const token = localStorage.getItem('token'); - if(!token){ return false } - return true -} - -const PrivateRoute =({ component: Component, ...rest }) => { - ( - checkAuth() ? ( - - ) : ( - - ) - )} /> -} function App() { @@ -28,7 +14,7 @@ function App() {
    - +
    diff --git a/client/src/components/Init.js b/client/src/components/Init.js index 85512ddd0..adf9ddd2a 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -10,7 +10,7 @@ export default class Init extends Component { } componentDidMount(){ axios - .get('__link__') + .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') .then(res => { this.setState({ uuid:res.data.uuid, diff --git a/client/src/components/Login.js b/client/src/components/Login.js index 694bd140f..c69e1ba88 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -23,7 +23,7 @@ class Login extends Component { password1: password, password2: password2 }; - console.log(user); + // console.log(user); axios .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) .then(response => { diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 4629acbab..3a4fcde17 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -10,15 +10,32 @@ export default class Room extends Component { componentDidMount(){ axios - .get('https://lambda-mud-test.herokuapp.com/') //waiting for endpoint + .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') //waiting for endpoint .then(res => { this.setState({ room: res.data }) }) + .catch(e => { + console.log(e) + }) } render() { + console.log('state', this.state.room) + + const {room} = this.state + let objValues = Object.values(room) + + + let b = JSON.stringify(objValues) + let c = JSON.parse(b) + console.log(c) + const { model, pk, fields } = c + console.log('object', objValues) + console.log('model', model) + console.log('pk', pk) + console.log('fields', fields) return (
    {this.state.room.map(room => From 2315318098698343c46856bce847b45f52dd0d2b Mon Sep 17 00:00:00 2001 From: sriley Date: Wed, 31 Jul 2019 11:47:33 -0400 Subject: [PATCH 17/38] added token to axios call --- client/src/App.js | 8 +-- client/src/components/Login.js | 8 +-- client/src/components/Room.js | 107 +++++++++++++++++++++------------ client/src/index.js | 2 +- 4 files changed, 76 insertions(+), 49 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 1c8e1e37b..9bb507f45 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,8 +1,8 @@ import React from 'react'; -import { Switch, Route, Redirect } from 'react-router-dom' +import { Switch, Route } from 'react-router-dom' import Login from './components/Login' -import Init from './components/Init'; +// import Init from './components/Init'; import Room from './components/Room'; @@ -13,8 +13,8 @@ function App() {
    - - + +
    diff --git a/client/src/components/Login.js b/client/src/components/Login.js index b37c0af3b..d5b0a7a50 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -23,10 +23,10 @@ class Login extends Component { }; // console.log(user); axios - .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) + .post("http://lambda-mud-test.herokuapp.com/api/registration/", user) .then(response => { localStorage.setItem("key", response.data.key); - this.props.history.push("/init"); + this.props.history.push("/room"); }) .catch(error => { console.log(error.response); @@ -35,13 +35,13 @@ class Login extends Component { login = (username, password) => { axios - .post("https://f-troop-adventures.herokuapp.com/api/login/", { + .post("http://lambda-mud-test.herokuapp.com/api/login/", { username: username, password: password }) .then(response => { localStorage.setItem("key", response.data.key); - this.props.history.push("/init"); + this.props.history.push("/room"); }) .catch(error => { console.log(error.response); diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 3a4fcde17..63e7af3d0 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -1,47 +1,74 @@ -import React, { Component } from 'react' -import axios from 'axios' +import React, { Component } from "react"; +import axios from "axios"; -import RoomDetail from './Room_detail' +import RoomDetail from "./Room_detail"; export default class Room extends Component { - state = { - room: [] - } + state = { + room: [], + key: localStorage.getItem("key") + }; - componentDidMount(){ - axios - .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') //waiting for endpoint - .then(res => { - this.setState({ - room: res.data - }) - }) - .catch(e => { - console.log(e) - }) + componentDidMount() { + if (localStorage.getItem("key")) { + this.getRooms(); } + } - render() { - console.log('state', this.state.room) - - const {room} = this.state - let objValues = Object.values(room) - - - let b = JSON.stringify(objValues) - let c = JSON.parse(b) - console.log(c) - const { model, pk, fields } = c - console.log('object', objValues) - console.log('model', model) - console.log('pk', pk) - console.log('fields', fields) - return ( -
    - {this.state.room.map(room => - - )} -
    - ) - } + handleInput = event => { + this.setState({ + [event.target.id]: event.target.value + }); + }; + + getRooms = () => { + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .get("http://lambda-mud-test.herokuapp.com/api/adv/rooms/", { + headers: header + }) + .then(response => { + this.setState({ room: response.data }); + }) + .catch(error => { + console.log(error.response); + }); + }; + // axios + // .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') //waiting for endpoint + // .then(res => { + // this.setState({ + // room: res.data + // }) + // }) + // .catch(e => { + // console.log(e) + // }) + + render() { + console.log("state", this.state.room); + + const {room} = this.state + let objValues = Object.values(room) + + let b = JSON.stringify(objValues) + let c = JSON.parse(b) + console.log(c) + const { model, pk, fields } = c + console.log('object', objValues) + console.log('model', model) + console.log('pk', pk) + console.log('fields', fields) + return ( +
    + {this.state.room + ? this.state.room.map(room => ( + + )) + : null} +
    + ); + } } diff --git a/client/src/index.js b/client/src/index.js index 8a5cc19c5..42a1c655b 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -4,7 +4,7 @@ import { BrowserRouter } from 'react-router-dom' import App from './App'; -import { BrowserRouter } from 'react-router-dom' + ReactDOM.render( From 32404c55203542a6c727f5c49663072a82e92bf6 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Wed, 31 Jul 2019 11:53:51 -0400 Subject: [PATCH 18/38] init --- client/src/components/Init.js | 2 +- client/src/components/Room.js | 11 +++++------ client/src/index.js | 3 --- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/client/src/components/Init.js b/client/src/components/Init.js index adf9ddd2a..85b5511ca 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -10,7 +10,7 @@ export default class Init extends Component { } componentDidMount(){ axios - .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') + .get('__link_to_player_detail__') .then(res => { this.setState({ uuid:res.data.uuid, diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 3a4fcde17..a4e785342 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -20,17 +20,16 @@ export default class Room extends Component { console.log(e) }) } - - render() { - console.log('state', this.state.room) + getKeys = () => { + } + render() { + console.log('state', this.state.room) const {room} = this.state let objValues = Object.values(room) - - let b = JSON.stringify(objValues) let c = JSON.parse(b) - console.log(c) + console.log('json parse', c) const { model, pk, fields } = c console.log('object', objValues) console.log('model', model) diff --git a/client/src/index.js b/client/src/index.js index 8a5cc19c5..26772712f 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -4,9 +4,6 @@ import { BrowserRouter } from 'react-router-dom' import App from './App'; -import { BrowserRouter } from 'react-router-dom' - - ReactDOM.render( From 9cdf29ef2889ed6b991ff75b5565ebc88aba23d2 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Wed, 31 Jul 2019 15:37:18 -0400 Subject: [PATCH 19/38] data coming back --- client/src/App.js | 4 +-- client/src/components/Room.js | 40 +++++++++++----------------- client/src/components/Room_detail.js | 6 ++--- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index 9bb507f45..c470f0fd3 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -13,8 +13,8 @@ function App() {
    - - + +
    diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 63e7af3d0..7d8363138 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -11,7 +11,7 @@ export default class Room extends Component { componentDidMount() { if (localStorage.getItem("key")) { - this.getRooms(); + this.getRooms(); } } @@ -30,44 +30,34 @@ export default class Room extends Component { headers: header }) .then(response => { - this.setState({ room: response.data }); + console.log('RAW RES FORM DATA ', response.data.rooms) + const a = Object.values(response.data) + const b = JSON.parse(a) + console.log('B ', b[0].fields) + let newArray = [] // push field object from the res.data into a new array + b.forEach(cv => { + newArray.push(cv.fields) + }) + + this.setState({ room: newArray }); }) .catch(error => { console.log(error.response); }); }; - // axios - // .get('http://lambda-mud-test.herokuapp.com/api/adv/rooms/') //waiting for endpoint - // .then(res => { - // this.setState({ - // room: res.data - // }) - // }) - // .catch(e => { - // console.log(e) - // }) render() { - console.log("state", this.state.room); - const {room} = this.state - let objValues = Object.values(room) - - let b = JSON.stringify(objValues) - let c = JSON.parse(b) - console.log(c) - const { model, pk, fields } = c - console.log('object', objValues) - console.log('model', model) - console.log('pk', pk) - console.log('fields', fields) + room.forEach(cv=>console.log('cv',cv)) + console.log("state", room); + return (
    {this.state.room ? this.state.room.map(room => ( )) - : null} + : console.log('no keys')}
    ); } diff --git a/client/src/components/Room_detail.js b/client/src/components/Room_detail.js index 7f5800f39..cdba4f75e 100644 --- a/client/src/components/Room_detail.js +++ b/client/src/components/Room_detail.js @@ -2,9 +2,9 @@ import React from 'react' export default function Room_detail(props) { return ( -
    - {props.title} - {props.description} +
    +

    {props.title}

    +

    {props.description}

    ) } From 120871e62b7c100009e5fb502e38a1c46f0fb474 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Wed, 31 Jul 2019 15:49:16 -0400 Subject: [PATCH 20/38] props rendering in room_detail file --- client/src/components/Room_detail.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/components/Room_detail.js b/client/src/components/Room_detail.js index cdba4f75e..f9d85a4a1 100644 --- a/client/src/components/Room_detail.js +++ b/client/src/components/Room_detail.js @@ -1,10 +1,11 @@ import React from 'react' export default function Room_detail(props) { + console.log('in detail', props) return ( -
    -

    {props.title}

    -

    {props.description}

    +
    +

    {props.room.title}

    +

    {props.room.description}

    ) } From 4dd1ffdfa07480c9322aa8c6e00d814dc33ba308 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Wed, 31 Jul 2019 16:50:08 -0400 Subject: [PATCH 21/38] update com --- client/src/components/Room.js | 8 ++++---- client/src/components/Room_detail.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 7d8363138..4ca408fd4 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -30,10 +30,10 @@ export default class Room extends Component { headers: header }) .then(response => { - console.log('RAW RES FORM DATA ', response.data.rooms) + console.log('RAW RES FORM DATA ', response.data.rooms) //---checking data responses const a = Object.values(response.data) const b = JSON.parse(a) - console.log('B ', b[0].fields) + console.log('B ', b[0].fields) //---checking data responses let newArray = [] // push field object from the res.data into a new array b.forEach(cv => { newArray.push(cv.fields) @@ -47,9 +47,9 @@ export default class Room extends Component { }; render() { - const {room} = this.state + const {room} = this.state //to see if there are data in the state room.forEach(cv=>console.log('cv',cv)) - console.log("state", room); + console.log("state", room); //--->checking data in state return (
    diff --git a/client/src/components/Room_detail.js b/client/src/components/Room_detail.js index f9d85a4a1..50fb76d68 100644 --- a/client/src/components/Room_detail.js +++ b/client/src/components/Room_detail.js @@ -1,7 +1,6 @@ import React from 'react' export default function Room_detail(props) { - console.log('in detail', props) return (

    {props.room.title}

    From 67888546d8c61caf28f63060c6480f144edf0e75 Mon Sep 17 00:00:00 2001 From: sriley Date: Thu, 1 Aug 2019 11:47:12 -0400 Subject: [PATCH 22/38] init data working --- client/src/components/Init.js | 90 ++++++++++++++++++++++------------- client/src/components/Room.js | 33 +++++++------ 2 files changed, 74 insertions(+), 49 deletions(-) diff --git a/client/src/components/Init.js b/client/src/components/Init.js index 85b5511ca..75ad6fb1c 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -1,38 +1,60 @@ -import React, { Component } from 'react' -import axios from 'axios' +import React, { Component } from "react"; +import axios from "axios"; export default class Init extends Component { - state={ - uuid:'', - name:'', - title:'', - description:'', - players: [] - } - componentDidMount(){ - axios - .get('__link_to_player_detail__') - .then(res => { - this.setState({ - uuid:res.data.uuid, - name:res.data.username, - title:res.data.title, - description: res.data.description, - players: res.data.players - }) - }) + state = { + uuid: "", + name: "", + title: "", + description: "", + direction: "", + players: [], + key: localStorage.getItem("key") + }; + componentDidMount() { + if (localStorage.getItem("key")) { + this.init(); } + } - render() { - const {uuid, name, title, description, players} = this.state - return ( -
    -

    Your information

    -

    {uuid}

    -

    Your name: {name}

    -

    you are here at {title}

    -

    {description}

    -

    other player in the same area as you: {players.map(player => player)}

    -
    - ) - } + handleInput = event => { + this.setState({ + [event.target.id]: event.target.value + }); + }; + + init = () => { + const header = { + Authorization: `Token ${this.state.key}` + }; + console.log("HEADER", header) + axios + .get("http://lambda-mud-test.herokuapp.com/api/adv/init/", { + headers: header + }) + .then(res => { + this.setState({ + uuid: res.data.uuid, + name: res.data.username, + title: res.data.title, + description: res.data.description, + players: res.data.players + }); + }); + }; + + render() { + const { uuid, name, title, description, players } = this.state; + return ( +
    +

    Your information

    +

    {uuid}

    +

    Your name: {name}

    +

    you are here at {title}

    +

    {description}

    +

    + other player in the same area as you: {players.map(player => player)} +

    +
    + ); + } } diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 4ca408fd4..918ef4dba 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -1,6 +1,7 @@ import React, { Component } from "react"; import axios from "axios"; +import Init from "./Init" import RoomDetail from "./Room_detail"; export default class Room extends Component { @@ -11,7 +12,7 @@ export default class Room extends Component { componentDidMount() { if (localStorage.getItem("key")) { - this.getRooms(); + this.getRooms(); } } @@ -30,15 +31,15 @@ export default class Room extends Component { headers: header }) .then(response => { - console.log('RAW RES FORM DATA ', response.data.rooms) //---checking data responses - const a = Object.values(response.data) - const b = JSON.parse(a) - console.log('B ', b[0].fields) //---checking data responses - let newArray = [] // push field object from the res.data into a new array - b.forEach(cv => { - newArray.push(cv.fields) - }) - + // console.log("RAW RES FORM DATA ", response.data.rooms); //---checking data responses + const a = Object.values(response.data); + const b = JSON.parse(a); + // console.log("B ", b[0].fields); //---checking data responses + let newArray = []; // push field object from the res.data into a new array + b.forEach(cv => { + newArray.push(cv.fields); + }); + this.setState({ room: newArray }); }) .catch(error => { @@ -47,18 +48,20 @@ export default class Room extends Component { }; render() { - const {room} = this.state //to see if there are data in the state - room.forEach(cv=>console.log('cv',cv)) - console.log("state", room); //--->checking data in state - + // const { room } = this.state; //to see if there are data in the state + // room.forEach(cv => console.log("cv", cv)); + // console.log("state", room); //--->checking data in state + return (
    {this.state.room ? this.state.room.map(room => ( )) - : console.log('no keys')} + : console.log("no keys")} +
    + ); } } From 349e9d4b7570a3e9c371d86efe01ab5e88937a16 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 11:47:36 -0400 Subject: [PATCH 23/38] chages before pull --- client/src/App.js | 6 ++++-- client/src/components/Init.js | 3 ++- client/src/components/Map.js | 28 ++++++++++++++++++++++++++++ client/src/components/Room.js | 13 +++++++------ 4 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 client/src/components/Map.js diff --git a/client/src/App.js b/client/src/App.js index c470f0fd3..30d5e3dca 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -2,8 +2,8 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' import Login from './components/Login' -// import Init from './components/Init'; import Room from './components/Room'; +import Init from './components/Init'; @@ -14,7 +14,9 @@ function App() {
    - + + +
    diff --git a/client/src/components/Init.js b/client/src/components/Init.js index 85b5511ca..53669c22c 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -10,7 +10,7 @@ export default class Init extends Component { } componentDidMount(){ axios - .get('__link_to_player_detail__') + .get('http://lambda-mud-test.herokuapp.com/api/adv/init/') .then(res => { this.setState({ uuid:res.data.uuid, @@ -23,6 +23,7 @@ export default class Init extends Component { } render() { + console.log(this.state) const {uuid, name, title, description, players} = this.state return (
    diff --git a/client/src/components/Map.js b/client/src/components/Map.js new file mode 100644 index 000000000..ce5d6f47d --- /dev/null +++ b/client/src/components/Map.js @@ -0,0 +1,28 @@ +import React, { Component } from 'react' +import axios from 'axios' +export default class Map extends Component { + state={ + div:[] + } + renderDiv = (room) => { + if(room){ + return div render + } + return null + } + + render() { + + return ( +
    + From Map +
    + ) + } +} + + + + + + diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 4ca408fd4..9433fb402 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import axios from "axios"; - +import Map from './Map' import RoomDetail from "./Room_detail"; export default class Room extends Component { @@ -30,10 +30,10 @@ export default class Room extends Component { headers: header }) .then(response => { - console.log('RAW RES FORM DATA ', response.data.rooms) //---checking data responses + // console.log('RAW RES FORM DATA ', response.data.rooms) //---checking data responses const a = Object.values(response.data) const b = JSON.parse(a) - console.log('B ', b[0].fields) //---checking data responses + // console.log('B ', b[0].fields) //---checking data responses let newArray = [] // push field object from the res.data into a new array b.forEach(cv => { newArray.push(cv.fields) @@ -47,12 +47,13 @@ export default class Room extends Component { }; render() { - const {room} = this.state //to see if there are data in the state - room.forEach(cv=>console.log('cv',cv)) - console.log("state", room); //--->checking data in state + // const {room} = this.state //to see if there are data in the state + // room.forEach(cv=>console.log('cv',cv)) + // console.log("state", room); //--->checking data in state return (
    + {this.state.room ? this.state.room.map(room => ( From c411853f291dac773ba69e6c29bd8110d633bcb0 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 11:48:33 -0400 Subject: [PATCH 24/38] commit before pull --- client/src/components/Map.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/client/src/components/Map.js b/client/src/components/Map.js index ce5d6f47d..b1d8fb642 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -4,6 +4,35 @@ export default class Map extends Component { state={ div:[] } + + mapping = () => { + const max_x = 100; + const max_y = 100; + let x = 0; + let y = 0; + let cor = { x , y } + for(let i=0; i< max_x; i++){ + for(let j=0; j { + axios + .get('__link__here__') + .then(res => { + //get room information here + if(room.s_to||room.n_to||room.e_to||room.w_to > 0){ + div += + } + }) + } + + renderDiv = (room) => { if(room){ return div render From 8f69d2328aeb84a50d37e5fde5440e711326d5d5 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 13:39:36 -0400 Subject: [PATCH 25/38] live linkage --- client/src/components/Init.js | 4 ++- client/src/components/Login.js | 4 +-- client/src/components/Map.js | 49 +++------------------------------- client/src/components/Room.js | 38 +++++++++++++++----------- 4 files changed, 32 insertions(+), 63 deletions(-) diff --git a/client/src/components/Init.js b/client/src/components/Init.js index 53669c22c..53fcb859c 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -21,7 +21,8 @@ export default class Init extends Component { }) }) } - + + render() { console.log(this.state) const {uuid, name, title, description, players} = this.state @@ -33,6 +34,7 @@ export default class Init extends Component {

    you are here at {title}

    {description}

    other player in the same area as you: {players.map(player => player)}

    +
    ) } diff --git a/client/src/components/Login.js b/client/src/components/Login.js index d5b0a7a50..e0d0eebb8 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -23,7 +23,7 @@ class Login extends Component { }; // console.log(user); axios - .post("http://lambda-mud-test.herokuapp.com/api/registration/", user) + .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) .then(response => { localStorage.setItem("key", response.data.key); this.props.history.push("/room"); @@ -35,7 +35,7 @@ class Login extends Component { login = (username, password) => { axios - .post("http://lambda-mud-test.herokuapp.com/api/login/", { + .post("https://f-troop-adventures.herokuapp.com/api/login/", { username: username, password: password }) diff --git a/client/src/components/Map.js b/client/src/components/Map.js index b1d8fb642..c92021631 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -1,54 +1,13 @@ import React, { Component } from 'react' import axios from 'axios' export default class Map extends Component { - state={ - div:[] + state = { + grids:[ + + ] } - mapping = () => { - const max_x = 100; - const max_y = 100; - let x = 0; - let y = 0; - let cor = { x , y } - for(let i=0; i< max_x; i++){ - for(let j=0; j { - axios - .get('__link__here__') - .then(res => { - //get room information here - if(room.s_to||room.n_to||room.e_to||room.w_to > 0){ - div += - } - }) - } - - - renderDiv = (room) => { - if(room){ - return div render - } - return null - } - render() { - - return ( -
    - From Map -
    - ) - } -} diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 9433fb402..58ca655db 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import axios from "axios"; -import Map from './Map' +// import Map from './Map' import RoomDetail from "./Room_detail"; export default class Room extends Component { @@ -21,25 +21,32 @@ export default class Room extends Component { }); }; + handleMove = (e)=>{ + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {direction:[e.target.name], headers: header}) + .then(res => { + console.log(res.data) + }) + .catch(error => { + console.log(error.response); + }); + +} getRooms = () => { const header = { Authorization: `Token ${this.state.key}` }; axios - .get("http://lambda-mud-test.herokuapp.com/api/adv/rooms/", { + .get("https://f-troop-adventures.herokuapp.com/api/adv/rooms/", { headers: header }) .then(response => { - // console.log('RAW RES FORM DATA ', response.data.rooms) //---checking data responses - const a = Object.values(response.data) - const b = JSON.parse(a) - // console.log('B ', b[0].fields) //---checking data responses - let newArray = [] // push field object from the res.data into a new array - b.forEach(cv => { - newArray.push(cv.fields) - }) + console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses - this.setState({ room: newArray }); + this.setState({ room: response.data.result }); }) .catch(error => { console.log(error.response); @@ -47,18 +54,19 @@ export default class Room extends Component { }; render() { - // const {room} = this.state //to see if there are data in the state - // room.forEach(cv=>console.log('cv',cv)) - // console.log("state", room); //--->checking data in state + const {room} = this.state //to see if there are data in the state + room.forEach(cv=>console.log('cv',cv)) + console.log("state", room); //--->checking data in state return (
    - + {/* */} {this.state.room ? this.state.room.map(room => ( )) : console.log('no keys')} +
    ); } From e0210ace467b9ec219e7f5f17f573e42dcd1789e Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 13:40:54 -0400 Subject: [PATCH 26/38] typo --- client/src/components/Room.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 58ca655db..57cc8fd03 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -31,7 +31,7 @@ export default class Room extends Component { console.log(res.data) }) .catch(error => { - console.log(error.response); + console.log(error.response); }); } @@ -45,6 +45,7 @@ export default class Room extends Component { }) .then(response => { console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses + this.setState({ room: response.data.result }); }) From 2f163be500cf3596eec61ef90a5327f33048b8bd Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 16:42:17 -0400 Subject: [PATCH 27/38] working on mapping the game --- client/src/components/Init.js | 2 +- client/src/components/Map.js | 35 ++++++++++++++++++++++++++++++----- client/src/components/Room.js | 14 +++++++------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/client/src/components/Init.js b/client/src/components/Init.js index 53fcb859c..3aa00b1cf 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Init.js @@ -10,7 +10,7 @@ export default class Init extends Component { } componentDidMount(){ axios - .get('http://lambda-mud-test.herokuapp.com/api/adv/init/') + .get('https://f-troop-adventures.herokuapp.com/api/init/') .then(res => { this.setState({ uuid:res.data.uuid, diff --git a/client/src/components/Map.js b/client/src/components/Map.js index c92021631..b31f65102 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -2,15 +2,40 @@ import React, { Component } from 'react' import axios from 'axios' export default class Map extends Component { state = { - grids:[ - - ] + grid:[] } - - + componentDidMount() { + axios + .get('https://f-troop-adventures.herokuapp.com/api/adv/rooms/') + .then(res => { + this.setState({ grid: res.data }) + }) + .catch(err => console.log(err)) + } + + handleClick = e => { + const { result } = this.state.grid + result.forEach(cv => { + if(cv.e_to === cv.w_to){ + return(
    {cv}
    ) + } else if (cv.n_to===cv.s_to){ + return(
    {cv}
    ) + } + + }) + } + render () { + console.log('state ', this.state.grid.result) + return( +
    + +
    + ) + } +} diff --git a/client/src/components/Room.js b/client/src/components/Room.js index 57cc8fd03..f2759b1c9 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import axios from "axios"; -// import Map from './Map' +import Map from './Map' import RoomDetail from "./Room_detail"; export default class Room extends Component { @@ -26,7 +26,7 @@ export default class Room extends Component { Authorization: `Token ${this.state.key}` }; axios - .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {direction:[e.target.name], headers: header}) + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {direction:'n', headers: header}) .then(res => { console.log(res.data) }) @@ -44,7 +44,7 @@ export default class Room extends Component { headers: header }) .then(response => { - console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses + // console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses this.setState({ room: response.data.result }); @@ -55,13 +55,13 @@ export default class Room extends Component { }; render() { - const {room} = this.state //to see if there are data in the state - room.forEach(cv=>console.log('cv',cv)) - console.log("state", room); //--->checking data in state + // const {room} = this.state //to see if there are data in the state + // room.forEach(cv=>console.log('cv',cv)) + // console.log("state", room); //--->checking data in state return (
    - {/* */} + {this.state.room ? this.state.room.map(room => ( From e74def12dabd0daff4c28be8808082a52ec40d14 Mon Sep 17 00:00:00 2001 From: sriley Date: Thu, 1 Aug 2019 18:30:54 -0400 Subject: [PATCH 28/38] refactor init file and rooms into game file --- client/src/App.js | 6 +-- client/src/components/{Init.js => Game.js} | 38 +++++++++++++++++-- client/src/components/Login.js | 4 +- .../src/components/{ => deprecated}/Room.js | 38 +++++++++---------- 4 files changed, 56 insertions(+), 30 deletions(-) rename client/src/components/{Init.js => Game.js} (57%) rename client/src/components/{ => deprecated}/Room.js (61%) diff --git a/client/src/App.js b/client/src/App.js index 30d5e3dca..ae7f76819 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -2,8 +2,7 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' import Login from './components/Login' -import Room from './components/Room'; -import Init from './components/Init'; +import Game from './components/Game' @@ -14,8 +13,7 @@ function App() {
    - - +
    diff --git a/client/src/components/Init.js b/client/src/components/Game.js similarity index 57% rename from client/src/components/Init.js rename to client/src/components/Game.js index 75ad6fb1c..bfcdced6d 100644 --- a/client/src/components/Init.js +++ b/client/src/components/Game.js @@ -1,5 +1,9 @@ import React, { Component } from "react"; import axios from "axios"; + +import Map from "./Map"; +import RoomDetail from "./Room_detail"; + export default class Init extends Component { state = { uuid: "", @@ -8,6 +12,7 @@ export default class Init extends Component { description: "", direction: "", players: [], + room: [], key: localStorage.getItem("key") }; componentDidMount() { @@ -26,10 +31,10 @@ export default class Init extends Component { const header = { Authorization: `Token ${this.state.key}` }; - console.log("HEADER", header) + console.log("HEADER", header); axios - .get("http://lambda-mud-test.herokuapp.com/api/adv/init/", { - headers: header + .get("https://f-troop-adventures.herokuapp.com/api/adv/init/", { + headers: header }) .then(res => { this.setState({ @@ -42,11 +47,27 @@ export default class Init extends Component { }); }; + handleMove = e => { + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", { + direction: "n", + headers: header + }) + .then(res => { + console.log(res.data); + }) + .catch(error => { + console.log(error.response); + }); + }; render() { const { uuid, name, title, description, players } = this.state; return (
    -

    Your information

    +

    Your information:

    {uuid}

    Your name: {name}

    you are here at {title}

    @@ -54,6 +75,15 @@ export default class Init extends Component {

    other player in the same area as you: {players.map(player => player)}

    + + {this.state.room + ? this.state.room.map(room => ( + + )) + : console.log("no keys")} +
    ); } diff --git a/client/src/components/Login.js b/client/src/components/Login.js index e0d0eebb8..9154682a2 100644 --- a/client/src/components/Login.js +++ b/client/src/components/Login.js @@ -26,7 +26,7 @@ class Login extends Component { .post("https://f-troop-adventures.herokuapp.com/api/registration/", user) .then(response => { localStorage.setItem("key", response.data.key); - this.props.history.push("/room"); + this.props.history.push("/game"); }) .catch(error => { console.log(error.response); @@ -41,7 +41,7 @@ class Login extends Component { }) .then(response => { localStorage.setItem("key", response.data.key); - this.props.history.push("/room"); + this.props.history.push("/game"); }) .catch(error => { console.log(error.response); diff --git a/client/src/components/Room.js b/client/src/components/deprecated/Room.js similarity index 61% rename from client/src/components/Room.js rename to client/src/components/deprecated/Room.js index dbe38396e..edef5c4ba 100644 --- a/client/src/components/Room.js +++ b/client/src/components/deprecated/Room.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import axios from "axios"; -import Map from './Map' -import RoomDetail from "./Room_detail"; +import Map from "../Map"; +import RoomDetail from "../Room_detail"; export default class Room extends Component { state = { @@ -21,20 +21,22 @@ export default class Room extends Component { }); }; - handleMove = (e)=>{ + handleMove = e => { const header = { Authorization: `Token ${this.state.key}` }; axios - .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {direction:'n', headers: header}) - .then(res => { - console.log(res.data) - }) - .catch(error => { + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", { + direction: "n", + headers: header + }) + .then(res => { + console.log(res.data); + }) + .catch(error => { console.log(error.response); - }); - -} + }); + }; getRooms = () => { const header = { Authorization: `Token ${this.state.key}` @@ -44,9 +46,8 @@ export default class Room extends Component { headers: header }) .then(response => { - // console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses + // console.log('RAW RES FORM DATA ', response.data.result) //---checking data responses - this.setState({ room: response.data.result }); }) .catch(error => { @@ -55,10 +56,6 @@ export default class Room extends Component { }; render() { - // const {room} = this.state //to see if there are data in the state - // room.forEach(cv=>console.log('cv',cv)) - // console.log("state", room); //--->checking data in state - return (
    @@ -66,10 +63,11 @@ export default class Room extends Component { ? this.state.room.map(room => ( )) - : console.log('no keys')} - + : console.log("no keys")} +
    - ); } } From bcd65552081083836fe1f44e7e2361caef843e77 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Thu, 1 Aug 2019 18:37:00 -0400 Subject: [PATCH 29/38] commit before pull --- client/src/components/Map.js | 30 +++++------------ client/src/components/Room.js | 63 ++++++++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 26 deletions(-) diff --git a/client/src/components/Map.js b/client/src/components/Map.js index b31f65102..80f8cc5a2 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -2,40 +2,26 @@ import React, { Component } from 'react' import axios from 'axios' export default class Map extends Component { state = { - grid:[] + results:'' } componentDidMount() { axios - .get('https://f-troop-adventures.herokuapp.com/api/adv/rooms/') + .get('https://f-troop-adventures.herokuapp.com/api/adv/getmap/') .then(res => { - this.setState({ grid: res.data }) + console.log(res.data) + this.setState({ + results : res.data + }) }) .catch(err => console.log(err)) } - - handleClick = e => { - const { result } = this.state.grid - result.forEach(cv => { - if(cv.e_to === cv.w_to){ - return(
    {cv}
    ) - } else if (cv.n_to===cv.s_to){ - return(
    {cv}
    ) - } - - }) - } - - - render () { - console.log('state ', this.state.grid.result) + console.log('state ', this.state.results.map) return( -
    - -
    +
    ) } } diff --git a/client/src/components/Room.js b/client/src/components/Room.js index f2759b1c9..030c2660b 100644 --- a/client/src/components/Room.js +++ b/client/src/components/Room.js @@ -21,20 +21,72 @@ export default class Room extends Component { }); }; - handleMove = (e)=>{ + handleMove_n = (e)=>{ const header = { Authorization: `Token ${this.state.key}` }; axios - .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {direction:'n', headers: header}) + .post("http://lambda-mud-test.herokuapp.com/api/adv/move/", {headers: header, direction:'n'}) + .then(res => { + console.log(res.data.result) + const { result }= res.data + result.forEach(cv=> { + if (cv.n_to){ + return(cv.description) + } + else{ + throw new Error('nope') + } + }) + + }) + .catch(error => { + console.log(error.response); + }); + } + handleMove_w = (e)=>{ + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {headers: header, direction:'w'}) .then(res => { console.log(res.data) }) .catch(error => { console.log(error.response); }); + } + handleMove_e = (e)=>{ + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {headers: header, direction:'e'}) + .then(res => { + console.log(res.data) + }) + .catch(error => { + console.log(error.response); + }); + } + handleMove_s = (e)=>{ + const header = { + Authorization: `Token ${this.state.key}` + }; + axios + .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", {headers: header, direction:'s'}) + .then(res => { + console.log(res.data) + }) + .catch(error => { + console.log(error.response); + }); + } + + + -} getRooms = () => { const header = { Authorization: `Token ${this.state.key}` @@ -67,7 +119,10 @@ export default class Room extends Component { )) : console.log('no keys')} - + + + +
    ); } From a5d684eb858df0c5809161c184879c62b9ff6144 Mon Sep 17 00:00:00 2001 From: sriley Date: Thu, 1 Aug 2019 20:25:07 -0400 Subject: [PATCH 30/38] refactor --- client/src/components/Game.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Game.js b/client/src/components/Game.js index bfcdced6d..70ee18ed4 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -39,7 +39,7 @@ export default class Init extends Component { .then(res => { this.setState({ uuid: res.data.uuid, - name: res.data.username, + name: res.data.name, title: res.data.title, description: res.data.description, players: res.data.players @@ -75,7 +75,7 @@ export default class Init extends Component {

    other player in the same area as you: {players.map(player => player)}

    - + {this.state.room ? this.state.room.map(room => ( From b34ff26ea5b58b098cc364211767522d22f2f6ca Mon Sep 17 00:00:00 2001 From: sriley Date: Thu, 1 Aug 2019 20:26:19 -0400 Subject: [PATCH 31/38] ammend --- client/src/components/Game.js | 39 +++++++++++-------- client/src/components/Map.js | 2 +- .../{ => deprecated}/Room_detail.js | 0 3 files changed, 23 insertions(+), 18 deletions(-) rename client/src/components/{ => deprecated}/Room_detail.js (100%) diff --git a/client/src/components/Game.js b/client/src/components/Game.js index 70ee18ed4..cf57d9db1 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import axios from "axios"; import Map from "./Map"; -import RoomDetail from "./Room_detail"; + export default class Init extends Component { state = { @@ -10,9 +10,7 @@ export default class Init extends Component { name: "", title: "", description: "", - direction: "", players: [], - room: [], key: localStorage.getItem("key") }; componentDidMount() { @@ -47,20 +45,20 @@ export default class Init extends Component { }); }; - handleMove = e => { + handleMove = () => { const header = { Authorization: `Token ${this.state.key}` }; axios .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", { - direction: "n", - headers: header + headers: header, + direction: 'n' }) .then(res => { - console.log(res.data); + console.log("MOVE RES", res.data.title); }) .catch(error => { - console.log(error.response); + console.log(error); }); }; render() { @@ -75,15 +73,22 @@ export default class Init extends Component {

    other player in the same area as you: {players.map(player => player)}

    - - {this.state.room - ? this.state.room.map(room => ( - - )) - : console.log("no keys")} - + + +
    + + + + +
    ); } diff --git a/client/src/components/Map.js b/client/src/components/Map.js index 80f8cc5a2..16b8ed05a 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -19,7 +19,7 @@ export default class Map extends Component { } render () { - console.log('state ', this.state.results.map) + // console.log('state ', this.state.results.map) return(
    ) diff --git a/client/src/components/Room_detail.js b/client/src/components/deprecated/Room_detail.js similarity index 100% rename from client/src/components/Room_detail.js rename to client/src/components/deprecated/Room_detail.js From 7376e5f8d3e11a64a3014f13279af882ccc85482 Mon Sep 17 00:00:00 2001 From: sriley Date: Thu, 1 Aug 2019 20:36:39 -0400 Subject: [PATCH 32/38] move buttons working --- client/src/components/Game.js | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/client/src/components/Game.js b/client/src/components/Game.js index cf57d9db1..d5d2edbee 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -3,7 +3,6 @@ import axios from "axios"; import Map from "./Map"; - export default class Init extends Component { state = { uuid: "", @@ -45,15 +44,18 @@ export default class Init extends Component { }); }; - handleMove = () => { + handleMove = (direction) => { const header = { Authorization: `Token ${this.state.key}` }; axios - .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", { - headers: header, - direction: 'n' - }) + .post( + "https://f-troop-adventures.herokuapp.com/api/adv/move/", + { direction: direction }, + { + headers: header + } + ) .then(res => { console.log("MOVE RES", res.data.title); }) @@ -74,18 +76,30 @@ export default class Init extends Component { other player in the same area as you: {players.map(player => player)}

    - +
    - - - -
    From ca6e877eb0d42c998b3c046cd433510dec4ba314 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Fri, 2 Aug 2019 10:31:01 -0400 Subject: [PATCH 33/38] DOM update moves --- client/src/components/Game.js | 64 ++++++++++++++++++++++++----------- client/src/components/Map.js | 4 +-- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/client/src/components/Game.js b/client/src/components/Game.js index bfcdced6d..2a4cf022d 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -2,7 +2,6 @@ import React, { Component } from "react"; import axios from "axios"; import Map from "./Map"; -import RoomDetail from "./Room_detail"; export default class Init extends Component { state = { @@ -10,9 +9,7 @@ export default class Init extends Component { name: "", title: "", description: "", - direction: "", players: [], - room: [], key: localStorage.getItem("key") }; componentDidMount() { @@ -39,7 +36,7 @@ export default class Init extends Component { .then(res => { this.setState({ uuid: res.data.uuid, - name: res.data.username, + name: res.data.name, title: res.data.title, description: res.data.description, players: res.data.players @@ -47,20 +44,26 @@ export default class Init extends Component { }); }; - handleMove = e => { + handleMove = (direction) => { const header = { Authorization: `Token ${this.state.key}` }; axios - .post("https://f-troop-adventures.herokuapp.com/api/adv/move/", { - direction: "n", - headers: header - }) + .post( + "https://f-troop-adventures.herokuapp.com/api/adv/move/", + { direction: direction }, + { + headers: header + } + ) .then(res => { - console.log(res.data); + console.log("MOVE RES", res.data.title); + this.setState({ + title: res.data.title, description: res.data.description + }) }) .catch(error => { - console.log(error.response); + console.log(error); }); }; render() { @@ -71,19 +74,40 @@ export default class Init extends Component {

    {uuid}

    Your name: {name}

    you are here at {title}

    -

    {description}

    other player in the same area as you: {players.map(player => player)}

    - {this.state.room - ? this.state.room.map(room => ( - - )) - : console.log("no keys")} - + +
    + + + + + +
    +
    {this.state.title}
    +

    {description}

    ); } diff --git a/client/src/components/Map.js b/client/src/components/Map.js index 80f8cc5a2..408b5a186 100644 --- a/client/src/components/Map.js +++ b/client/src/components/Map.js @@ -10,7 +10,7 @@ export default class Map extends Component { axios .get('https://f-troop-adventures.herokuapp.com/api/adv/getmap/') .then(res => { - console.log(res.data) + // console.log(res.data) this.setState({ results : res.data }) @@ -19,7 +19,7 @@ export default class Map extends Component { } render () { - console.log('state ', this.state.results.map) + // console.log('state ', this.state.results.map) return(
    ) From 30cf1fe66f4dce8920bf0b819628b75cf266a352 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Fri, 2 Aug 2019 10:39:15 -0400 Subject: [PATCH 34/38] style change --- client/src/components/Game.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/Game.js b/client/src/components/Game.js index 2a4cf022d..714948961 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -106,8 +106,11 @@ export default class Init extends Component {
    -
    {this.state.title}
    +
    +

    {title}

    {description}

    +
    +
    ); } From 8db80e77f6fc3482d3f25ba8931979c432b5c111 Mon Sep 17 00:00:00 2001 From: sriley Date: Fri, 2 Aug 2019 11:18:16 -0400 Subject: [PATCH 35/38] added .toml file --- client/netlify.toml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 client/netlify.toml diff --git a/client/netlify.toml b/client/netlify.toml new file mode 100644 index 000000000..7a91e2ce3 --- /dev/null +++ b/client/netlify.toml @@ -0,0 +1,9 @@ +[build] +base = "LambdaMUD-Client" +publish = "LambdaMUD-Client/build" +command = "yarn build" + +[[redirects]] +from = "/*" +to = "/index.html" +status = 200 \ No newline at end of file From fead662ffcc9900c093c1401f2f8e6d67b90ca36 Mon Sep 17 00:00:00 2001 From: chef27615 Date: Fri, 2 Aug 2019 11:27:30 -0400 Subject: [PATCH 36/38] basic css --- client/src/App.css | 28 ++++++++++++++++++++++++++++ client/src/App.js | 2 +- client/src/components/Game.js | 24 ++++++++++++++---------- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/client/src/App.css b/client/src/App.css index e69de29bb..c96a7071e 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -0,0 +1,28 @@ +*{ + box-sizing: border-box; +} + +.App{ + width: 800px; + height: 100vh; + margin: 0 auto; +} +.App .control_panel { + display: flex; +} + +.user_info p{ + text-align: center; +} +.directions{ + display: flex; + padding-bottom: 50px; +} +.disc{ + padding-left: 5%; +} +.App .control_panel div { + align-self: center; + /* border: 1px solid black; */ + margin: 0 auto +} \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index ae7f76819..48144503f 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,6 +1,6 @@ import React from 'react'; import { Switch, Route } from 'react-router-dom' - +import './App.css' import Login from './components/Login' import Game from './components/Game' diff --git a/client/src/components/Game.js b/client/src/components/Game.js index 714948961..4d5b3e64e 100644 --- a/client/src/components/Game.js +++ b/client/src/components/Game.js @@ -69,15 +69,19 @@ export default class Init extends Component { render() { const { uuid, name, title, description, players } = this.state; return ( -
    -

    Your information:

    -

    {uuid}

    -

    Your name: {name}

    -

    you are here at {title}

    -

    - other player in the same area as you: {players.map(player => player)} -

    - +
    +
    +

    Your information:

    +

    {uuid}

    +

    Your name: {name}

    +

    you are here at {title}

    +

    + other player in the same area as you: {players.map(player => player)} +

    +
    +
    + +
    -
    +

    {title}

    {description}

    From 9e3e979d97d811b18dedabd1f3efb3ba1112228a Mon Sep 17 00:00:00 2001 From: sriley Date: Fri, 2 Aug 2019 11:32:01 -0400 Subject: [PATCH 37/38] edit toml --- client/netlify.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/netlify.toml b/client/netlify.toml index 7a91e2ce3..76559739e 100644 --- a/client/netlify.toml +++ b/client/netlify.toml @@ -1,6 +1,6 @@ [build] -base = "LambdaMUD-Client" -publish = "LambdaMUD-Client/build" +base = "client" +publish = "client/build" command = "yarn build" [[redirects]] From f5bbb64f6a6b8ba77fa9f328066a9fa56594dcba Mon Sep 17 00:00:00 2001 From: sriley Date: Fri, 2 Aug 2019 11:44:56 -0400 Subject: [PATCH 38/38] edit --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e5734085b..cb7d5efa0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # LambdaMUD-Client Front-end for the [LambdaMUD-Project](https://github.com/LambdaSchool/LambdaMUD-Project). -Fork this repo and put your front-end client code in your fork.